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 | |
|---|---|---|---|---|---|
![]() |
inImage | Image | Image on which model occurrences will be searched | ||
![]() |
inSearchRegion | ShapeRegion | None | None | Possible centers of the object occurrences | |
![]() |
inSearchRegionAlignment | CoordinateSystem2D | None | None | Adjusts the region of interest to the position of the inspected object | |
![]() |
inGrayModel | GrayModel | Model which will be sought | ||
![]() |
inMinPyramidLevel | int | 0 - 12 | 0 | Defines the highest resolution level |
![]() |
inMaxPyramidLevel | int | None | 0 - 12 | 3 | Defines the number of reduced resolution levels that can be used to speed up computations |
![]() |
inIgnoreBoundaryObjects | bool | False | Flag indicating whether objects crossing image boundary should be ignored or not | |
![]() |
inMaxDifference | float | 0.0 - ![]() |
5.0 | Maximum accepted average difference between pixel values |
![]() |
inMinDistance | float | 0.0 - ![]() |
10.0 | Minimum distance between two matches |
![]() |
outObjects | list[Object2D] | Found objects | ||
![]() |
outPyramidHeight | int | Highest pyramid level used to speed up computations | ||
![]() |
outAlignedSearchRegion | ShapeRegion | None | None | Transformed input shape region | |
![]() |
diagImagePyramid | list[Image] | Pyramid of iteratively downsampled input image | ||
![]() |
diagMatchPyramid | list[Image] | Locations found on each pyramid level | ||
![]() |
diagScores | list[ list[float] ] | Scores of found matches on each pyramid level |
Hardware Acceleration
This operation supports automatic parallelization for multicore and multiprocessor systems.




