LocateSinglePointPattern


Finds an occurrence of the pattern in the input points.

Applications:Can be used to find an entire object after finding its characteristic points with tools such as Template Matching or DL_LocatePoints.

Syntax

C++
C#
Python
 
def LocateSinglePointPattern(
	inPoints: list[Point2D],
	inPattern: list[Point2D],
	/,
	*,
	inPointLabels: list[int] | None = None,
	inPatternLabels: list[int] | None = None,
	inReferenceFrame: Rectangle2D | None = None,
	inAllowRotation: bool = True,
	inMinAngle: float = -180.0,
	inMaxAngle: float = 180.0,
	inAllowScale: bool = False,
	inMinScale: float = 0.8,
	inMaxScale: float = 1.25,
	inTilingFactor: float = 0.2,
	inMinInitialScore: float = 0.75,
	inMaxDeviation: float = 5.0,
	inMinScore: float = 0.75
)
-> (
	outObject: Rectangle2D | None,
	outAlignedPattern: list[Point2D] | None,
	outAlignment: CoordinateSystem2D | None,
	outPatternSkeleton: list[Segment2D] | None
)

Parameters

Name Type Range Default Description
Input value inPoints list[Point2D] Input points
Input value inPointLabels list[int] | None None Categories that the input points belong to
Input value inPattern list[Point2D] Point pattern to be found
Input value inPatternLabels list[int] | None None Categories that the pattern points belong to
Input value inReferenceFrame Rectangle2D | None None Exact position of the model object associated with the pattern in the image
Input value inAllowRotation bool True Flag indicating whether rotation is allowed as a part of output alignment
Input value inMinAngle float -180.0 Start of range of possible rotations
Input value inMaxAngle float 180.0 End of range of possible rotations
Input value inAllowScale bool False Flag indicating whether scale is allowed as a part of output alignment
Input value inMinScale float 0.0 - 0.8 Start of range of possible scales
Input value inMaxScale float 0.0 - 1.25 End of range of possible scales
Input value inTilingFactor float 0.000001 - 1.0 0.2 Defines relative size of the square tile on the plane during initial detection
Input value inMinInitialScore float 0.0 - 1.0 0.75 The minimum proportion of points correctly matched during initial detection
Input value inMaxDeviation float 0.0 - 5.0 Maximal distance between two points considered matched
Input value inMinScore float 0.0 - 1.0 0.75 The minimum proportion of points correctly matched
Output value outObject Rectangle2D | None Bounding rectangle of the found pattern occurrence
Output value outAlignedPattern list[Point2D] | None The aligned input pattern points
Output value outAlignment CoordinateSystem2D | None The transform that align the input pattern to the input points
Output value outPatternSkeleton list[Segment2D] | None The skeleton of the aligned input pattern points