Ocean
Ocean::CV::FrameMean Class Reference

This class implements functions allowing to determine e.g., the mean pixel value of a frame of a mean frame based on several frames. More...

Static Public Member Functions

template<typename T , typename TMean , unsigned int tChannels>
static void meanValue (const T *frame, const unsigned int width, const unsigned int height, TMean *meanValues, const unsigned int framePaddingElements, Worker *worker=nullptr)
 Determines the mean pixel value for a given frame. More...
 
static Frame meanFrame (FrameProviderInterface &frameProviderInterface, const FrameType::PixelFormat &targetPixelFormat, const unsigned int firstFrameIndex, const unsigned int lastFrameIndex, Worker *worker=nullptr, bool *abort=nullptr)
 Determines the mean frame for a given set of frames. More...
 
template<unsigned int tChannels>
static Frame meanFrame8BitPerChannel (FrameProviderInterface &frameProviderInterface, const FrameType::PixelFormat &targetPixelFormat, const unsigned int firstFrameIndex, const unsigned int lastFrameIndex, Worker *worker=nullptr, bool *abort=nullptr)
 Determines the mean frame for a given set of frames. More...
 
template<typename TSource , typename TTarget , unsigned int tChannels>
static void addToFrame (const TSource *const source, TTarget *const target, const unsigned int width, const unsigned int height, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Adds the individual pixel values of a given source frame to a target frame. More...
 
static bool addToFrameIndividually (const Frame &source, const Frame &mask, Frame &target, Frame &denominators, const uint8_t nonMaskValue, Worker *worker=nullptr)
 Adds the individual pixel values of a given source frame to a target frame if the corresponding mask pixel is valid. More...
 
template<unsigned int tChannels>
static void addToFrameIndividually8BitPerChannel (const uint8_t *source, const uint8_t *mask, unsigned int *target, unsigned int *denominators, const unsigned int width, const unsigned int height, const unsigned int sourcePaddingElements, const unsigned int maskPaddingElements, const unsigned int targetPaddingElements, const unsigned int denominatorsPaddingElements, const uint8_t nonMaskValue, Worker *worker=nullptr)
 Adds the individual pixel values of a given source frame to a target frame if the corresponding mask pixel is valid. More...
 
template<unsigned int tChannels>
static void addToFrameIndividually8BitPerChannel (const uint8_t *source, unsigned int *targetWithDenominator, const unsigned int width, const unsigned int height, Worker *worker=nullptr)
 Adds the individual pixel values of a given source frame to a target frame. More...
 
template<unsigned int tChannels>
static void addToFrameIndividually8BitPerChannel (const uint8_t *source, const uint8_t *mask, unsigned int *targetWithDenominator, const unsigned int width, const unsigned int height, Worker *worker=nullptr)
 Adds the individual pixel values of a given source frame to a target frame if the corresponding mask pixel is valid. More...
 
template<typename TSource , typename TTarget , unsigned int tChannels>
static void normalizeFrame (const TSource *const source, TTarget *const target, const TSource denominator, unsigned int width, const unsigned int height, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
 Normalizes the pixels values of a given (accumulated frame) by a given denominator. More...
 
template<unsigned int tChannels>
static void normalizeFrameIndividually8BitPerChannel (const unsigned int *source, const unsigned int *denominators, uint8_t *target, const unsigned int width, const unsigned int height, const uint8_t *zeroValue=nullptr, Worker *worker=nullptr)
 Normalizes the pixels values of a given (accumulated frame) by individual denominator values. More...
 
template<unsigned int tChannels>
static void normalizeFrameIndividually8BitPerChannel (const unsigned int *sourceWithDenominator, uint8_t *target, const unsigned int width, const unsigned int height, const uint8_t *zeroValue, Worker *worker=nullptr)
 Normalizes the pixels values of a given (accumulated frame) by individual denominator values. More...
 

Static Protected Member Functions

template<typename T , typename TSum , unsigned int tChannels>
static void sumFrameSubset (const T *frame, const unsigned int width, TSum *sumValues, Lock *lock, const unsigned int framePaddingElements, const unsigned int firstRow, const unsigned int numberRows)
 Sums the pixel values in a subset of a given frame. More...
 
template<typename TSource , typename TTarget , unsigned int tChannels>
static void addToFrameSubset (const TSource *const source, TTarget *const target, const unsigned int width, const unsigned int height, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const unsigned int firstRow, const unsigned int numberRows)
 Adds the subset of individual pixel values of a given source frame to a target frame. More...
 
template<unsigned int tChannels>
static void addToFrameIndividuallyBlock8BitPerChannelSubset (const uint8_t *source, const uint8_t *mask, unsigned int *target, unsigned int *denominators, const unsigned int width, const unsigned int height, const unsigned int sourcePaddingElements, const unsigned int maskPaddingElements, const unsigned int targetPaddingElements, const unsigned int denominatorsPaddingElements, const uint8_t nonMaskValue, const unsigned int firstRow, const unsigned int numberRows)
 Adds the subset of individual pixel values of a given source frame to a target frame (with denominators as separate block) if the corresponding mask pixel is valid. More...
 
template<unsigned int tChannels>
static void addToFrameIndividuallyZipped8BitPerChannelSubset (const uint8_t *source, unsigned int *targetWithDenominator, const unsigned int width, const unsigned int height, const unsigned int firstRow, const unsigned int numberRows)
 Adds the subset of individual pixel values of a given source frame to a target frame (with zipped denominator). More...
 
template<unsigned int tChannels>
static void addToFrameIndividuallyZipped8BitPerChannelSubset (const uint8_t *source, const uint8_t *mask, unsigned int *targetWithDenominator, const unsigned int width, const unsigned int height, const unsigned int firstRow, const unsigned int numberRows)
 Adds the subset of individual pixel values of a given source frame to a target frame (with zipped denominator) if the corresponding mask pixel is valid. More...
 
template<typename TSource , typename TTarget , unsigned int tChannels>
static void normalizeFrameSubset (const TSource *const source, TTarget *const target, const TSource denominator, unsigned int width, const unsigned int height, const unsigned int sourcePaddingElements, const unsigned int targetPaddingElements, const unsigned int firstRow, const unsigned int numberRows)
 Normalizes a subset of the pixels values of a given (accumulated frame) by a given denominator. More...
 
template<unsigned int tChannels>
static void normalizeFrameIndividually8BitPerChannelSubset (const unsigned int *source, const unsigned int *denominators, uint8_t *target, const unsigned int width, const unsigned int height, const uint8_t *zeroValue, const unsigned int firstRow, const unsigned int numberRows)
 Normalizes a subset of the pixels values of a given (accumulated frame) by individual denominator values. More...
 
template<unsigned int tChannels>
static void normalizeFrameIndividually8BitPerChannelSubset (const unsigned int *sourceWithDenominator, uint8_t *target, const unsigned int width, const unsigned int height, const uint8_t *zeroValue, const unsigned int firstRow, const unsigned int numberRows)
 Normalizes a subset of the pixels values of a given (accumulated frame) by individual denominator values. More...
 

Detailed Description

This class implements functions allowing to determine e.g., the mean pixel value of a frame of a mean frame based on several frames.

Member Function Documentation

◆ addToFrame()

template<typename TSource , typename TTarget , unsigned int tChannels>
void Ocean::CV::FrameMean::addToFrame ( const TSource *const  source,
TTarget *const  target,
const unsigned int  width,
const unsigned int  height,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
inlinestatic

Adds the individual pixel values of a given source frame to a target frame.

Parameters
sourceThe source frame which pixels values are copied
targetThe target frame to which the source pixel values will be added, individually for each pixel and channel
widthThe width of both frames in pixels, with range [1, infinity)
heightThe height of both frames in pixels, with range [1, infinity)
sourcePaddingElementsThe number of padding elements at the end of each source row, in elements, with range [0, infinity)
targetPaddingElementsThe number of padding elements at the end of each target row, in elements, with range [0, infinity)
workerAn optional worker object to distribute the computation
Template Parameters
TSourceThe data type of the elements of the source frame
TTargetThe data type of the elements of the target frame
tChannelsThe number of frame data channels, with range [1, infinity)

◆ addToFrameIndividually()

static bool Ocean::CV::FrameMean::addToFrameIndividually ( const Frame source,
const Frame mask,
Frame target,
Frame denominators,
const uint8_t  nonMaskValue,
Worker worker = nullptr 
)
static

Adds the individual pixel values of a given source frame to a target frame if the corresponding mask pixel is valid.

Parameters
sourceThe source frame which pixels values are copied, must be valid and not have more than 4 channels and an 8 bit, unsigned data type
maskThe mask frame defining whether a source pixel is copied or not (and whether the corresponding normalization denominator of the target frame is increased by 1), must be valid and the data type must 8 bit, unsigned
targetThe target frame to which the source pixel values will be added, must be valid and the frame type like source except that the data type must be 32 bit, unsigned
denominatorsThe denominator values individually for each pixel, must be valid and the data type must be 32 bit, unsigned
workerAn optional worker object to distribute the computation
nonMaskValueThe value indicating invalid mask pixels, i.e. pixels that should not be processed by this function, all other values will be interpreted as valid, range: [0, 255]
Returns
True, if succeeded

◆ addToFrameIndividually8BitPerChannel() [1/3]

template<unsigned int tChannels>
void Ocean::CV::FrameMean::addToFrameIndividually8BitPerChannel ( const uint8_t *  source,
const uint8_t *  mask,
unsigned int *  target,
unsigned int *  denominators,
const unsigned int  width,
const unsigned int  height,
const unsigned int  sourcePaddingElements,
const unsigned int  maskPaddingElements,
const unsigned int  targetPaddingElements,
const unsigned int  denominatorsPaddingElements,
const uint8_t  nonMaskValue,
Worker worker = nullptr 
)
inlinestatic

Adds the individual pixel values of a given source frame to a target frame if the corresponding mask pixel is valid.

Parameters
sourceThe source frame which pixels values are copied
maskThe mask frame defining whether a source pixel is copied or not (and whether the corresponding normalization denominator of the target frame is increased by 1)
targetThe target frame to which the source pixel values will be added
denominatorsThe denominator values individually for each pixel
widthThe width of both frames in pixels, with range [1, infinity)
heightThe height of both frames in pixels, with range [1, infinity)
sourcePaddingElementsThe number of padding elements of the source frame, range: [0, infinity)
maskPaddingElementsThe number of padding elements of the mask frame, range: [0, infinity)
targetPaddingElementsThe number of padding elements of the target frame, range: [0, infinity)
denominatorsPaddingElementsThe number of padding elements of the denominators frame, range: [0, infinity)
nonMaskValueThe value indicating invalid mask pixels, i.e. pixels that should not be processed by this function, all other values will be interpreted as valid, range: [0, 255]
workerAn optional worker object to distribute the computation
Template Parameters
tChannelsThe number of frame data channels, not including the extra channel for the denominator value

◆ addToFrameIndividually8BitPerChannel() [2/3]

template<unsigned int tChannels>
void Ocean::CV::FrameMean::addToFrameIndividually8BitPerChannel ( const uint8_t *  source,
const uint8_t *  mask,
unsigned int *  targetWithDenominator,
const unsigned int  width,
const unsigned int  height,
Worker worker = nullptr 
)
inlinestatic

Adds the individual pixel values of a given source frame to a target frame if the corresponding mask pixel is valid.

Parameters
sourceThe source frame which pixels values are copied
maskThe mask frame defining whether a source pixel is copied or not (and whether the corresponding normalization denominator of the target frame is increased by 1)
targetWithDenominatorThe target frame to which the source pixel values will be added, with individual denominator values
widthThe width of both frames in pixels, with range [1, infinity)
heightThe height of both frames in pixels, with range [1, infinity)
workerAn optional worker object to distribute the computation
Template Parameters
tChannelsThe number of frame data channels, not including the extra channel for the denominator value

◆ addToFrameIndividually8BitPerChannel() [3/3]

template<unsigned int tChannels>
void Ocean::CV::FrameMean::addToFrameIndividually8BitPerChannel ( const uint8_t *  source,
unsigned int *  targetWithDenominator,
const unsigned int  width,
const unsigned int  height,
Worker worker = nullptr 
)
inlinestatic

Adds the individual pixel values of a given source frame to a target frame.

Parameters
sourceThe source frame which pixels values are copied
targetWithDenominatorThe target frame to which the source pixel values will be added, with individual denominator values, the denominator of each pixel is increased by 1
widthThe width of both frames in pixels, with range [1, infinity)
heightThe height of both frames in pixels, with range [1, infinity)
workerAn optional worker object to distribute the computation
Template Parameters
tChannelsThe number of frame data channels, not including the extra channel for the denominator value

◆ addToFrameIndividuallyBlock8BitPerChannelSubset()

template<unsigned int tChannels>
void Ocean::CV::FrameMean::addToFrameIndividuallyBlock8BitPerChannelSubset ( const uint8_t *  source,
const uint8_t *  mask,
unsigned int *  target,
unsigned int *  denominators,
const unsigned int  width,
const unsigned int  height,
const unsigned int  sourcePaddingElements,
const unsigned int  maskPaddingElements,
const unsigned int  targetPaddingElements,
const unsigned int  denominatorsPaddingElements,
const uint8_t  nonMaskValue,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprotected

Adds the subset of individual pixel values of a given source frame to a target frame (with denominators as separate block) if the corresponding mask pixel is valid.

Parameters
sourceThe source frame from which pixels values are copied
maskThe mask frame defining whether a source pixel is copied or not (and whether the corresponding normalization denominator of the target frame is increased by 1)
targetThe target frame to which the source pixel values will be added
denominatorsThe denominator values individually for each pixel
widthThe width of both frames in pixels
heightThe height of both frames in pixels
sourcePaddingElementsThe number of padding elements of the source frame, range: [0, infinity)
maskPaddingElementsThe number of padding elements of the mask frame, range: [0, infinity)
targetPaddingElementsThe number of padding elements of the target frame, range: [0, infinity)
denominatorsPaddingElementsThe number of padding elements of the denominators frame, range: [0, infinity)
nonMaskValueThe value indicating invalid mask pixels, i.e. pixels that should not be processed by this function, all other values will be interpreted as valid, range: [0, 255]
firstRowThe first row to be handled
numberRowsThe number of rows to be handled
Template Parameters
tChannelsThe number of frame data channels

◆ addToFrameIndividuallyZipped8BitPerChannelSubset() [1/2]

template<unsigned int tChannels>
void Ocean::CV::FrameMean::addToFrameIndividuallyZipped8BitPerChannelSubset ( const uint8_t *  source,
const uint8_t *  mask,
unsigned int *  targetWithDenominator,
const unsigned int  width,
const unsigned int  height,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprotected

Adds the subset of individual pixel values of a given source frame to a target frame (with zipped denominator) if the corresponding mask pixel is valid.

Parameters
sourceThe source frame from which pixels values are copied
maskThe mask frame defining whether a source pixel is copied or not (and whether the corresponding normalization denominator of the target frame is increased by 1)
targetWithDenominatorThe target frame to which the source pixel values will be added, with individual denominator values
widthThe width of both frames in pixels
heightThe height of both frames in pixels
firstRowThe first row to be handled
numberRowsThe number of rows to be handled
Template Parameters
tChannelsThe number of frame data channels, not including the extra channel for the denominator value

◆ addToFrameIndividuallyZipped8BitPerChannelSubset() [2/2]

template<unsigned int tChannels>
void Ocean::CV::FrameMean::addToFrameIndividuallyZipped8BitPerChannelSubset ( const uint8_t *  source,
unsigned int *  targetWithDenominator,
const unsigned int  width,
const unsigned int  height,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprotected

Adds the subset of individual pixel values of a given source frame to a target frame (with zipped denominator).

Parameters
sourceThe source frame from which pixels values are copied
targetWithDenominatorThe target frame to which the source pixel values will be added, with individual denominator values, the denominator of each pixel is increased by 1
widthThe width of both frames in pixels
heightThe height of both frames in pixels
firstRowThe first row to be handled
numberRowsThe number of rows to be handled
Template Parameters
tChannelsThe number of frame data channels, not including the extra channel for the denominator value

◆ addToFrameSubset()

template<typename TSource , typename TTarget , unsigned int tChannels>
void Ocean::CV::FrameMean::addToFrameSubset ( const TSource *const  source,
TTarget *const  target,
const unsigned int  width,
const unsigned int  height,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprotected

Adds the subset of individual pixel values of a given source frame to a target frame.

Parameters
sourceThe source frame which pixels values are copied, must be valid
targetThe target frame to which the source pixel values will be added, individually for each pixel and channel, must be valid
widthThe width of both frames in pixels, with range [1, infinity)
heightThe height of both frames in pixels, with range [1, infinity)
sourcePaddingElementsThe number of padding elements at the end of each source row, in elements, with range [0, infinity)
targetPaddingElementsThe number of padding elements at the end of each target row, in elements, with range [0, infinity)
firstRowThe first row to be handled, with range [0, height - 1]
numberRowsThe number of rows to be handled, with range [1, height - firstRow]
Template Parameters
TSourceThe data type of the elements of the source frame
TTargetThe data type of the elements of the target frame
tChannelsThe number of frame data channels, with range [1, infinity)

◆ meanFrame()

static Frame Ocean::CV::FrameMean::meanFrame ( FrameProviderInterface frameProviderInterface,
const FrameType::PixelFormat targetPixelFormat,
const unsigned int  firstFrameIndex,
const unsigned int  lastFrameIndex,
Worker worker = nullptr,
bool *  abort = nullptr 
)
static

Determines the mean frame for a given set of frames.

The resulting mean frame is determined by adding the pixel color values of all frames individually with a subsequent normalization (by the number of frames).
Beware: This function cannot handle more than 16843010 frames.

Parameters
frameProviderInterfaceThe frame provider interface providing the set of frames, must be initialized
targetPixelFormatThe pixel format of the resulting mean frame, every frame from the frame provider will be converted into this pixel format before any application
firstFrameIndexThe index of the first frame from the frame provider interface which is used to determine the mean frame
lastFrameIndexThe index of the last (including) frame from the frame provider interface, with range [first, number frames from the interface)
workerAn optional worker object to distribute the computation
abortAn optional abort statement allowing to abort the determination at any time; set the value True to abort the request
Returns
The resulting mean frame
See also
meanFrame8BitPerChannel().

◆ meanFrame8BitPerChannel()

template<unsigned int tChannels>
Frame Ocean::CV::FrameMean::meanFrame8BitPerChannel ( FrameProviderInterface frameProviderInterface,
const FrameType::PixelFormat targetPixelFormat,
const unsigned int  firstFrameIndex,
const unsigned int  lastFrameIndex,
Worker worker = nullptr,
bool *  abort = nullptr 
)
static

Determines the mean frame for a given set of frames.

The resulting mean frame is determined by adding the pixel color values of all frames individually with a subsequent normalization (by the number of frames).

Parameters
frameProviderInterfaceThe frame provider interface providing the set of frames, must be initialized
targetPixelFormatThe pixel format of the resulting mean frame, every frame from the frame provider will be converted into this pixel format before any application
firstFrameIndexThe index of the first frame from the frame provider interface which is used to determine the mean frame
lastFrameIndexThe index of the last (including) frame from the frame provider interface, with range [first, number frames from the interface)
workerAn optional worker object to distribute the computation
abortAn optional abort statement allowing to abort the determination at any time; set the value True to abort the request
Returns
The resulting mean frame
Template Parameters
tChannelsThe number of frame data channels which must correspond to the given targetPixelFormat
See also
meanFrame().

◆ meanValue()

template<typename T , typename TMean , unsigned int tChannels>
void Ocean::CV::FrameMean::meanValue ( const T *  frame,
const unsigned int  width,
const unsigned int  height,
TMean *  meanValues,
const unsigned int  framePaddingElements,
Worker worker = nullptr 
)
static

Determines the mean pixel value for a given frame.

Parameters
frameThe data of the frame for which the mean value will be determined, must be valid
widthThe width of the given frame in pixel, with range [1, infinity)
heightThe height of the given frame in pixel, with range [1, infinity)
meanValuesThe resulting mean values, one for each channel
framePaddingElementsThe number of padding elements at the end of each frame row, in elements, with range [0, infinity)
workerAn optional worker object to distribute the computation
Template Parameters
TThe data type of each pixel channel
TMeanThe data type of each mean value
tChannelsThe number of frame channels, with range [1, infinity)

◆ normalizeFrame()

template<typename TSource , typename TTarget , unsigned int tChannels>
void Ocean::CV::FrameMean::normalizeFrame ( const TSource *const  source,
TTarget *const  target,
const TSource  denominator,
unsigned int  width,
const unsigned int  height,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
Worker worker = nullptr 
)
inlinestatic

Normalizes the pixels values of a given (accumulated frame) by a given denominator.

Parameters
sourceThe accumulated source frame which has to be normalized, must be valid
targetThe target frame which receives the normalized source frame, must be valid
denominatorThe denominator which is used to normalize each frame pixel and channel of the source frame, with range [1, infinity)
widthThe width of both frames in pixels, with range [1, infinity)
heightThe height of both frames in pixels, with range [1, infinity)
sourcePaddingElementsThe number of padding elements at the end of each source row, in elements, with range [0, infinity)
targetPaddingElementsThe number of padding elements at the end of each target row, in elements, with range [0, infinity)
workerAn optional worker object to distribute the computation
Template Parameters
TSourceThe data type of the elements of the source frame
TTargetThe data type of the elements of the target frame
tChannelsThe number of frame data channels, with range [1, infinity)

◆ normalizeFrameIndividually8BitPerChannel() [1/2]

template<unsigned int tChannels>
void Ocean::CV::FrameMean::normalizeFrameIndividually8BitPerChannel ( const unsigned int *  source,
const unsigned int *  denominators,
uint8_t *  target,
const unsigned int  width,
const unsigned int  height,
const uint8_t *  zeroValue = nullptr,
Worker worker = nullptr 
)
inlinestatic

Normalizes the pixels values of a given (accumulated frame) by individual denominator values.

The denominator values are provided as a second frame with corresponding pixel layout as the source frame.

Parameters
sourceThe accumulated source frame which has to be normalized
denominatorsThe normalization denominator frame individually for each pixel, with range [0, infinity)
targetThe target frame which receives the normalized source frame
widthThe width of both frames in pixels, with range [1, infinity)
heightThe height of both frames in pixels, with range [1, infinity)
zeroValueThe target pixel value for pixels with denominator value equal to zero
workerAn optional worker object to distribute the computation
Template Parameters
tChannelsThe number of frame data channels

◆ normalizeFrameIndividually8BitPerChannel() [2/2]

template<unsigned int tChannels>
void Ocean::CV::FrameMean::normalizeFrameIndividually8BitPerChannel ( const unsigned int *  sourceWithDenominator,
uint8_t *  target,
const unsigned int  width,
const unsigned int  height,
const uint8_t *  zeroValue,
Worker worker = nullptr 
)
inlinestatic

Normalizes the pixels values of a given (accumulated frame) by individual denominator values.

Parameters
sourceWithDenominatorThe accumulated source frame together with the individual denominator values
targetThe target frame which receives the normalized source frame
widthThe width of both frames in pixels, with range [1, infinity)
heightThe height of both frames in pixels, with range [1, infinity)
zeroValueThe target pixel value for pixels with denominator value equal to zero
workerAn optional worker object to distribute the computation
Template Parameters
tChannelsThe number of frame data channels, not including the extra channel for the denominator value

◆ normalizeFrameIndividually8BitPerChannelSubset() [1/2]

template<unsigned int tChannels>
void Ocean::CV::FrameMean::normalizeFrameIndividually8BitPerChannelSubset ( const unsigned int *  source,
const unsigned int *  denominators,
uint8_t *  target,
const unsigned int  width,
const unsigned int  height,
const uint8_t *  zeroValue,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprotected

Normalizes a subset of the pixels values of a given (accumulated frame) by individual denominator values.

Parameters
sourceThe accumulated source frame which has to be normalized
denominatorsThe normalization denominators individually for each pixel, with range [0, infinity)
targetThe target frame which receives the normalized source frame
widthThe width of both frames in pixels
heightThe height of both frames in pixels
zeroValueThe target pixel value for pixels with denominator value equal to zero
firstRowThe first row to be handled
numberRowsThe number of rows to be handled
Template Parameters
tChannelsThe number of frame data channels

◆ normalizeFrameIndividually8BitPerChannelSubset() [2/2]

template<unsigned int tChannels>
void Ocean::CV::FrameMean::normalizeFrameIndividually8BitPerChannelSubset ( const unsigned int *  sourceWithDenominator,
uint8_t *  target,
const unsigned int  width,
const unsigned int  height,
const uint8_t *  zeroValue,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprotected

Normalizes a subset of the pixels values of a given (accumulated frame) by individual denominator values.

Parameters
sourceWithDenominatorThe accumulated source frame together with the individual denominator values
targetThe target frame which receives the normalized source frame
widthThe width of both frames in pixels
heightThe height of both frames in pixels
zeroValueThe target pixel value for pixels with denominator value equal to zero
firstRowThe first row to be handled
numberRowsThe number of rows to be handled
Template Parameters
tChannelsThe number of frame data channels, not including the extra channel for the denominator value

◆ normalizeFrameSubset()

template<typename TSource , typename TTarget , unsigned int tChannels>
void Ocean::CV::FrameMean::normalizeFrameSubset ( const TSource *const  source,
TTarget *const  target,
const TSource  denominator,
unsigned int  width,
const unsigned int  height,
const unsigned int  sourcePaddingElements,
const unsigned int  targetPaddingElements,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprotected

Normalizes a subset of the pixels values of a given (accumulated frame) by a given denominator.

Parameters
sourceThe accumulated source frame which has to be normalized, must be valid
targetThe target frame which receives the normalized source frame, must be valid
denominatorThe denominator which is used to normalize each frame pixel and channel of the source frame, with range [1, infinity)
widthThe width of both frames in pixels, with range [1, infinity)
heightThe height of both frames in pixels, with range [1, infinity)
sourcePaddingElementsThe number of padding elements at the end of each source row, in elements, with range [0, infinity)
targetPaddingElementsThe number of padding elements at the end of each target row, in elements, with range [0, infinity)
firstRowThe first row to be handled, with range [0, height - 1]
numberRowsThe number of rows to be handled, with range [1, height - firstRow]
Template Parameters
TSourceThe data type of the elements of the source frame
TTargetThe data type of the elements of the target frame
tChannelsThe number of frame data channels, with range [1, infinity)

◆ sumFrameSubset()

template<typename T , typename TSum , unsigned int tChannels>
void Ocean::CV::FrameMean::sumFrameSubset ( const T *  frame,
const unsigned int  width,
TSum *  sumValues,
Lock lock,
const unsigned int  framePaddingElements,
const unsigned int  firstRow,
const unsigned int  numberRows 
)
staticprotected

Sums the pixel values in a subset of a given frame.

Parameters
frameThe data of the frame for which the summed pixel values will be determined, must be valid
widthThe width of the given frame in pixel, with range [1, infinity)
sumValuesThe resulting summed pixel values values, one for each channel
lockLock object which must be provided if this function is invoked in parallel; nullptr otherwise
framePaddingElementsThe number of padding elements at the end of each image row, in elements, with range [0, infinity)
firstRowThe first row to be handled, with range [0, 'frame height')
numberRowsThe number of rows to be handled, with range [1, 'frame height' - firstRow]
Template Parameters
TThe data type of each pixel channel
TSumData type of each sum value
tChannelsThe number of frame channels, with range [1, infinity)

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