|
| | HighDynamicRange () |
| | Default constructor.
|
| |
| | HighDynamicRange (int width, int height) |
| | Constructs high dynamic range processor of specified size work buffers.
|
| |
| | HighDynamicRange (const HighDynamicRange &rhs) |
| | Copy constructor.
|
| |
| | HighDynamicRange (HighDynamicRange &&rhs) noexcept |
| | Move constructor.
|
| |
| virtual | ~HighDynamicRange () |
| | Destructor.
|
| |
| HighDynamicRange & | operator= (const HighDynamicRange &rhs) |
| | Copy assignment operator.
|
| |
| HighDynamicRange & | operator= (HighDynamicRange &&rhs) noexcept |
| | Move assignment operator.
|
| |
| void | resize (int width, int height) |
| | Resizes work buffers.
|
| |
| void | clear () |
| | Resizes work buffers to zero width and zero height.
|
| |
| int | width () const |
| | Width of the work buffers.
|
| |
| int | height () const |
| | Height of the work buffers.
|
| |
| void | setLimits (float limitMin, float limitMax) |
| | Sets limits for correctly exposed sample values.
|
| |
| void | limits (float &limitMin, float &limitMax) const |
| | Retrieves limits for correctly exposed sample values.
|
| |
| void | calcHDR (const T *const *ppSrcImages, const int *pSrcImagesStep, const float *pSrcExposures, int count, float *pDst, int dstStep, uint8_t *pDstImproperlyExposed, int dstImproperlyExposedStep, int roiWidth, int roiHeight, const float *const pSrcCameraResponseInvCoeffs[], int lenCoeffs) |
| | Convert a set of images from a nonlinear color encoding to a high dynamic range image.
|
| |
template<typename T, size_t C>
class blo::HighDynamicRange< T, C >
High dynamic range (HDR) processor.
- Template Parameters
-
| T | Data type of the source images. |
| C | Number of channels. |
template<typename T , size_t C>
| void blo::HighDynamicRange< T, C >::calcHDR |
( |
const T *const * |
ppSrcImages, |
|
|
const int * |
pSrcImagesStep, |
|
|
const float * |
pSrcExposures, |
|
|
int |
count, |
|
|
float * |
pDst, |
|
|
int |
dstStep, |
|
|
uint8_t * |
pDstImproperlyExposed, |
|
|
int |
dstImproperlyExposedStep, |
|
|
int |
roiWidth, |
|
|
int |
roiHeight, |
|
|
const float *const |
pSrcCameraResponseInvCoeffs[], |
|
|
int |
lenCoeffs |
|
) |
| |
Convert a set of images from a nonlinear color encoding to a high dynamic range image.
Given a set of images from a nonlinear color encoding and associated exposures, and the inverse of the camera response function, which maps the images from a nonlinear color encoding to a linear color space, this function calculates the corresponding (linear) high dynamic range image.
If a sample is not properly exposed in at least one exposure, then it is handled as follows.
- If a sample is underexposed over all exposures, then it is set to the minimum properly exposed high dynamic range sample value in the high dynamic range image.
- If a sample is overexposed over all exposures, then it is set to the maximum properly exposed high dynamic range sample value in the high dynamic range image.
- Otherwise, the improperly exposed sample is a combination of underexposed and overexposed over all exposures. In this case, it is set to the minimum properly exposed high dynamic range sample value in the high dynamic range image and set to 255 in the destination improperly exposed image.
- Note
- The destination improperly exposed image is a C channel image.
- Parameters
-
| ppSrcImages | Pointer to the pointers to the source images. |
| pSrcImagesStep | Pointer to the steps in bytes between the rows in the source images. |
| pSrcExposures | Pointer to the source array containing the exposures (e.g., exposure times or shutter speeds in seconds). |
| count | Number of source images and exposures. |
| pDst | Pointer to the destination high dynamic range image. |
| dstStep | Step in bytes between the rows in the destination high dynamic range image. |
| pDstImproperlyExposed | Pointer to the destination improperly exposed image. |
| dstImproperlyExposedStep | Step in bytes between the rows in the destination improperly exposed image. |
| roiWidth | Width of the source and destination image ROI in pixels. |
| roiHeight | Height of the source and destination image ROI in pixels. |
| pSrcCameraResponseInvCoeffs | Array of pointers to the source vectors of coefficients of a polynomial, ordered in descending powers, modeling the inverse of the camera response function for each channel. |
| lenCoeffs | Length of the source vectors of polynomial coefficients. |
template<typename T , size_t C>
Sets limits for correctly exposed sample values.
This function sets the limits for correctly exposed sample values. Sample values less than the minimum correctly exposed sample value are considered underexposed. Sample values greater than the maximum correctly exposed sample value are considered overexposed. Incorrectly exposed sample values are not used in the calculation of the high dynamic range image.
- Note
- Suggested argument values
limitMin = (2^b_n - 1) / (2^b - 1)
limitMax = 1
where b is the number of bits used to represent the measurement and b_n is the number of those bits used to characterize the noise.
- Parameters
-
| limitMin | The minimum correctly exposed sample value in the range [0, 1]. |
| limitMax | The maximum correctly exposed sample value in the range [0, 1]. |