TemplateMatching#

Functions#

NVCVStatus pvaTemplateMatchingCreate(NVCVOperatorHandle *handle, NVCVTensorRequirements const *const inImageTensorRequirements, NVCVTensorRequirements const *const inTemplateTensorRequirements, NVCVTensorRequirements const *const outTensorRequirements)

Constructs and an instance of the TemplateMatching operator.

NVCVStatus pvaTemplateMatchingSubmit(NVCVOperatorHandle handle, cupvaStream_t stream, NVCVTensorHandle inImage, NVCVTensorHandle inTemplate, NVCVTensorHandle out)

Executes the TemplateMatching operation on tensors.

Functions#

NVCVStatus pvaTemplateMatchingCreate(
NVCVOperatorHandle *handle,
NVCVTensorRequirements const *const inImageTensorRequirements,
NVCVTensorRequirements const *const inTemplateTensorRequirements,
NVCVTensorRequirements const *const outTensorRequirements,
)#

Constructs and an instance of the TemplateMatching operator.

Limitations:

Input image tensor: If the input image tensor has a resolution W × H, then W >= 94 and H >= 94. Data Layout: [HWC] Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

32bit Float

No

64bit Float

No

Input template tensor: If the template image tensor has a resolution w × h, then 0 < w <= 31 and 0 < h <= 31. Current implementation is optimized for template sizes smaller than 20 x 20. Data Layout: [HWC] Channels: [1]

Data Type

Allowed

8bit Unsigned

Yes

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

32bit Float

No

64bit Float

No

Output tensor: The output tensor is the normalized cross correlation (score) for every possible location of the template inside the input image tensor. If the input image tensor has a resolution W × H and input template tensor has a resolution w × h, then the output image has a resolution (W - w + 1) × (H - h + 1). Data Layout: [HWC] Channels: [1]

Data Type

Allowed

8bit Unsigned

No

8bit Signed

No

16bit Unsigned

No

16bit Signed

No

32bit Unsigned

No

32bit Signed

No

32bit Float

Yes

64bit Float

No

Input/Output dependency

Property

Input == Output

Data Layout

Yes

Data Type

No

Number

Yes

Channels

Yes

Width

No

Height

No

Parameters:
  • handle[out] Where the operator instance handle will be written to.

    • Must not be NULL.

  • inImageTensorRequirements[in] Pointer to the NVCVTensorRequirements structure for input image tensor which contains Tensor rank, shape, layout and data type information.

  • inTemplateTensorRequirements[in] Pointer to the NVCVTensorRequirements structure for input template tensor which contains Tensor rank, shape, layout and data type information.

  • outTensorRequirements[in] Pointer to the NVCVTensorRequirements structure for output tensor which contains Tensor rank, shape, layout and data type information.

Return values:
  • NVCV_ERROR_INVALID_ARGUMENT – Handle is null.

  • NVCV_ERROR_OUT_OF_MEMORY – Not enough memory to create the operator.

  • NVCV_SUCCESS – Operation executed successfully.

NVCVStatus pvaTemplateMatchingSubmit(
NVCVOperatorHandle handle,
cupvaStream_t stream,
NVCVTensorHandle inImage,
NVCVTensorHandle inTemplate,
NVCVTensorHandle out,
)#

Executes the TemplateMatching operation on tensors.

Parameters:
  • handle[in] Handle to the operator.

    • Must not be NULL.

  • stream[in] Handle to a valid CUPVA stream.

  • inImage[in] Input image tensor handle.

  • inTemplate[in] Input template tensor handle.

  • out[out] Output tensor handle.

Return values:
  • NVCV_ERROR_INVALID_ARGUMENT – Some parameter is outside valid range.

  • NVCV_ERROR_INTERNAL – Internal error in the operator, invalid types passed in.

  • NVCV_SUCCESS – Operation executed successfully.