ImageGear .NET - Updated
ImGearPixelCheckerThreshold Class
Members  Example 




ImageGear24.Processing.Advanced Assembly > ImageGear.Processing Namespace : ImGearPixelCheckerThreshold Class
Checks the pixel using the initial pixel and the threshold.
Object Model
ImGearPixelCheckerThreshold Class
Syntax
'Declaration
 
Public Class ImGearPixelCheckerThreshold 
   Implements IImGearPixelChecker 
'Usage
 
Dim instance As ImGearPixelCheckerThreshold
public class ImGearPixelCheckerThreshold : IImGearPixelChecker  
public __gc class ImGearPixelCheckerThreshold : public IImGearPixelChecker  
public ref class ImGearPixelCheckerThreshold : public IImGearPixelChecker  
Remarks
CheckPixel method of this class checks the pixel using the initial pixel and the threshold. The pixel is supposed to be in the area if the following condition is true for all pixel channels:

pixel[i] >= initialPixel[i] - threshold && pixel[i] <= initialPixel[i] + threshold

Example
// Detect an area around a point in an image based upon a base pixel and threshold.

// Top left corner of image
ImGearPoint igPoint = new ImGearPoint(0, 0);
//Get the Pixel currently there.
ImGearPixel igPixel = igRasterPage.DIB.GetPixelCopy(0, 0);
// Detection class, threshold is difference in pixel channel values from specified pixel.
ImGearPixelCheckerThreshold igPixelCheckerThreshold = new ImGearPixelCheckerThreshold(igPixel, 100);
// Detect the region around target point within the threshold.
ImGearEffects.DetectArea(igRasterPage, igPoint, igPixelCheckerThreshold);

// Invert the contrast of the selected region to visible show the detected region.
ImGearRasterProcessing.InvertContrast(igRasterPage);
' Detect an area around a point in an image based upon a base pixel and threshold.

' Top left corner of image
Dim igPoint As New ImGearPoint(0, 0)
'Get the Pixel currently there.
Dim igPixel As ImGearPixel = igRasterPage.DIB.GetPixelCopy(0, 0)
' Detection class, threshold is difference in pixel channel values from specified pixel.
Dim igPixelCheckerThreshold As New ImGearPixelCheckerThreshold(igPixel, 100)
' Detect the region around target point within the threshold.
ImGearEffects.DetectArea(igRasterPage, igPoint, igPixelCheckerThreshold)

' Invert the contrast of the selected region to visible show the detected region.
ImGearRasterProcessing.InvertContrast(igRasterPage)
Inheritance Hierarchy

System.Object
   ImageGear.Processing.ImGearPixelCheckerThreshold

See Also

Reference

ImGearPixelCheckerThreshold Members
ImageGear.Processing Namespace
DetectArea Method