Namespace for collection of thresholding functions from the Foundation package. More...
Enumerations | |
enum class | StaticThresholding { LessThan = CExports::TH_Less , LessThanOrEqual = CExports::TH_LessOrEqual , Equal = CExports::TH_Equal , GreaterOrEqual = CExports::TH_GreaterOrEqual , Greater = CExports::TH_Greater } |
Comparisons for static thresholding. More... | |
enum class | DynamicThresholdNorm { Mean = CExports::DTN_Mean , MinMax = CExports::DTN_MinMax } |
Norm calculation approaches for dynamic thresholding. More... | |
Functions | |
std::unique_ptr< Image > | StaticThreshold (const Image &image, const Image &thresholds, StaticThresholding comparison) |
This function performs thresholding of an input image with pixel-by-pixel thresholds stored in the pixels of a thresholds image. More... | |
template<class RANGE > | |
TypedRange< std::unique_ptr< Image >, double, RANGE >::type | StaticThreshold (const Image &image, const RANGE &values, StaticThresholding comparison) |
Create an output image, that is the result of static thresholding. More... | |
std::unique_ptr< Image > | StaticThreshold (const Image &image, double value, StaticThresholding comparison) |
Create an output image that is the result of static thresholding. More... | |
std::unique_ptr< Image > | DynamicThreshold (const Image &image, int windowSize, int threshold, DynamicThresholdNorm norm=DynamicThresholdNorm::Mean) |
This function performs dynamic thresholding on the input image. More... | |
template<class RANGE > | |
TypedRange< std::unique_ptr< Image >, double, RANGE >::type | StaticTransparentThreshold (const Image &image, const RANGE &thresholds, StaticThresholding comparison, const RANGE &values) |
Create a thresholded image using a transparency approach. More... | |
std::unique_ptr< Image > | StaticTransparentThreshold (const Image &image, double threshold, StaticThresholding comparison, double value) |
Create a thresholded image using a transparency approach. More... | |
template<class RANGE > | |
TypedRange< std::unique_ptr< Image >, double, RANGE >::type | StaticTransparentThreshold (const Image &image, const RANGE &thresholds, StaticThresholding comparison) |
Create a thresholded image using a transparency approach. More... | |
std::unique_ptr< Image > | StaticTransparentThreshold (const Image &image, double threshold, StaticThresholding comparison) |
Create a thresholded image using a transparency approach. More... | |
void | RangeThresholdToDst (const ImagePlane &plane, ValueRange< int > range, Image &imageDst, Rect< int > aoi) |
A range based binarization algorithm to the given input. More... | |
void | RangeThresholdToDst (const ImagePlane &plane, ValueRange< int > range, Image &imageDst) |
A range based binarization algorithm to the given input. More... | |
std::unique_ptr< Image > | RangeThreshold (const ImagePlane &plane, ValueRange< int > range, Rect< int > aoi) |
A range based binarization algorithm to the given input. More... | |
std::unique_ptr< Image > | RangeThreshold (const ImagePlane &plane, ValueRange< int > range) |
A range based binarization algorithm to the given input. More... | |
Namespace for collection of thresholding functions from the Foundation package.
|
strong |
Norm calculation approaches for dynamic thresholding.
|
strong |
|
inline |
This function performs dynamic thresholding on the input image.
[in] | image | Image to be thresholded. |
[in] | windowSize | Window size to calculate the dynamic threshold. Bigger window sizes will lead to higher processing times. |
[in] | threshold | Threshold offset to use. |
[in] | norm | Either DynamicThresholdNorm::Mean (default) or DynamicThresholdNorm::MinMax. |
Any | exception derived from std::exception including CvbException. |
Dynamic thresholding works by calculating the average gray value over a mask with given size (centered around the pixel in question) for each input pixel. If the difference between this average and the pixel, that is currently being looked at, is above the specified threshold, then the corresponding pixel in the output image is set to white, otherwise it is black.
This function is particularly useful, when dealing with images, that have a non-uniform illumination.
|
inline |
A range based binarization algorithm to the given input.
[in] | plane | Image plane to binarize. |
[in] | range | The gray value range for binarization. |
Any | exception derived from std::exception including CvbException. |
The binarization algorithm is implemented in the blob analyzer.
|
inline |
A range based binarization algorithm to the given input.
[in] | plane | Image plane to binarize. |
[in] | range | The gray value range for binarization. |
[in] | aoi | Area of interest to binarize. |
Any | exception derived from std::exception including CvbException. |
The binarization algorithm is implemented in the blob analyzer.
|
inline |
A range based binarization algorithm to the given input.
[in] | plane | Image plane to binarize. |
[in] | range | The gray value range for binarization. |
[in] | imageDst | Destination image to receive the binarization result. |
Any | exception derived from std::exception including CvbException. |
The binarization algorithm is implemented in the blob analyzer.
This destination image must have one plane only with 8 bits per pixel and be compatible with the input aoi in terms of size.
|
inline |
A range based binarization algorithm to the given input.
[in] | plane | Image plane to binarize. |
[in] | range | The gray value range for binarization. |
[in] | imageDst | Destination image to receive the binarization result. |
[in] | aoi | Area of interest to binarize. |
Any | exception derived from std::exception including CvbException. |
The binarization algorithm is implemented in the blob analyzer.
Please note, that despite the fact, that it is possible to specify an area of interest, the binarized data will always be located in the top left corner of the image.
This destination image must have one plane only with 8 bits per pixel and be compatible with the input aoi in terms of size.
|
inline |
This function performs thresholding of an input image with pixel-by-pixel thresholds stored in the pixels of a thresholds image.
[in] | image | Image to be thresholded. |
[in] | thresholds | Image containing the threshold values for the pixels of the input image. |
[in] | comparison | Comparison to apply. |
Any | exception derived from std::exception including CvbException. |
Both images should be identical in size. However, if they are not, the smallest common rectangle (located at the top left pixel) of both images will be the size of the result image. Both input images should have identical dimensions (either 1 or 3 planes per image) and identical data types.
|
inline |
Create an output image, that is the result of static thresholding.
[in] | image | Image to apply static thresholding to. |
[in] | values | Threshold values - the array must contain at least one threshold per plane available in the image. |
[in] | comparison | Comparison method. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Create an output image that is the result of static thresholding.
[in] | image | Image to apply static thresholding to. |
[in] | value | Threshold value to be applied to each image plane. |
[in] | comparison | Comparison method. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Create a thresholded image using a transparency approach.
[in] | image | Input image. |
[in] | thresholds | Thresholds to apply (one per plane). |
[in] | comparison | Thresholding condition. |
Any | exception derived from std::exception including CvbException. |
In the result image every pixel, that violates the comparison to its threshold, will be assigned the threshold value. All others will be assigned the same value, they had in the input image.
|
inline |
Create a thresholded image using a transparency approach.
[in] | image | Input image. |
[in] | thresholds | Thresholds to apply (one per plane). |
[in] | comparison | Thresholding condition. |
[in] | values | Value to set for pixels, that violate the thresholding condition (one per plane required). |
Any | exception derived from std::exception including CvbException. |
In the result image every pixel, that violates the comparison to its threshold, will be assigned the value specified in values argument. All others will be assigned the same value, they had in the input image.
|
inline |
Create a thresholded image using a transparency approach.
[in] | image | Input image. |
[in] | threshold | Threshold to apply to each image plane. |
[in] | comparison | Thresholding condition. |
Any | exception derived from std::exception including CvbException. |
In the result image every pixel, that violates the comparison to its threshold, will be assigned the threshold value. All others will be assigned the same value, they had in the input image.
|
inline |
Create a thresholded image using a transparency approach.
[in] | image | Input image. |
[in] | threshold | Threshold value to be applied to each image plane. |
[in] | comparison | Thresholding condition. |
[in] | value | Value to set for pixels, that violate the thresholding condition (applies to all planes). |
Any | exception derived from std::exception including CvbException. |
In the result image every pixel, that violates the comparison to its threshold, will be assigned the value specified in values argument. All others will be assigned the same value, they had in the input image.