vpi.templateMatching

vpi.templateMatching(src: vpi.Image, templ: vpi.Image, *, backend: vpi.Backend = vpi.Backend.DEFAULT, mask: vpi.Image = None, out: vpi.Image = None, stream: vpi.Stream = None, method: vpi.TemplateMatchingMethod = 0) vpi.Image

Runs template matching on two images.

Runs template matching on source image and template image with optional mask image and output the matching score.

See also

Refer to the algorithm explanation for more details and usage examples.

Parameters
  • src (vpi.Image) – Source image.

  • templ (vpi.Image) – Template image

  • mask (vpi.Image, optional) – Mask image that used together with template. Should be same dimension of template image.

  • out (vpi.Image, optional) – Output image where the matching score will be written to.

  • backend (vpi.Backend, optional) – The backend to be used by the algorithm.

  • stream (vpi.Stream, optional) – The stream to be used by the algorithm.

Returns

The matching score between source image and template image.

Return type

vpi.Image

Caution

Restrictions to several arguments may apply. Check the C API references of the submit function and the group concepts for more details.