Visual Basic (Declaration) | |
---|---|
Public Class ColorThresholdCommand Inherits RasterCommand Implements IRasterCommand |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public class ColorThresholdCommand : RasterCommand, IRasterCommand |
Managed Extensions for C++ | |
---|---|
public __gc class ColorThresholdCommand : public RasterCommand, IRasterCommand |
C++/CLI | |
---|---|
public ref class ColorThresholdCommand : public RasterCommand, IRasterCommand |
Visual Basic | Copy Code |
---|---|
ImageProcessing.Color.ColorThresholdCommand |
C# | Copy Code |
---|---|
ImageProcessing.Color.ColorThresholdCommand |
Every color space component may have a different range:
This class works as follows:
For more information, refer to Processing an Image.
For more information, refer to Correcting Colors.
Color Component | Range for 8 bit per component. | Range for 16 bit per component. |
RGB | ||
R | 0 ... 255 | 0 ... 65535 |
G | 0 ... 255 | 0 ... 65535 |
B | 0 ... 255 | 0 ... 65535 |
HSV | ||
H | 0 ... 360 | 0 ... 36000 |
S | 0 ... 100 | 0 ... 10000 |
V | 0 ... 255 | 0 ... 65535 |
HLS | ||
H | 0 ... 360 | 0 ... 36000 |
L | 0 ... 255 | 0 ... 65535 |
S | 0 ... 100 | 0 ... 10000 |
XYZ | ||
X | 0 ... 255 | 0 ... 65535 |
Y | 0 ... 255 | 0 ... 65535 |
Z | 0 ... 255 | 0 ... 65535 |
YCrCb | ||
Y | 0 ... 255 | 0 ... 65535 |
Cr | -128 ... 127 | -32768 ... 32767 |
Cb | -128 ... 127 | -32768 ... 32767 |
YUV | ||
Y | 0 ... 255 | 0 ... 65535 |
U | -112 ... 111 | -28567 ... 28566 |
V | -138 ... 137 | -35337 ... 35336 |
LAB | ||
L | 0 ... 100 | 0 ... 10000 |
A | -128 ... 127 | -32768 ... 32767 |
B | -128 ... 127 | -32768 ... 32767 |
CMY | ||
C | 0 ... 255 | 0 ... 65535 |
M | 0 ... 255 | 0 ... 65535 |
Y | 0 ... 255 | 0 ... 65535 |
This class works as follows:
The image is converted to the required color space. For every pixel, the following operations are performed: Each component is compared with the MinimumRange and MaximumRange values of the appropriate ColorThresholdCommandComponent class. If it is inside the range, the component is considered to have "passed" the test. If it is outside the range, the component has been rejected". The ColorThresholdCommandFlags.BandReject flag inverts this by making "rejected" components "passed" and viceversa.
If ColorThresholdCommandFlags.EffectChannel is set, the components are modified independently. If ColorThresholdCommandFlags.EffectAll has been set, the pixel is rejected by the test if any component is rejected. If the pixel/component is rejected, then: If ColorThresholdCommandFlags.SetToMinimum is set, the rejected pixel/component is set to 0. If ColorThresholdCommandFlags.SetToMaximum is set, the rejected pixel/component is set to 255. If ColorThresholdCommandFlags.SetToClamp is set, components less that MinimumRange go to 0 and components greater than MaximumRange go to 255. This would work only with the ColorThresholdCommandFlags.EffectChannel and ColorThresholdCommandFlags.BandBass flags.
This class works for 1, 2, 3, _ 8,16, 24, 32, 48 and 64-bit color images and can support regions for 24 and 48-bit images. If a 24 or 48-bit image has a region the effect will be applied on the region only. One class is used for each color component. The order is considered to be the same as in the xxx Space name. For example, for Rgb Space: Components[0] class is used for the Red component. Components[1] class is used for the Green component. Components[2] class is used for the Blue component.
This command does not support 32-bit grayscale images. This command does not support signed images.
For more information, refer to Processing an Image.
For more information, refer to Correcting Colors.
System.Object
Leadtools.ImageProcessing.RasterCommand
Leadtools.ImageProcessing.Color.ColorThresholdCommand
Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
Reference
ColorThresholdCommand MembersLeadtools.ImageProcessing.Color Namespace
Processing an Image
Correcting Colors
BinaryFilterCommand
ColorSeparateCommand Class
ColorMergeCommand Class
AddNoiseCommand
IntensityDetectCommand Class
SpatialFilterCommand
BinaryFilterCommand
MaximumCommand
MinimumCommand
ShadowCommand
ChangeHueSaturationIntensityCommand Class
ColorThresholdCommand Class
DiscreteFourierTransformCommand
FastFourierTransformCommand
FourierTransformDisplayCommand
FrequencyFilterCommand
FrequencyFilterMaskCommand
DirectionEdgeStatisticalCommand
MathematicalFunctionCommand Class
RevEffectCommand
SegmentCommand Class
SubtractBackgroundCommand
UserFilterCommand
AdjustTintCommand Class
HalfToneCommand