CreateGrayModel


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 CreateGrayModel(
	inImage: Image,
	outGrayModel: GrayModel,
	/,
	*,
	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
Input value inImage Image Image from which model will be extracted
Input value inTemplateRegion Region | None None Region of the image from which model will be extracted
Input value inReferenceFrame Rectangle2D | None None Exact position of the model object in the image
Input value inMinPyramidLevel int 0 - 12 0 Defines the index of the lowest reduced resolution level used to speed up computations
Input value inMaxPyramidLevel int | None 0 - 12 None Defines the number of reduced resolution levels used to speed up computations
Input value inMinAngle float 0.0 Start of range of possible rotations
Input value inMaxAngle float 0.0 End of range of possible rotations
Input value inAnglePrecision float 0.001 - 10.0 1.0 Defines angular resolution of the matching process
Input value inMinScale float 0.0 - 1.0 Start of range of possible scales
Input value inMaxScale float 0.0 - 1.0 End of range of possible scales
Input value inScalePrecision float 0.001 - 10.0 1.0 Defines scale resolution of the matching process
Output value outGrayModel GrayModel Created model that can be used by LocateMultipleObjects_NCC and LocateMultipleObjects_SAD filters
Output value outGrayModelPoint Point2D | None None The middle point of the created model
Diagnostic input diagTemplatePyramid list[Image] Visualization of the model at different resolution levels

Hardware Acceleration

This operation supports automatic parallelization for multicore and multiprocessor systems.