Inheritance diagram for hsvthreshold_Filter:
This filter is used to reduce the noise that revolves around the more ambiguous areas of the HSV cone. When the Value and Saturation channels are close to their extremes, the Hue channel of the image tends to fluctuate during the conversions from RGB or other formats. A black color could turn out to be a green or red hue and might be matched (using the blob_Filter) for cases that one wishes it not to match. By thresholding out (matching the extreme values and setting them to 0) the extremes for Value and Saturation, it can cause the blob_Filter to not match the dark or bright pixels where the Hue is ambiguous.
The HSV threshold filter has an 'enable', 'lower bound' and 'upper bound' parameter for each channel: Hue, Saturation and Value. If the thresholding is to be performed on the H,S or V channels, the 'enable' parameter should be set to hsvthreshold_Threshold / 1 OR hsvthreshold_Group / 2. If either hsvthreshold_Threshold or hsvthreshold_Group are used then the threshold parameters will be used. If hsvthreshold_Group is used then an additional step will take place where the values will be grouped by setting the values to the center value of a bin which is currently hard coded by will be configurable later through a completely separate filter.
With the thresholding of a channel enabled, the filter will iterate through all pixels of an image and examine the value of each channel by comparing it to the 'lower bound' and 'upper bound' values for each channel. Thresholding out consists of setting the value of the channel to 0. This allows the pixel to be excluded from being matched by the blob_Filter (when the blob_Filter parameters are set correctly). There are two possible cases that can be created with a 'lower bound' and an 'upper bound': lower < upper and upper < lower.
If the 'lower bound' ( h1, s1, v1 ) is greater than the 'upper bound' ( h2, s2, v2 ), the thresholding will zeroize values that lie below the 'lower bound' or above the 'upper bound'.
If the 'lower bound' ( h1, s1, v1 ) is less than the 'upper bound' ( h2, s2, v2 ), the thresholding will zeroize values that lie between the 'lower bound' and the 'upper bound', including those values equal to the threshold.
Supports the following formats:
add example application code that shows how the processed images were output
Definition at line 104 of file hsvthreshold_Filter.h.
Public Member Functions
|hsvthreshold_Filter (uint32_t h, uint32_t s, uint32_t v, uint32_t h1=255, uint32_t s1=255, uint32_t v1=10, uint32_t h2=0, uint32_t s2=10, uint32_t v2=255)|
|int||set (uint32_t h, uint32_t s, uint32_t v, uint32_t h1=255, uint32_t s1=255, uint32_t v1=255, uint32_t h2=0, uint32_t s2=10, uint32_t v2=10)|
|phFilter *||cloneFilter ()|
Protected Member Functions
|Copyright (C) 2002 - 2007||
Philip D.S. Thoren ( email@example.com )
University Of Massachusetts at Lowell