Ocean
|
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... | |
This class implements functions allowing to determine e.g., the mean pixel value of a frame of a mean frame based on several frames.
|
inlinestatic |
Adds the individual pixel values of a given source frame to a target frame.
source | The source frame which pixels values are copied |
target | The target frame to which the source pixel values will be added, individually for each pixel and channel |
width | The width of both frames in pixels, with range [1, infinity) |
height | The height of both frames in pixels, with range [1, infinity) |
sourcePaddingElements | The number of padding elements at the end of each source row, in elements, with range [0, infinity) |
targetPaddingElements | The number of padding elements at the end of each target row, in elements, with range [0, infinity) |
worker | An optional worker object to distribute the computation |
TSource | The data type of the elements of the source frame |
TTarget | The data type of the elements of the target frame |
tChannels | The number of frame data channels, with range [1, infinity) |
|
static |
Adds the individual pixel values of a given source frame to a target frame if the corresponding mask pixel is valid.
source | The source frame which pixels values are copied, must be valid and not have more than 4 channels and an 8 bit, unsigned data type |
mask | The 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 |
target | The 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 |
denominators | The denominator values individually for each pixel, must be valid and the data type must be 32 bit, unsigned |
worker | An optional worker object to distribute the computation |
nonMaskValue | The 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] |
|
inlinestatic |
Adds the individual pixel values of a given source frame to a target frame if the corresponding mask pixel is valid.
source | The source frame which pixels values are copied |
mask | The 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) |
target | The target frame to which the source pixel values will be added |
denominators | The denominator values individually for each pixel |
width | The width of both frames in pixels, with range [1, infinity) |
height | The height of both frames in pixels, with range [1, infinity) |
sourcePaddingElements | The number of padding elements of the source frame, range: [0, infinity) |
maskPaddingElements | The number of padding elements of the mask frame, range: [0, infinity) |
targetPaddingElements | The number of padding elements of the target frame, range: [0, infinity) |
denominatorsPaddingElements | The number of padding elements of the denominators frame, range: [0, infinity) |
nonMaskValue | The 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] |
worker | An optional worker object to distribute the computation |
tChannels | The number of frame data channels, not including the extra channel for the denominator value |
|
inlinestatic |
Adds the individual pixel values of a given source frame to a target frame if the corresponding mask pixel is valid.
source | The source frame which pixels values are copied |
mask | The 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) |
targetWithDenominator | The target frame to which the source pixel values will be added, with individual denominator values |
width | The width of both frames in pixels, with range [1, infinity) |
height | The height of both frames in pixels, with range [1, infinity) |
worker | An optional worker object to distribute the computation |
tChannels | The number of frame data channels, not including the extra channel for the denominator value |
|
inlinestatic |
Adds the individual pixel values of a given source frame to a target frame.
source | The source frame which pixels values are copied |
targetWithDenominator | The target frame to which the source pixel values will be added, with individual denominator values, the denominator of each pixel is increased by 1 |
width | The width of both frames in pixels, with range [1, infinity) |
height | The height of both frames in pixels, with range [1, infinity) |
worker | An optional worker object to distribute the computation |
tChannels | The number of frame data channels, not including the extra channel for the denominator value |
|
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.
source | The source frame from which pixels values are copied |
mask | The 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) |
target | The target frame to which the source pixel values will be added |
denominators | The denominator values individually for each pixel |
width | The width of both frames in pixels |
height | The height of both frames in pixels |
sourcePaddingElements | The number of padding elements of the source frame, range: [0, infinity) |
maskPaddingElements | The number of padding elements of the mask frame, range: [0, infinity) |
targetPaddingElements | The number of padding elements of the target frame, range: [0, infinity) |
denominatorsPaddingElements | The number of padding elements of the denominators frame, range: [0, infinity) |
nonMaskValue | The 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] |
firstRow | The first row to be handled |
numberRows | The number of rows to be handled |
tChannels | The number of frame data channels |
|
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.
source | The source frame from which pixels values are copied |
mask | The 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) |
targetWithDenominator | The target frame to which the source pixel values will be added, with individual denominator values |
width | The width of both frames in pixels |
height | The height of both frames in pixels |
firstRow | The first row to be handled |
numberRows | The number of rows to be handled |
tChannels | The number of frame data channels, not including the extra channel for the denominator value |
|
staticprotected |
Adds the subset of individual pixel values of a given source frame to a target frame (with zipped denominator).
source | The source frame from which pixels values are copied |
targetWithDenominator | The target frame to which the source pixel values will be added, with individual denominator values, the denominator of each pixel is increased by 1 |
width | The width of both frames in pixels |
height | The height of both frames in pixels |
firstRow | The first row to be handled |
numberRows | The number of rows to be handled |
tChannels | The number of frame data channels, not including the extra channel for the denominator value |
|
staticprotected |
Adds the subset of individual pixel values of a given source frame to a target frame.
source | The source frame which pixels values are copied, must be valid |
target | The target frame to which the source pixel values will be added, individually for each pixel and channel, must be valid |
width | The width of both frames in pixels, with range [1, infinity) |
height | The height of both frames in pixels, with range [1, infinity) |
sourcePaddingElements | The number of padding elements at the end of each source row, in elements, with range [0, infinity) |
targetPaddingElements | The number of padding elements at the end of each target row, in elements, with range [0, infinity) |
firstRow | The first row to be handled, with range [0, height - 1] |
numberRows | The number of rows to be handled, with range [1, height - firstRow] |
TSource | The data type of the elements of the source frame |
TTarget | The data type of the elements of the target frame |
tChannels | The number of frame data channels, with range [1, infinity) |
|
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.
frameProviderInterface | The frame provider interface providing the set of frames, must be initialized |
targetPixelFormat | The pixel format of the resulting mean frame, every frame from the frame provider will be converted into this pixel format before any application |
firstFrameIndex | The index of the first frame from the frame provider interface which is used to determine the mean frame |
lastFrameIndex | The index of the last (including) frame from the frame provider interface, with range [first, number frames from the interface) |
worker | An optional worker object to distribute the computation |
abort | An optional abort statement allowing to abort the determination at any time; set the value True to abort the request |
|
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).
frameProviderInterface | The frame provider interface providing the set of frames, must be initialized |
targetPixelFormat | The pixel format of the resulting mean frame, every frame from the frame provider will be converted into this pixel format before any application |
firstFrameIndex | The index of the first frame from the frame provider interface which is used to determine the mean frame |
lastFrameIndex | The index of the last (including) frame from the frame provider interface, with range [first, number frames from the interface) |
worker | An optional worker object to distribute the computation |
abort | An optional abort statement allowing to abort the determination at any time; set the value True to abort the request |
tChannels | The number of frame data channels which must correspond to the given targetPixelFormat |
|
static |
Determines the mean pixel value for a given frame.
frame | The data of the frame for which the mean value will be determined, must be valid |
width | The width of the given frame in pixel, with range [1, infinity) |
height | The height of the given frame in pixel, with range [1, infinity) |
meanValues | The resulting mean values, one for each channel |
framePaddingElements | The number of padding elements at the end of each frame row, in elements, with range [0, infinity) |
worker | An optional worker object to distribute the computation |
T | The data type of each pixel channel |
TMean | The data type of each mean value |
tChannels | The number of frame channels, with range [1, infinity) |
|
inlinestatic |
Normalizes the pixels values of a given (accumulated frame) by a given denominator.
source | The accumulated source frame which has to be normalized, must be valid |
target | The target frame which receives the normalized source frame, must be valid |
denominator | The denominator which is used to normalize each frame pixel and channel of the source frame, with range [1, infinity) |
width | The width of both frames in pixels, with range [1, infinity) |
height | The height of both frames in pixels, with range [1, infinity) |
sourcePaddingElements | The number of padding elements at the end of each source row, in elements, with range [0, infinity) |
targetPaddingElements | The number of padding elements at the end of each target row, in elements, with range [0, infinity) |
worker | An optional worker object to distribute the computation |
TSource | The data type of the elements of the source frame |
TTarget | The data type of the elements of the target frame |
tChannels | The number of frame data channels, with range [1, infinity) |
|
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.
source | The accumulated source frame which has to be normalized |
denominators | The normalization denominator frame individually for each pixel, with range [0, infinity) |
target | The target frame which receives the normalized source frame |
width | The width of both frames in pixels, with range [1, infinity) |
height | The height of both frames in pixels, with range [1, infinity) |
zeroValue | The target pixel value for pixels with denominator value equal to zero |
worker | An optional worker object to distribute the computation |
tChannels | The number of frame data channels |
|
inlinestatic |
Normalizes the pixels values of a given (accumulated frame) by individual denominator values.
sourceWithDenominator | The accumulated source frame together with the individual denominator values |
target | The target frame which receives the normalized source frame |
width | The width of both frames in pixels, with range [1, infinity) |
height | The height of both frames in pixels, with range [1, infinity) |
zeroValue | The target pixel value for pixels with denominator value equal to zero |
worker | An optional worker object to distribute the computation |
tChannels | The number of frame data channels, not including the extra channel for the denominator value |
|
staticprotected |
Normalizes a subset of the pixels values of a given (accumulated frame) by individual denominator values.
source | The accumulated source frame which has to be normalized |
denominators | The normalization denominators individually for each pixel, with range [0, infinity) |
target | The target frame which receives the normalized source frame |
width | The width of both frames in pixels |
height | The height of both frames in pixels |
zeroValue | The target pixel value for pixels with denominator value equal to zero |
firstRow | The first row to be handled |
numberRows | The number of rows to be handled |
tChannels | The number of frame data channels |
|
staticprotected |
Normalizes a subset of the pixels values of a given (accumulated frame) by individual denominator values.
sourceWithDenominator | The accumulated source frame together with the individual denominator values |
target | The target frame which receives the normalized source frame |
width | The width of both frames in pixels |
height | The height of both frames in pixels |
zeroValue | The target pixel value for pixels with denominator value equal to zero |
firstRow | The first row to be handled |
numberRows | The number of rows to be handled |
tChannels | The number of frame data channels, not including the extra channel for the denominator value |
|
staticprotected |
Normalizes a subset of the pixels values of a given (accumulated frame) by a given denominator.
source | The accumulated source frame which has to be normalized, must be valid |
target | The target frame which receives the normalized source frame, must be valid |
denominator | The denominator which is used to normalize each frame pixel and channel of the source frame, with range [1, infinity) |
width | The width of both frames in pixels, with range [1, infinity) |
height | The height of both frames in pixels, with range [1, infinity) |
sourcePaddingElements | The number of padding elements at the end of each source row, in elements, with range [0, infinity) |
targetPaddingElements | The number of padding elements at the end of each target row, in elements, with range [0, infinity) |
firstRow | The first row to be handled, with range [0, height - 1] |
numberRows | The number of rows to be handled, with range [1, height - firstRow] |
TSource | The data type of the elements of the source frame |
TTarget | The data type of the elements of the target frame |
tChannels | The number of frame data channels, with range [1, infinity) |
|
staticprotected |
Sums the pixel values in a subset of a given frame.
frame | The data of the frame for which the summed pixel values will be determined, must be valid |
width | The width of the given frame in pixel, with range [1, infinity) |
sumValues | The resulting summed pixel values values, one for each channel |
lock | Lock object which must be provided if this function is invoked in parallel; nullptr otherwise |
framePaddingElements | The number of padding elements at the end of each image row, in elements, with range [0, infinity) |
firstRow | The first row to be handled, with range [0, 'frame height') |
numberRows | The number of rows to be handled, with range [1, 'frame height' - firstRow] |
T | The data type of each pixel channel |
TSum | Data type of each sum value |
tChannels | The number of frame channels, with range [1, infinity) |