IMVColor
This interface is exposed to allow programmatic control of the filter. Read the filter description to see how the filter is used. Read the remarks for implementation details.
| get_UpperThreshold | Returns the value for the upper color filter threshold. |
| put_UpperThreshold | Sets the value for the upper color filter threshold. |
| get_LowerThreshold | Returns the value for the lower color filter threshold. |
| put_LowerThreshold | Sets the value for the lower color filter threshold. |
| get_FilterMethod | Returns the filter method as MV_FILTER_METHOD. |
| put_FilterMethod | Sets the filter method as MV_FILTER_METHOD. |
| get_PixelColorTo | Returns the value that is used to replace the channel values that are filtered out by the image processing algorithm as MV_COLOR_RESULT. |
| put_PixelColorTo | Sets the value that is used to replace the channel values that are filtered out by the image processing algorithm as MV_COLOR_RESULT. |
| get_ModifyPixel | Returns the pixel modification method as MV_COLOR_METHOD. |
| put_ModifyPixel | Sets the pixel modification method as MV_COLOR_METHOD. |
| get_ColorChannel | Returns the color channel that is currently modified as MV_COLOR_CHANNEL_NUM. |
| put_ColorChannel | Sets the color channel that shall be modified as MV_COLOR_CHANNEL_NUM. |
| get_ColorModel | Returns the used color system as MV_COLOR_SYSTEM. |
| put_ColorModel | Sets the desired color system as MV_COLOR_SYSTEM. |
| Reset | Resets the color filter parameters to their initial state. |
Header
file: iMVColor.h
Interface definition language file:
iMVColor.idl
Typelib: MVColor
Interface ID:IID_IMVColor
HRESULT get_UpperThreshold( [out, retval] double *pdUpperThreshold );
Returns the value for the filter's upper color threshold. See
the MV Color filter for
channel sequences and ranges.
Example: If the filter method is set to band reject, all color
values above the upper threshold are left unmodified and all color
values between the lower and the upper threshold are modified.
Parameter:
| pdUpperThreshold | A pointer to a double value that receives the upper threshold. |
HRESULT put_UpperThreshold( [in ] double dUpperThreshold );
Sets the value for the filter's upper color threshold. See the
MV Color filter for channel
sequences and ranges.
Example: If the filter method is set to band
reject, all color values above the upper
threshold are left unmodified and all color values between the
lower and the upper threshold are modified.
Parameter:
| dUpperThreshold | The upper threshold to be set. |
HRESULT get_LowerThreshold( [out, retval] double *pdLowerThreshold );
Returns the value for the filter's lower color threshold. See
the MV Color filter for
channel sequences and ranges.
Example: If the filter method is set to band reject, all color
values below the lower threshold are left unmodified and all color
values between the lower and the upper threshold are modified.
Parameter:
| pdLowerThreshold | A pointer to a double value that receives the lower threshold. |
HRESULT put_LowerThreshold( [in ] double dLowerThreshold );
Sets the value for the filter's lower color threshold. See the
MV Color filter for channel
sequences and ranges.
Example: If the filter method is set to band reject, all color
values below the lower threshold are left unmodified and all color
values between the lower and the upper threshold are modified.
Parameter:
| dLowerThreshold | The lower threshold to be set. |
HRESULT get_FilterMethod( [out, retval] int *piMethod );
Returns the filter method that is used by the image processing algorithm, that is either band pass or band reject.
Parameter:
| piMethod | A pointer to an integer value that receives the filter method as MV_FILTER_METHOD. |
HRESULT put_FilterMethod( [in ] int iMethod );
Sets the filter method that is used by the image processing algortihm, that is either band pass or band reject.
Parameter:
| iMethod | The filter method to be used as MV_FILTER_METHOD. |
HRESULT get_PixelColorTo( [out, retval] int *piResult );
Returns the method that is used to modify the pixel channels
that are filtered out by the filter method. Either the filtered out
channels are set to the maximum or to the minimum of the currently
selected color system.
Example: If the selected color system is RGB and the filtered out
pixel channels are to be set to the maximum, the channels will be
set to 255.
Parameter:
| piResult | A pointer to an integer value that receives the method that is used to modify the filtered out channels as MV_COLOR_RESULT. |
HRESULT put_PixelColorTo( [in ] int iResult );
Returns the method that is used to modify the pixel channels
that are filtered out by the filter method. Either the filtered out
channels are set to the maximum or to the minimum of the currently
selected color system.
Example: If the selected color system is RGB and the filtered out
pixel channels are to be set to the maximum, the channels will be
set to 255.
Parameter:
| iResult | The method that is used to modify the filtered out channels as MV_COLOR_RESULT. |
HRESULT get_ModifyPixel( [out, retval] int *piWholePixel );
Returns the pixel modification method. Either only the currently selected channel of the pixel that is filtered out is modified or all channels of the pixel are modified.
Parameter:
| piWholePixel | A pointer to an integer value that receives the information about the pixel modification method as MV_COLOR_METHOD. |
HRESULT put_ModifyPixel( [in ] int iWholePixel );
Sets the pixel modification method. Either only the currently selected channel of the pixel that is filtered out is modified or all channels of the pixel are modified.
Parameter:
| iWholePixel | Sets the pixel modification method as MV_COLOR_METHOD. |
HRESULT get_ColorChannel( [out, retval] int *piChannel );
Returns the color channel that is currently modified by the image processing algorithm. See the MV Color filter for channel sequences and ranges.
Parameter:
| piChannel | A pointer to an integer value that receives the currently modified color channel as MV_COLOR_CHANNEL_NUM. |
HRESULT put_ColorChannel( [in ] int iChannel );
Sets the color channel that is to be modified by the image processing algorithm. See the MV Color filter for channel sequences and ranges.
Parameter:
| iChannel | The channel that is to be modified as MV_COLOR_CHANNEL_NUM. |
HRESULT get_ColorModel( [out, retval] int *piSystem );
Returns the current color system.
Parameter:
| piSystem | A pointer to an integer value that receives the currently selected color system as MV_COLOR_SYSTEM. |
HRESULT put_ColorModel( [out, retval] int iSystem );
Sets the current color system.
Parameter:
| iSystem | The desired color system as MV_COLOR_SYSTEM. |
HRESULT Reset();
Resets the color filter's parameters to their initial state.
Filter specific structures and enumerators
typedef enum _MV_COLOR_SYSTEM
{
MV_COLOR_RGB,
MV_COLOR_HSV,
MV_COLOR_HLS,
MV_COLOR_XYZ,
MV_COLOR_YCrCb,
MV_COLOR_YUV
} MV_COLOR_SYSTEM;
typedef enum _MV_COLOR_FILTER
{
MV_BAND_REJECT,
MV_BAND_PASS
} MV_COLOR_FILTER;
typedef enum _MV_COLOR_METHOD
{
MV_MODIFY_SELECTED_PIXEL_COLOR,
MV_MODIFY_ALL_PIXEL_COLORS
} MV_COLOR_METHOD;
typedef enum _MV_COLOR_RESULT
{
MV_COLOR_MINIMUM,
MV_COLOR_MAXIMUM
} MV_COLOR_RESULT;
typedef enum _MV_COLOR_CHANNEL_NUM
{
MV_CHANNEL_1,
MV_CHANNEL_2,
MV_CHANNEL_3
} _MV_COLOR_CHANNEL_NUM;
The following is an example sequence, that is used to set all channels of a pixel in a RGB image to zero, if the red value of the pixel is higher than 200.
IMVColor *pIColor;
...
// RGB color system
pIColor->put_ColorModel( MV_COLOR_RGB
);
// Red color channel
pIColor->put_ColorChannel( MV_CHANNEL_3
);
// Pass through all values between 0 and
200
pIColor->put_LowerThreshold( 0.0
);
pIColor->put_UpperThreshold( 200.0
);
// Work as a band pass
pIColor->put_FilterMethod( MV_BAND_PASS
);
// Modify all channels of filtered
pixels
pIColor->put_ModifyPixel(
MV_MODIFY_ALL_PIXEL_COLORS );
// Set the filtered pixel channels to
zero
pIColor->put_PixelColorTo(
MV_COLOR_MINIMUM );