LocateMultipleObjects_SAD


Finds multiple occurrences of a predefined template on an image by analysing the Square Average Difference between pixel values.

Applications:Almost always inferior to NCC, so rarely used in real applications.

Syntax

C++
C#
Python
 
def LocateMultipleObjects_SAD(
	inImage: Image,
	inGrayModel: GrayModel,
	/,
	*,
	inSearchRegion: ShapeRegion | None = None,
	inSearchRegionAlignment: CoordinateSystem2D | None = None,
	inMinPyramidLevel: int = 0,
	inMaxPyramidLevel: int | None = 3,
	inIgnoreBoundaryObjects: bool = False,
	inMaxDifference: float = 5.0,
	inMinDistance: float = 10.0,
	outAlignedSearchRegion: ShapeRegion | None = None
)
-> (
	outObjects: list[Object2D],
	outPyramidHeight: int,
	diagImagePyramid: list[Image],
	diagMatchPyramid: list[Image],
	diagScores: list[ list[float] ]
)

Parameters

Name Type Range Default Description
Input value inImage Image Image on which model occurrences will be searched
Input value inSearchRegion ShapeRegion | None None Possible centers of the object occurrences
Input value inSearchRegionAlignment CoordinateSystem2D | None None Adjusts the region of interest to the position of the inspected object
Input value inGrayModel GrayModel Model which will be sought
Input value inMinPyramidLevel int 0 - 12 0 Defines the highest resolution level
Input value inMaxPyramidLevel int | None 0 - 12 3 Defines the number of reduced resolution levels that can be used to speed up computations
Input value inIgnoreBoundaryObjects bool False Flag indicating whether objects crossing image boundary should be ignored or not
Input value inMaxDifference float 0.0 - 5.0 Maximum accepted average difference between pixel values
Input value inMinDistance float 0.0 - 10.0 Minimum distance between two matches
Output value outObjects list[Object2D] Found objects
Output value outPyramidHeight int Highest pyramid level used to speed up computations
Output value outAlignedSearchRegion ShapeRegion | None None Transformed input shape region
Diagnostic input diagImagePyramid list[Image] Pyramid of iteratively downsampled input image
Diagnostic input diagMatchPyramid list[Image] Locations found on each pyramid level
Diagnostic input diagScores list[ list[float] ] Scores of found matches on each pyramid level

Hardware Acceleration

This operation supports automatic parallelization for multicore and multiprocessor systems.