CreateGrayModel2
Creates a model for NCC or SAD template matching.
Applications:Dynamic creation of models in the runtime environment (normally they are created interactively in Studio).
Syntax
C++
C#
Python
def CreateGrayModel2( inImage: Image, outGrayModel: GrayModel2, /, *, inTemplateRegion: Region | None = None, inReferenceFrame: Rectangle2D | None = None, inMinPyramidLevel: int = 0, inMaxPyramidLevel: int | None = None, inMinAngle: float = 0.0, inMaxAngle: float = 0.0, inAnglePrecision: float = 1.0, inMinScale: float = 1.0, inMaxScale: float = 1.0, inScalePrecision: float = 1.0, outGrayModelPoint: Point2D | None = None ) -> diagTemplatePyramid: list[Image]
Parameters
| Name | Type | Range | Default | Description | |
|---|---|---|---|---|---|
![]() |
inImage | Image | Image from which model will be extracted | ||
![]() |
inTemplateRegion | Region | None | None | Region of the image from which model will be extracted | |
![]() |
inReferenceFrame | Rectangle2D | None | None | Exact position of the model object in the image | |
![]() |
inMinPyramidLevel | int | 0 - 12 | 0 | Defines the index of the lowest reduced resolution level used to speed up computations |
![]() |
inMaxPyramidLevel | int | None | 0 - 12 | None | Defines the number of reduced resolution levels used to speed up computations |
![]() |
inMinAngle | float | 0.0 | Start of range of possible rotations | |
![]() |
inMaxAngle | float | 0.0 | End of range of possible rotations | |
![]() |
inAnglePrecision | float | 0.001 - 10.0 | 1.0 | Defines angular resolution of the matching process |
![]() |
inMinScale | float | 0.2 - 5.0 | 1.0 | Start of range of possible scales |
![]() |
inMaxScale | float | 0.2 - 5.0 | 1.0 | End of range of possible scales |
![]() |
inScalePrecision | float | 0.001 - 10.0 | 1.0 | Defines scale resolution of the matching process |
![]() |
outGrayModel | GrayModel2 | Created model that can be used by LocateMultipleObjects_NCC and LocateMultipleObjects_SAD filters | ||
![]() |
outGrayModelPoint | Point2D | None | None | The middle point of the created model | |
![]() |
diagTemplatePyramid | list[Image] | Visualization of the model at different resolution levels |
Hardware Acceleration
This operation supports automatic parallelization for multicore and multiprocessor systems.



