CheckPresence_EdgeAmount
Verifies object presence by analysing the amount of edges in the specified region.
Applications:Quick and easy presence verification, e.g. for missing caps, screws, labels.
Syntax
C++
C#
Python
def CheckPresence_EdgeAmount( inImage: Image, inRoi: ShapeRegion, /, *, inRoiAlignment: CoordinateSystem2D | None = None, inEdgeOperator: GradientMaskOperator = GradientMaskOperator.Sobel, inEdgeMeasure: MagnitudeMeasure = MagnitudeMeasure.Sum, inEdgeScale: int = 1, inMinStrength: int = 15, inMinAmount: float = 0.2, inMaxAmount: float = 1.0, outForeground: Region | None = None, outAlignedRoi: ShapeRegion | 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 | |
![]() |
inEdgeOperator | GradientMaskOperator | GradientMaskOperator.Sobel | Selected gradient operator | |
![]() |
inEdgeMeasure | MagnitudeMeasure | MagnitudeMeasure.Sum | Selected method of gradient magnitude computation | |
![]() |
inEdgeScale | int | 1 - 16 | 1 | Scales the resulting gradient magnitudes |
![]() |
inMinStrength | int | 0 - 255 | 15 | Lowest acceptable edge magnitude |
![]() |
inMinAmount | float | 0.0 - 1.0 | 0.2 | 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 from 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) |


