You are here: Start » AVL.NET » AVL.CheckPresence_PixelAmount(AvlNet.Image, AvlNet.ShapeRegion, AvlNet.CoordinateSystem2D?, AvlNet.HSxColorModel, int, int, int, int?, int?, int?, float, float, bool, float, AvlNet.Region, AvlNet.ShapeRegion, AvlNet.Image)
AVL.CheckPresence_PixelAmount(AvlNet.Image, AvlNet.ShapeRegion, AvlNet.CoordinateSystem2D?, AvlNet.HSxColorModel, int, int, int, int?, int?, int?, float, float, bool, float, AvlNet.Region, AvlNet.ShapeRegion, AvlNet.Image)
Verifies object presence by analysing the amount of pixels that meet the specified criteria.
| Namespace: | AvlNet |
|---|---|
| Assembly: | AVL.NET.dll |
Syntax
public static void CheckPresence_PixelAmount( AvlNet.Image inImage, AvlNet.ShapeRegion inRoi, AvlNet.CoordinateSystem2D? inRoiAlignment, AvlNet.HSxColorModel inColorModel, int inBeginHue, int inEndHue, int inMinSaturation, int? inMaxSaturation, int? inMinBrightness, int? inMaxBrightness, float inMinAmount, float inMaxAmount, out bool outIsPresent, out float outAmount, out AvlNet.Region outForeground, out AvlNet.ShapeRegion outAlignedRoi, out AvlNet.Image diagHsxImage )
Parameters
- inImage
- Type: AvlNet.Image
Input image - inRoi
- Type: AvlNet.ShapeRegion
Location at which object presence is being checked - inRoiAlignment
- Type: System.Nullable<AvlNet.CoordinateSystem2D>
Adjusts the region of interest to the position of the inspected object, or null. - inColorModel
- Type: AvlNet.HSxColorModel
Selected color model - inBeginHue
- Type: System.Int32
Begin of the range of acceptable hue - inEndHue
- Type: System.Int32
End of the range of acceptable hue - inMinSaturation
- Type: System.Int32
Lowest acceptable saturation - inMaxSaturation
- Type: System.Nullable<System.Int32>
Highest acceptable saturation, or null. - inMinBrightness
- Type: System.Nullable<System.Int32>
Lowest acceptable brightness, or null. - inMaxBrightness
- Type: System.Nullable<System.Int32>
Highest acceptable brightness, or null. - inMinAmount
- Type: System.Single
Lowest acceptable fraction of pixels meeting the criteria - inMaxAmount
- Type: System.Single
Highest acceptable fraction of pixels meeting the criteria - outIsPresent
- Type: System.Boolean
Flag indicating whether the object is present or not - outAmount
- Type: System.Single
- outForeground
- Type: AvlNet.Region
- outAlignedRoi
- Type: AvlNet.ShapeRegion
- diagHsxImage
- Type: AvlNet.Image
Image represented in chosen color model
Description
The filter extracts foreground pixels by means of image thresholding and checks if their number comparing to the area of the whole ROI fits the range (inMinAmount, inMaxAmount). If the input image has 3 channels, the ThresholdToRegion_HSx filter is used for thresholding, and if the image has 1 channel (i.e. it is monochromatic), the simple ThresholdToRegion filter is performed. In the latter case only inMinBrightness and inMaxBrightness parameters matter.
Examples
CheckPresence_PixelAmount performed on sample image with inMinAmount = 0.7. The defects are present in red circles.
