Thresholding functions in the Common Vision Blox Foundation Package.
More...
|
static Image | Static (Image img, double[] values, StaticThresholding comparison) |
| Create an output image that is the result of static thresholding. More...
|
|
static Image | Static (Image img, 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...
|
|
static Image | Dynamic (Image img, int windowSize, int threshold) |
| This function performs dynamic thresholding on the input image with the DynamicThresholdNorm.Mean norm. More...
|
|
static Image | Dynamic (Image img, int windowSize, int threshold, DynamicThresholdNorm norm) |
| This function performs dynamic thresholding on the input image. More...
|
|
static Image | StaticTransparent (Image img, StaticThresholding comparison, double[] thresholds) |
| Create a thresholded image using a transparency approach. More...
|
|
static Image | StaticTransparent (Image img, StaticThresholding comparison, double[] thresholds, double[] values) |
| Create a thresholded image using a transparency approach. More...
|
|
static void | RangeThresholdToDst (ImagePlane plane, ValueRange< int > range, Image dst, Rect aoi) |
| Apply the blob analyzer's binarization algorithm to the given input plane . More...
|
|
static void | RangeThresholdToDst (ImagePlane plane, ValueRange< int > range, Image dst) |
| Apply the blob analyzer's binarization algorithm to the given input plane . /// More...
|
|
static Image | RangeThreshold (ImagePlane plane, ValueRange< int > range, Rect aoi) |
| Apply the blob analyzer's binarization algorithm to the given input plane and returns a new binarized image. More...
|
|
static Image | RangeThreshold (ImagePlane plane, ValueRange< int > range) |
| Apply the blob analyzer's binarization algorithm to the given input plane and returns a new binarized image. More...
|
|
Thresholding functions in the Common Vision Blox Foundation Package.
◆ Dynamic() [1/2]
static Image Dynamic |
( |
Image |
img, |
|
|
int |
windowSize, |
|
|
int |
threshold |
|
) |
| |
|
static |
This function performs dynamic thresholding on the input image with the DynamicThresholdNorm.Mean norm.
Dynamic thresholding works such that for each pixel of the input image, the average gray value over a mask with given size (centered around the pixel in question) is calculated. 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.
- Parameters
-
img | Image to be thresholded. |
windowSize | Window size to be for calculating the dynamic threshold.Bigger window sizes will lead to higher processing times. |
threshold | Threshold offset to use |
- Returns
- The thresholded image.
- Exceptions
-
ArgumentNullException | If the input img is null |
ObjectDisposedException | If the input img has already been disposed |
◆ Dynamic() [2/2]
This function performs dynamic thresholding on the input image.
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.
- Parameters
-
- Returns
- The thresholded image.
- Exceptions
-
ArgumentNullException | If the input img is null |
ObjectDisposedException | If the input img has already been disposed |
◆ RangeThreshold() [1/2]
Apply the blob analyzer's binarization algorithm to the given input plane and returns a new binarized image.
- Parameters
-
plane | Image plane to binarize |
range | The gray value range for binarization. |
- Returns
- Resulting binarized image.
◆ RangeThreshold() [2/2]
Apply the blob analyzer's binarization algorithm to the given input plane and returns a new binarized image.
- Parameters
-
plane | Image plane to binarize |
range | The gray value range for binarization. |
aoi | Area of interest to binarize. |
- Returns
- Resulting binarized image.
◆ RangeThresholdToDst() [1/2]
Apply the blob analyzer's binarization algorithm to the given input plane . ///
- Parameters
-
plane | Image plane to binarize |
range | The gray value range for binarization. |
dst | Destination image to receive the binarization result. This image must have one plane only with 8 bits per pixel and be compatible with the input plane in terms of size. |
◆ RangeThresholdToDst() [2/2]
Apply the blob analyzer's binarization algorithm to the given input plane .
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.
- Parameters
-
plane | Image plane to binarize |
range | The gray value range for binarization. |
dst | - Parameters
-
aoi | Area of interest to binarize. |
|
Destination image to receive the binarization result.
This image must have one plane only with 8 bits per pixel and be compatible with the input aoi in terms of size.
◆ Static() [1/2]
Create an output image that is the result of static thresholding.
- Parameters
-
img | Image to apply static thresholding to. |
values | Threshold values - the array must contain at least one threshold per plane available in the image. |
comparison | Comparison method. |
- Returns
- The thresholded image.
- Exceptions
-
ArgumentNullException | If the input img is null or the values array is null |
ObjectDisposedException | If the input img has already been disposed |
ArgumentException | If the values array does not contain enough values |
◆ Static() [2/2]
This function performs thresholding of an input image with pixel-by-pixel thresholds stored in the pixels of a thresholds image.
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.
- Parameters
-
img | Image to be thresholded. |
thresholds | Image containing the threshold values for the pixels of the input img . |
comparison | Comparison to apply |
- Returns
- The thresholded image.
- Exceptions
-
ArgumentNullException | If the input img or thresholds is null . |
ObjectDisposedException | If the input img or thresholds has already been disposed. |
◆ StaticTransparent() [1/2]
Create a thresholded image using a transparency approach.
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.
- Parameters
-
img | Input image |
thresholds | Thresholds to apply (one per plane). |
comparison | Thresholding condition. |
- Returns
- The thresholded image.
- Exceptions
-
ArgumentNullException | If img , or thresholds is null . |
ObjectDisposedException | If img has been disposed. |
ArgumentException | If thresholds has too few elements. |
◆ StaticTransparent() [2/2]
Create a thresholded image using a transparency approach.
In the result image every pixel, that violates the comparison to its threshold, will be assigned the specified value. All others will be assigned the same value, they had in the input image.
- Parameters
-
img | Input image |
thresholds | Thresholds to apply (one per plane). |
values | Value to set for pixels, that violate the thresholding condition (one per plane required). |
comparison | Thresholding condition. |
- Returns
- The thresholded image.
- Exceptions
-
ArgumentNullException | If img , thresholds or values is null . |
ObjectDisposedException | If img has been disposed. |
ArgumentException | If thresholds or values have too few elements. |