You are here: Start » FIL.NET » Function Reference » Computer Vision » Image Analysis » FIL.CheckPresence_PixelAmount
Verifies object presence by analysing the amount of pixels that meet the specified criteria.
Namespace: | FilNet |
---|---|
Assembly: | FIL.NET.dll |
Syntax
public static void CheckPresence_PixelAmount ( FilNet.Image inImage, FilNet.ShapeRegion inRoi, FilNet.CoordinateSystem2D? inRoiAlignment, FilNet.HSxColorModel inColorModel, int inBeginHue, int inEndHue, int inMinSaturation, int? inMaxSaturation, float? inMinBrightness, float? inMaxBrightness, float inMinAmount, float inMaxAmount, out bool outIsPresent, NullableValue<float> outAmount, NullableRef<FilNet.Region> outForeground, NullableRef<FilNet.ShapeRegion> outAlignedRoi )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() | inImage | FilNet.Image | Input image. | ||
![]() | inRoi | FilNet.ShapeRegion | Location at which object presence is being checked. | ||
![]() | inRoiAlignment | FilNet.CoordinateSystem2D? | Adjusts the region of interest to the position of the inspected object. Default value: ftl::NIL. | ||
![]() | inColorModel | FilNet.HSxColorModel | Selected color model. | ||
![]() | inBeginHue | int | <0, 255> | 0 | Begin of the range of acceptable hue. Default value: 0. |
![]() | inEndHue | int | <0, 255> | 255 | End of the range of acceptable hue. Default value: 255. |
![]() | inMinSaturation | int | <0, 255> | 128 | Lowest acceptable saturation. Default value: 128. |
![]() | inMaxSaturation | int? | <0, 255> | Highest acceptable saturation. Default value: ftl::NIL. | |
![]() | inMinBrightness | float? | <0.0f, INF> | 128.0f | Lowest acceptable brightness. Default value: 128.0f. |
![]() | inMaxBrightness | float? | <0.0f, INF> | Highest acceptable brightness. Default value: ftl::NIL. | |
![]() | inMinAmount | float | <0.0f, 1.0f> | 0.5f | Lowest acceptable fraction of pixels meeting the criteria. Default value: 0.5f. |
![]() | inMaxAmount | float | <0.0f, 1.0f> | 1.0f | Highest acceptable fraction of pixels meeting the criteria. Default value: 1.0f. |
![]() | outIsPresent | bool | Flag indicating whether the object is present or not. | ||
![]() | outAmount | FilNet.NullableValue<float> | Fraction of pixels meeting the criteria. Can be null to skip this parameter calculation. | ||
![]() | outForeground | FilNet.NullableRef<FilNet.Region> | Region of pixels meeting the criteria. Can be null to skip this parameter calculation. | ||
![]() | outAlignedRoi | FilNet.NullableRef<FilNet.ShapeRegion> | Input ROI after transformation (in the image coordinates). Can be null to skip this parameter calculation. |
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.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Incorrect inMaxBrightness value in CheckPresence_PixelAmount. |
DomainError | Incorrect inMinBrightness value in CheckPresence_PixelAmount. |
DomainError | Region exceeds an input image in CheckPresence_PixelAmount. |
DomainError | Not supported inImage pixel format in CheckPresence_PixelAmount. Supported formats: 3xUInt8, 1xUInt8, 1xInt8, 1xUInt16, 1xInt16, 1xInt32, 1xReal. |
Function Overrides
- CheckPresence_PixelAmount(Image, ShapeRegion, HSxColorModel, Int32, Int32, Int32, Nullable<Single>, Nullable<Single>, Single, Single, Boolean)
- CheckPresence_PixelAmount(Image, ShapeRegion, Nullable<CoordinateSystem2D>, HSxColorModel, Int32, Int32, Int32, Nullable<Int32>, Nullable<Single>, Nullable<Single>, Single, Single, Boolean)
- CheckPresence_PixelAmount(Image, ShapeRegion, Nullable<CoordinateSystem2D>, HSxColorModel, Int32, Int32, Int32, Nullable<Int32>, Nullable<Single>, Nullable<Single>, Single, Single, Boolean, NullableValue<Single>, NullableRef<Region>, NullableRef<ShapeRegion>, Image)
- CheckPresence_PixelAmount(Image, ShapeRegion, Nullable<CoordinateSystem2D>, HSxColorModel, Int32, Int32, Int32, Nullable<Int32>, Nullable<Single>, Nullable<Single>, Single, Single, Boolean, Single, Region, ShapeRegion, Image)