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

Image histogram processor. More...

#include <ImageHistogram.h>

Public Member Functions

 ImageHistogram ()
 Default constructor.
 
 ImageHistogram (int roiWidth, int roiHeight)
 Constructs image histogram processor of specified size work buffers.
 
 ImageHistogram (const ImageHistogram &rhs)
 Copy constructor.
 
 ImageHistogram (ImageHistogram &&rhs) noexcept
 Move constructor.
 
virtual ~ImageHistogram ()
 Destructor.
 
ImageHistogram & operator= (const ImageHistogram &rhs)
 Copy assignment operator.
 
ImageHistogram & operator= (ImageHistogram &&rhs) noexcept
 Move assignment operator.
 
void resize (int roiWidth, int roiHeight)
 Resizes work buffers.
 
void clear ()
 Resizes work buffers to zero size.
 
void setLevels (const float *const pSrcLevels[], const int srcNumLevels[])
 Sets the histogram levels.
 
void numLevels (int dstNumLevels[]) const
 Number of histogram levels.
 
void levels (float *const pDstLevels[]) const
 Histogram level values.
 
void numBins (uint32_t dstNumBins[]) const
 Number of histogram bins.
 
void calcHistogram (const T *pSrc, int srcStep, int roiWidth, int roiHeight, uint32_t *const pDstHist[])
 Computes the histogram of an image.
 

Static Public Member Functions

static void levelsUniformStep (float lowerLevel, float upperLevel, float *const pDstLevels[], int numLevels)
 Calculates the uniformly distributed levels for a histogram.
 
static void levelsUniformStep (const float srcLowerLevel[], const float srcUpperLevel[], float *const pDstLevels[], const int numLevels[])
 Calculates the uniformly distributed levels for a histogram.
 

Related Functions

(Note that these are not member functions.)

BLO_EXPIMP_TEMPLATE template class BLO_API ImageHistogram< uint8_t, 1 >
 
BLO_EXPIMP_TEMPLATE template class BLO_API ImageHistogram< uint8_t, 3 >
 
BLO_EXPIMP_TEMPLATE template class BLO_API ImageHistogram< uint8_t, 4 >
 
BLO_EXPIMP_TEMPLATE template class BLO_API ImageHistogram< uint16_t, 1 >
 
BLO_EXPIMP_TEMPLATE template class BLO_API ImageHistogram< uint16_t, 3 >
 
BLO_EXPIMP_TEMPLATE template class BLO_API ImageHistogram< uint16_t, 4 >
 
BLO_EXPIMP_TEMPLATE template class BLO_API ImageHistogram< int16_t, 1 >
 
BLO_EXPIMP_TEMPLATE template class BLO_API ImageHistogram< int16_t, 3 >
 
BLO_EXPIMP_TEMPLATE template class BLO_API ImageHistogram< int16_t, 4 >
 
BLO_EXPIMP_TEMPLATE template class BLO_API ImageHistogram< float, 1 >
 
BLO_EXPIMP_TEMPLATE template class BLO_API ImageHistogram< float, 3 >
 
BLO_EXPIMP_TEMPLATE template class BLO_API ImageHistogram< float, 4 >
 

Detailed Description

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

Image histogram processor.

Template Parameters
TData type.
CNumber of channels.

Constructor & Destructor Documentation

◆ ImageHistogram() [1/4]

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

Default constructor.

◆ ImageHistogram() [2/4]

template<typename T , size_t C>
blo::ImageHistogram< T, C >::ImageHistogram ( int  roiWidth,
int  roiHeight 
)

Constructs image histogram processor of specified size work buffers.

Parameters
roiWidthWidth of the image ROI in pixels to resize work buffers to.
roiHeightHeight of the image ROI in pixels to resize work buffers to.

◆ ImageHistogram() [3/4]

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

Copy constructor.

◆ ImageHistogram() [4/4]

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

Move constructor.

◆ ~ImageHistogram()

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

Destructor.

Member Function Documentation

◆ calcHistogram()

template<typename T , size_t C>
void blo::ImageHistogram< T, C >::calcHistogram ( const T *  pSrc,
int  srcStep,
int  roiWidth,
int  roiHeight,
uint32_t *const  pDstHist[] 
)

Computes the histogram of an image.

Note
For a given channel, the n-th histogram bin will be the number of source image pixel values that are greater than or equal to the n-th level, and less than the (n+1)-th level.
Parameters
pSrcPointer to the source image.
srcStepStep in bytes between the rows in the source image.
roiWidthWidth of the source image ROI in pixels.
roiHeightHeight of the source image ROI in pixels.
pDstHistArray of pointers to the computed histogram for each channel.

◆ clear()

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

Resizes work buffers to zero size.

◆ levels()

template<typename T , size_t C>
void blo::ImageHistogram< T, C >::levels ( float *const  pDstLevels[]) const

