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
Input value inImage Image Input image
Input value inRoi ShapeRegion Location at which object presence is being checked
Input value inRoiAlignment CoordinateSystem2D | None None Adjusts the region of interest to the position of the inspected object
Input value inEdgeOperator GradientMaskOperator GradientMaskOperator.Sobel Selected gradient operator
Input value inEdgeMeasure MagnitudeMeasure MagnitudeMeasure.Sum Selected method of gradient magnitude computation
Input value inEdgeScale int 1 - 16 1 Scales the resulting gradient magnitudes
Input value inMinStrength int 0 - 255 15 Lowest acceptable edge magnitude
Input value inMinAmount float 0.0 - 1.0 0.2 Lowest acceptable fraction of pixels meeting the criteria
Input value inMaxAmount float 0.0 - 1.0 1.0 Highest acceptable fraction of pixels meeting the criteria
Output value outIsPresent bool Flag indicating whether the object is present or not
Output value outAmount float Fraction of pixels from meeting the criteria
Output value outForeground Region | None None Region of pixels meeting the criteria
Output value outAlignedRoi ShapeRegion | None None Input ROI after transformation (in the image coordinates)