CheckPresence_PixelAmount
Verifies object presence by analysing the amount of pixels that meet the specified criteria.
Applications:Quick and easy presence verification, e.g. for missing caps, screws, labels.
Syntax
C++
C#
Python
def CheckPresence_PixelAmount( inImage: Image, inRoi: ShapeRegion, /, *, inRoiAlignment: CoordinateSystem2D | None = None, inColorModel: HSxColorModel = HSxColorModel.HSV, inBeginHue: int = 0, inEndHue: int = 255, inMinSaturation: int = 128, inMaxSaturation: int | None = None, inMinBrightness: float | None = 128.0, inMaxBrightness: float | None = None, inMinAmount: float = 0.5, inMaxAmount: float = 1.0, outForeground: Region | None = None, outAlignedRoi: ShapeRegion | None = None, diagHsxImage: Image | None = None ) -> ( outIsPresent: bool, outAmount: float )
Parameters
| Name | Type | Range | Default | Description | |
|---|---|---|---|---|---|
![]() |
inImage | Image | Input image | ||
![]() |
inRoi | ShapeRegion | Location at which object presence is being checked | ||
![]() |
inRoiAlignment | CoordinateSystem2D | None | None | Adjusts the region of interest to the position of the inspected object | |
![]() |
inColorModel | HSxColorModel | HSxColorModel.HSV | Selected color model | |
![]() |
inBeginHue | int | 0 - 255 | 0 | Begin of the range of acceptable hue |
![]() |
inEndHue | int | 0 - 255 | 255 | End of the range of acceptable hue |
![]() |
inMinSaturation | int | 0 - 255 | 128 | Lowest acceptable saturation |
![]() |
inMaxSaturation | int | None | 0 - 255 | None | Highest acceptable saturation |
![]() |
inMinBrightness | float | None | 0.0 - ![]() |
128.0 | Lowest acceptable brightness |
![]() |
inMaxBrightness | float | None | 0.0 - ![]() |
None | Highest acceptable brightness |
![]() |
inMinAmount | float | 0.0 - 1.0 | 0.5 | Lowest acceptable fraction of pixels meeting the criteria |
![]() |
inMaxAmount | float | 0.0 - 1.0 | 1.0 | Highest acceptable fraction of pixels meeting the criteria |
![]() |
outIsPresent | bool | Flag indicating whether the object is present or not | ||
![]() |
outAmount | float | Fraction of pixels meeting the criteria | ||
![]() |
outForeground | Region | None | None | Region of pixels meeting the criteria | |
![]() |
outAlignedRoi | ShapeRegion | None | None | Input ROI after transformation (in the image coordinates) | |
![]() |
diagHsxImage | Image | None | None | Image represented in chosen color model |