Histogram level values.

Parameters
pDstLevelsArray of pointers to the histogram levels for each channel.

◆ levelsUniformStep() [1/2]

template<typename T , size_t C>
static void blo::ImageHistogram< T, C >::levelsUniformStep ( const float  srcLowerLevel[],
const float  srcUpperLevel[],
float *const  pDstLevels[],
const int  numLevels[] 
)
static

Calculates the uniformly distributed levels for a histogram.

Note
The number of histogram levels is one plus the number of histogram bins for each channel. For a given channel, the n-th histogram bin will be the number of source image pixel values that are greater than or equal to the n-th level, and less than the (n+1)-th level.
Parameters
srcLowerLevelArray of the lower level for uniform histogram for each channel.
srcUpperLevelArray of the upper level for uniform histogram for each channel.
pDstLevelsArray of pointers to the histogram levels for each channel.
numLevelsArray of the number of levels for each channel.

◆ levelsUniformStep() [2/2]

template<typename T , size_t C>
static void blo::ImageHistogram< T, C >::levelsUniformStep ( float  lowerLevel,
float  upperLevel,
float *const  pDstLevels[],
int  numLevels 
)
static

Calculates the uniformly distributed levels for a histogram.

This function sets the uniformly distributed histogram levels used when calculating the histogram.

Note
The number of histogram levels is one plus the number of histogram bins for each channel. For a given channel, the n-th histogram bin will be the number of source image pixel values that are greater than or equal to the n-th level, and less than the (n+1)-th level.
Parameters
lowerLevelLower level for uniform histogram for all channels.
upperLevelUpper level for uniform histogram for all channels.
pDstLevelsArray of pointers to the histogram levels for each channel.
numLevelsNumber of levels for all channel.

◆ numBins()

template<typename T , size_t C>
void blo::ImageHistogram< T, C >::numBins ( uint32_t  dstNumBins[]) const

Number of histogram bins.

Parameters
dstNumBinsArray of the number of histogram bins for each channel.

◆ numLevels()

template<typename T , size_t C>
void blo::ImageHistogram< T, C >::numLevels ( int  dstNumLevels[]) const

Number of histogram levels.

Parameters
dstNumLevelsArray of the number of levels for each channel.

◆ operator=() [1/2]

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

Copy assignment operator.

◆ operator=() [2/2]

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

Move assignment operator.

◆ resize()

template<typename T , size_t C>
void blo::ImageHistogram< T, C >::resize ( int  roiWidth,
int  roiHeight 
)

Resizes work buffers.

Parameters
roiWidthWidth of the image ROI in pixels to resize work buffers to.
roiHeightHeight of the image ROI in pixels to resize work buffers to.

◆ setLevels()

template<typename T , size_t C>
void blo::ImageHistogram< T, C >::setLevels ( const float *const  pSrcLevels[],
const int  srcNumLevels[] 
)

Sets the histogram levels.

This function sets the histogram levels used when calculating the histogram.

Note
The number of histogram levels is one plus the number of histogram bins for each channel. For a given channel, the n-th histogram bin will be the number of source image pixel values that are greater than or equal to the n-th level, and less than the (n+1)-th level.
Parameters
pSrcLevelsArray of pointers to the histogram levels for each channel.
srcNumLevelsArray of the number of levels for each channel.

Friends And Related Function Documentation

◆ ImageHistogram< float, 1 >

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

◆ ImageHistogram< float, 3 >

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

◆ ImageHistogram< float, 4 >

template<typename T , size_t C>
BLO_EXPIMP_TEMPLATE template class BLO_API ImageHistogram< float, 4 >
related

◆ ImageHistogram< int16_t, 1 >

template<typename T , size_t C>
BLO_EXPIMP_TEMPLATE template class BLO_API ImageHistogram< int16_t, 1 >
related

◆ ImageHistogram< int16_t, 3 >

template<typename T , size_t C>
BLO_EXPIMP_TEMPLATE template class BLO_API ImageHistogram< int16_t, 3 >
related

◆ ImageHistogram< int16_t, 4 >

template<typename T , size_t C>
BLO_EXPIMP_TEMPLATE template class BLO_API ImageHistogram< int16_t, 4 >
related

◆ ImageHistogram< uint16_t, 1 >

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

◆ ImageHistogram< uint16_t, 3 >

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

◆ ImageHistogram< uint16_t, 4 >

template<typename T , size_t C>
BLO_EXPIMP_TEMPLATE template class BLO_API ImageHistogram< uint16_t, 4 >
related

◆ ImageHistogram< uint8_t, 1 >

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

◆ ImageHistogram< uint8_t, 3 >

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

◆ ImageHistogram< uint8_t, 4 >

template<typename T , size_t C>
BLO_EXPIMP_TEMPLATE template class BLO_API ImageHistogram< uint8_t, 4 >
related

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