The blo Library
Loading...
Searching...
No Matches
Public Member Functions | Related Functions | List of all members
blo::HighDynamicRange< T, C > Class Template Reference

High dynamic range (HDR) processor. More...

#include <HighDynamicRange.h>

Public Member Functions

 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.
 

Related Functions

(Note that these are not member functions.)

BLO_EXPIMP_TEMPLATE template class BLO_API HighDynamicRange< uint8_t, 1 >
 
BLO_EXPIMP_TEMPLATE template class BLO_API HighDynamicRange< uint16_t, 1 >
 
BLO_EXPIMP_TEMPLATE template class BLO_API HighDynamicRange< float, 1 >
 
BLO_EXPIMP_TEMPLATE template class BLO_API HighDynamicRange< uint8_t, 3 >
 
BLO_EXPIMP_TEMPLATE template class BLO_API HighDynamicRange< uint16_t, 3 >
 
BLO_EXPIMP_TEMPLATE template class BLO_API HighDynamicRange< float, 3 >
 

Detailed Description

template<typename T, size_t C>
class blo::HighDynamicRange< T, C >

High dynamic range (HDR) processor.

Template Parameters
TData type of the source images.
CNumber of channels.

Constructor & Destructor Documentation

◆ HighDynamicRange() [1/4]

template<typename T , size_t C>
blo::HighDynamicRange< T, C >::HighDynamicRange ( )

Default constructor.

◆ HighDynamicRange() [2/4]

template<typename T , size_t C>
blo::HighDynamicRange< T, C >::HighDynamicRange ( int  width,
int  height 
)

Constructs high dynamic range processor of specified size work buffers.

Parameters
widthWidth of the work buffers in pixels.
heightHeight of the work buffers in pixels.

◆ HighDynamicRange() [3/4]

template<typename T , size_t C>
blo::HighDynamicRange< T, C >::HighDynamicRange ( const HighDynamicRange< T, C > &  rhs)

Copy constructor.

◆ HighDynamicRange() [4/4]

template<typename T , size_t C>
blo::HighDynamicRange< T, C >::HighDynamicRange ( HighDynamicRange< T, C > &&  rhs)
noexcept

Move constructor.

◆ ~HighDynamicRange()

template<typename T , size_t C>
virtual blo::HighDynamicRange< T, C >::~HighDynamicRange ( )
virtual

Destructor.

Member Function Documentation

◆ calcHDR()

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
ppSrcImagesPointer to the pointers to the source images.
pSrcImagesStepPointer to the steps in bytes between the rows in the source images.
pSrcExposuresPointer to the source array containing the exposures (e.g., exposure times or shutter speeds in seconds).
countNumber of source images and exposures.
pDstPointer to the destination high dynamic range image.
dstStepStep in bytes between the rows in the destination high dynamic range image.
pDstImproperlyExposedPointer to the destination improperly exposed image.
dstImproperlyExposedStepStep in bytes between the rows in the destination improperly exposed image.
roiWidthWidth of the source and destination image ROI in pixels.
roiHeightHeight of the source and destination image ROI in pixels.
pSrcCameraResponseInvCoeffsArray 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.
lenCoeffsLength of the source vectors of polynomial coefficients.

◆ clear()

template<typename T , size_t C>
void blo::HighDynamicRange< T, C >::clear ( )

Resizes work buffers to zero width and zero height.

◆ height()

template<typename T , size_t C>
int blo::HighDynamicRange< T, C >::height ( ) const

Height of the work buffers.

Returns
Height of the work buffers in pixels.

◆ limits()

template<typename T , size_t C>
void blo::HighDynamicRange< T, C >::limits ( float &  limitMin,
float &  limitMax 
) const

Retrieves limits for correctly exposed sample values.

Parameters
limitMinThe minimum correctly exposed sample value.
limitMaxThe maximum correctly exposed sample value.

◆ operator=() [1/2]

template<typename T , size_t C>
HighDynamicRange & blo::HighDynamicRange< T, C >::operator= ( const HighDynamicRange< T, C > &  rhs)

Copy assignment operator.

◆ operator=() [2/2]

template<typename T , size_t C>
HighDynamicRange & blo::HighDynamicRange< T, C >::operator= ( HighDynamicRange< T, C > &&  rhs)
noexcept

Move assignment operator.

◆ resize()

template<typename T , size_t C>
void blo::HighDynamicRange< T, C >::resize ( int  width,
int  height 
)

Resizes work buffers.

Parameters
widthWidth in pixels to resize work buffers to.
heightHeight in pixels to resize work buffers to.

◆ setLimits()

template<typename T , size_t C>
void blo::HighDynamicRange< T, C >::setLimits ( float  limitMin,
float  limitMax 
)

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
limitMinThe minimum correctly exposed sample value in the range [0, 1].
limitMaxThe maximum correctly exposed sample value in the range [0, 1].

◆ width()

template<typename T , size_t C>
int blo::HighDynamicRange< T, C >::width ( ) const

Width of the work buffers.

Returns
Width of the work buffers in pixels.

Friends And Related Function Documentation

◆ HighDynamicRange< float, 1 >

template<typename T , size_t C>
BLO_EXPIMP_TEMPLATE template class BLO_API HighDynamicRange< float, 1 >
related

◆ HighDynamicRange< float, 3 >

template<typename T , size_t C>
BLO_EXPIMP_TEMPLATE template class BLO_API HighDynamicRange< float, 3 >
related

◆ HighDynamicRange< uint16_t, 1 >

template<typename T , size_t C>
BLO_EXPIMP_TEMPLATE template class BLO_API HighDynamicRange< uint16_t, 1 >
related

◆ HighDynamicRange< uint16_t, 3 >

template<typename T , size_t C>
BLO_EXPIMP_TEMPLATE template class BLO_API HighDynamicRange< uint16_t, 3 >
related

◆ HighDynamicRange< uint8_t, 1 >

template<typename T , size_t C>
BLO_EXPIMP_TEMPLATE template class BLO_API HighDynamicRange< uint8_t, 1 >
related

◆ HighDynamicRange< uint8_t, 3 >

template<typename T , size_t C>
BLO_EXPIMP_TEMPLATE template class BLO_API HighDynamicRange< uint8_t, 3 >
related

The documentation for this class was generated from the following file: