This class implements functions allowing to determine minimum and maximum values within frames.
More...
|
class | ExtremumDeterminer |
| This class allows to determine the extremum (the global minimum or maximum) within a given frame. More...
|
|
|
template<typename T > |
static void | determineMinValue (const T *frame, const unsigned int width, const unsigned int height, const unsigned int framePaddingElements, T *minValue=nullptr, PixelPosition *minLocation=nullptr) |
| Determines the minimum value (the global minimum) within a given frame with one channel. More...
|
|
template<typename T > |
static void | determineMaxValue (const T *frame, const unsigned int width, const unsigned int height, const unsigned int framePaddingElements, T *maxValue=nullptr, PixelPosition *maxLocation=nullptr) |
| Determines the maximum value (the peak value) within a given frame with one channel. More...
|
|
template<typename T , unsigned int tChannels, bool tIgnoreInfinity = false> |
static void | determineMinMaxValues (const T *frame, const unsigned int width, const unsigned int height, const unsigned int framePaddingElements, T *minimalValues, T *maximalValues, Worker *worker=nullptr) |
| Determines the minimal and maximal pixel values in a given frame. More...
|
|
template<typename T > |
static bool | countElementsOutsideRange (const T *frame, const uint32_t width, const uint32_t height, const uint32_t framePaddingElements, const T rangeStart, const T rangeEnd, uint32_t *elementsBelowRange=nullptr, uint32_t *elementsAboveRange=nullptr) |
| Counts frame elements in a 1-channel frame that are outside a specified range of values. More...
|
|
template<> |
bool | countElementsOutsideRange (const uint8_t *frame, const uint32_t width, const uint32_t height, const uint32_t framePaddingElements, const uint8_t rangeStart, const uint8_t rangeEnd, uint32_t *elementsBelowRange, uint32_t *elementsAboveRange) |
| Forward declaration of template socialization. More...
|
|
|
template<typename T , unsigned int tChannels, bool tIgnoreInfinity = false> |
static void | determineMinMaxValuesSubset (const T *frame, const unsigned int width, const unsigned int height, T *minimalValues, T *maximalValues, Lock *lock, const unsigned int framePaddingElements, const unsigned int firstRow, const unsigned int numberRows) |
| Determines the minimal and maximal pixel values in a subset of a given frame. More...
|
|
This class implements functions allowing to determine minimum and maximum values within frames.
◆ countElementsOutsideRange() [1/2]
template<typename T >
bool Ocean::CV::FrameMinMax::countElementsOutsideRange |
( |
const T * |
frame, |
|
|
const uint32_t |
width, |
|
|
const uint32_t |
height, |
|
|
const uint32_t |
framePaddingElements, |
|
|
const T |
rangeStart, |
|
|
const T |
rangeEnd, |
|
|
uint32_t * |
elementsBelowRange = nullptr , |
|
|
uint32_t * |
elementsAboveRange = nullptr |
|
) |
| |
|
static |
Counts frame elements in a 1-channel frame that are outside a specified range of values.
- Parameters
-
frame | The pointer to the first pixel of the frame, 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) |
framePaddingElements | The number of padding elements at the end of each frame row, in elements, with range [0, infinity) |
rangeStart | Start value of the range, range: [lowest<T>(), rangeEnd] |
rangeEnd | Exclusive end value of the range, range: [rangeStart, max<T>()] |
elementsBelowRange | Optional resulting number of elements with values < rangeStart |
elementsAboveRange | Optional resulting number of elements with values >= rangeEnd |
- Returns
- True on success, otherwise false
◆ countElementsOutsideRange() [2/2]
template<>
bool Ocean::CV::FrameMinMax::countElementsOutsideRange |
( |
const uint8_t * |
frame, |
|
|
const uint32_t |
width, |
|
|
const uint32_t |
height, |
|
|
const uint32_t |
framePaddingElements, |
|
|
const uint8_t |
rangeStart, |
|
|
const uint8_t |
rangeEnd, |
|
|
uint32_t * |
elementsBelowRange, |
|
|
uint32_t * |
elementsAboveRange |
|
) |
| |
|
static |
Forward declaration of template socialization.
◆ determineMaxValue()
template<typename T >
void Ocean::CV::FrameMinMax::determineMaxValue |
( |
const T * |
frame, |
|
|
const unsigned int |
width, |
|
|
const unsigned int |
height, |
|
|
const unsigned int |
framePaddingElements, |
|
|
T * |
maxValue = nullptr , |
|
|
PixelPosition * |
maxLocation = nullptr |
|
) |
| |
|
static |
Determines the maximum value (the peak value) within a given frame with one channel.
In case several locations with same peak value exist, one of them will be returned.
This function supports a padding at the end of each row, in case a padding is specified the actual memory must have size: (width + paddingElements) * sizeof(T) * height.
Information: This function is the equivalent to OpenCV's cv::minMaxLoc() - but significantly faster.
- Parameters
-
frame | The pointer to the first pixel of the frame, 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) |
framePaddingElements | The number of padding elements at the end of each frame row, in elements, with range [0, infinity) |
maxValue | Optional resulting maximal value found within the frame, 'nullptr' otherwise |
maxLocation | Optional resulting position where the maximal value is located, with range [0, width - 1]x[0, height - 1], 'nullptr' otherwise |
- Template Parameters
-
T | The data type of each pixel e.g., 'unsigned char', 'int', 'float' |
◆ determineMinMaxValues()
template<typename T , unsigned int tChannels, bool tIgnoreInfinity>
void Ocean::CV::FrameMinMax::determineMinMaxValues |
( |
const T * |
frame, |
|
|
const unsigned int |
width, |
|
|
const unsigned int |
height, |
|
|
const unsigned int |
framePaddingElements, |
|
|
T * |
minimalValues, |
|
|
T * |
maximalValues, |
|
|
Worker * |
worker = nullptr |
|
) |
| |
|
inlinestatic |
Determines the minimal and maximal pixel values in a given frame.
In case the frame has multiple channels, minimal and maximal values are determined for each channel individually.
- Parameters
-
frame | The frame for which the minimal and maximal pixel values are determined, must be valid |
width | The width of the frame in pixel, with range [1, infinity) |
height | The height of the frame in pixel, with range [1, infinity) |
framePaddingElements | The number of padding elements at the end of each frame row, in elements, with range [0, infinity) |
minimalValues | Resulting minimal values, one for each channel, must be valid |
maximalValues | Resulting maximal values, one for each channel, must be valid |
worker | Optional worker object to distribute the computation |
- Template Parameters
-
T | Data type of each pixel color value (per channel) |
tChannels | Number of channels of the frame, with range [1, infinity) |
tIgnoreInfinity | True, to ignore +/- infinity and NaN float values; False, to consider +/- infinity float as minimum and maximum values as well, beahvior with NaN values is undefined |
◆ determineMinMaxValuesSubset()
template<typename T , unsigned int tChannels, bool tIgnoreInfinity>
void Ocean::CV::FrameMinMax::determineMinMaxValuesSubset |
( |
const T * |
frame, |
|
|
const unsigned int |
width, |
|
|
const unsigned int |
height, |
|
|
T * |
minimalValues, |
|
|
T * |
maximalValues, |
|
|
Lock * |
lock, |
|
|
const unsigned int |
framePaddingElements, |
|
|
const unsigned int |
firstRow, |
|
|
const unsigned int |
numberRows |
|
) |
| |
|
staticprotected |
Determines the minimal and maximal pixel values in a subset of a given frame.
- Parameters
-
frame | The frame for which the minimal and maximal pixel values are determined, must be valid |
width | The width of the frame in pixel, with range [1, infinity) |
height | The height of the frame in pixel, with range [1, infinity) |
minimalValues | Resulting minimal values |
maximalValues | Resulting maximal values |
lock | Optional lock if this function is executed distributed within several threads |
framePaddingElements | The number of padding elements at the end of each frame row, in elements, with range [0, infinity) |
firstRow | First row to be handled, with range [0, height - 1] |
numberRows | Number of rows to be handled, with range [1, height - firstRow] |
- Template Parameters
-
T | Data type of each pixel color value (per channel) |
tChannels | Number of channels of the frame, with range [1, infinity) |
tIgnoreInfinity | True, to ignore +/- inf values; False, to consider +/- inf as minimum and maximum values as well |
◆ determineMinValue()
template<typename T >
void Ocean::CV::FrameMinMax::determineMinValue |
( |
const T * |
frame, |
|
|
const unsigned int |
width, |
|
|
const unsigned int |
height, |
|
|
const unsigned int |
framePaddingElements, |
|
|
T * |
minValue = nullptr , |
|
|
PixelPosition * |
minLocation = nullptr |
|
) |
| |
|
static |
Determines the minimum value (the global minimum) within a given frame with one channel.
In case several locations with same value exist, one of them will be returned.
This function supports a padding at the end of each row, in case a padding is specified the actual memory must have size: (width + paddingElements) * sizeof(T) * height.
Information: This function is the equivalent to OpenCV's cv::minMaxLoc() - but significantly faster.
- Parameters
-
frame | The pointer to the first pixel of the frame, 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) |
framePaddingElements | The number of padding elements at the end of each frame row, in elements, with range [0, infinity) |
minValue | Optional resulting minimal value found within the frame, 'nullptr' otherwise |
minLocation | Optional resulting position where the minimal value is located, with range [0, width - 1]x[0, height - 1], 'nullptr' otherwise |
- Template Parameters
-
T | The data type of each pixel e.g., 'unsigned char', 'int', 'float' |
The documentation for this class was generated from the following file: