Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

hsvthreshold_Filter Class Reference
[Single FrameUtilityPixel Manipulation Filters]

#include <hsvthreshold_Filter.h>

Inheritance diagram for hsvthreshold_Filter:

phFilter phMutex phObject List of all members.

Detailed Description

Threshold the HSV channels to remove certain range values by replacing it with another value.

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:

Todo:
split the hsvthreshold_Filter code base into a channelGroup_Filter or decimate_Filter where the values of the channels in a pixel are grouped by setting ranges to a center bin value: 0-9 = 4, 10-19 = 14, 20-29 =24 for all the channels of a pixel for all pixels in an image

add example application code that shows how the processed images were output

Todo:
add example image inputs and processed image outputs

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)
 ~hsvthreshold_Filter ()
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)
phFiltercloneFilter ()

Protected Member Functions

int filter ()

Private Attributes

uint32_t m_h
uint32_t m_s
uint32_t m_v
uint32_t m_h1
uint32_t m_s1
uint32_t m_v1
uint32_t m_h2
uint32_t m_s2
uint32_t m_v2


The documentation for this class was generated from the following files:



Copyright (C) 2002 - 2007 Philip D.S. Thoren ( pthoren@users.sourceforge.net )
University Of Massachusetts at Lowell
Robotics Lab
SourceForge.net Logo

Generated on Sat Jun 16 02:44:37 2007 for phission by  doxygen 1.4.4