Runs the template matching algorithm with template image over the searched image. More...
Enumerations | |
enum | VPITemplateMatchingMethod |
Define method to calculate the template matching score. More... | |
Functions | |
VPIStatus | vpiCreateTemplateMatching (uint64_t backends, int32_t imageWidth, int32_t imageHeight, VPIPayload *payload) |
Creates payload for vpiSubmitTemplateMatching. More... | |
VPIStatus | vpiTemplateMatchingSetSourceImage (VPIStream stream, uint64_t backend, VPIPayload payload, VPIImage srcImage) |
Set the source image. More... | |
VPIStatus | vpiTemplateMatchingSetTemplateImage (VPIStream stream, uint64_t backend, VPIPayload payload, VPIImage templImage, VPIImage mask) |
Set the template image. More... | |
VPIStatus | vpiSubmitTemplateMatching (VPIStream stream, uint64_t backend, VPIPayload payload, VPIImage output, VPITemplateMatchingMethod method) |
Runs the template matching algorithm with provided template. More... | |
Runs the template matching algorithm with template image over the searched image.
Refer to Template Matching for more details and usage examples.
#include </opt/nvidia/vpi2/include/vpi/algo/TemplateMatching.h>
Define method to calculate the template matching score.
Enumerator | |
---|---|
VPI_TEMPLATE_MATCHING_NCC | Normalized cross correlation. |
Definition at line 195 of file TemplateMatching.h.
VPIStatus vpiCreateTemplateMatching | ( | uint64_t | backends, |
int32_t | imageWidth, | ||
int32_t | imageHeight, | ||
VPIPayload * | payload | ||
) |
#include </opt/nvidia/vpi2/include/vpi/algo/TemplateMatching.h>
Creates payload for vpiSubmitTemplateMatching.
[in] | backends | VPI backends that are eligible to execute the algorithm.
|
[in] | imageWidth | Source image width. |
[in] | imageHeight | Source image height. |
[out] | payload | Pointer to the payload variable that receives the created handle. |
VPI_ERROR_INVALID_ARGUMENT | payload is NULL. |
VPI_ERROR_INVALID_ARGUMENT | imageWidth and imageHeight outside valid range. |
VPI_ERROR_INVALID_ARGUMENT | backends refers to an invalid backend. |
VPI_ERROR_INVALID_OPERATION | Backend isn't enabled in current context. |
VPI_ERROR_INVALID_OPERATION | Required NPP libraries aren't installed in the system. |
VPI_ERROR_NOT_IMPLEMENTED | Algorithm is not supported by given backend. |
VPI_ERROR_INVALID_CONTEXT | Current context is destroyed. |
VPI_ERROR_OUT_OF_MEMORY | Cannot allocate required resources. |
VPI_SUCCESS | Operation executed successfully. |
VPIStatus vpiTemplateMatchingSetSourceImage | ( | VPIStream | stream, |
uint64_t | backend, | ||
VPIPayload | payload, | ||
VPIImage | srcImage | ||
) |
#include </opt/nvidia/vpi2/include/vpi/algo/TemplateMatching.h>
Set the source image.
[in] | stream | A stream handle where the operation will be queued into.
| ||||||||||||
[in] | backend | Backend that will execute the algorithm.
| ||||||||||||
[in] | payload | Pointer to the payload variable that receives the created handle. | ||||||||||||
[in] | srcImage | Source image where the template image will be searching on.
|
VPI_ERROR_INVALID_ARGUMENT | payload is NULL. |
VPI_ERROR_INVALID_ARGUMENT | srcImage is NULL. |
VPI_ERROR_INVALID_ARGUMENT | srcImage resolution does not match with the one specified in the vpiCreateTemplateMatching. |
VPI_ERROR_INVALID_OPERATION | Backend isn't enabled in current context. |
VPI_ERROR_INVALID_OPERATION | The needed backends aren't enabled in srcImage . |
VPI_ERROR_INVALID_CONTEXT | Current context is destroyed. |
VPI_ERROR_OUT_OF_MEMORY | Cannot allocate required resources. |
VPI_SUCCESS | Operation executed successfully. |
VPIStatus vpiTemplateMatchingSetTemplateImage | ( | VPIStream | stream, |
uint64_t | backend, | ||
VPIPayload | payload, | ||
VPIImage | templImage, | ||
VPIImage | mask | ||
) |
#include </opt/nvidia/vpi2/include/vpi/algo/TemplateMatching.h>
Set the template image.
[in] | stream | A stream handle where the operation will be queued into.
| ||||||||||||
[in] | backend | Backend that will execute the algorithm.
| ||||||||||||
[in] | payload | Pointer to the payload variable that receives the created handle. | ||||||||||||
[in] | templImage | Template image.
| ||||||||||||
[in] | mask | Mask used when calculating the template matching score.
|
VPI_ERROR_INVALID_ARGUMENT | payload is NULL. |
VPI_ERROR_INVALID_ARGUMENT | templImage is NULL. |
VPI_ERROR_INVALID_ARGUMENT | templImage resolution is greater than source image. |
VPI_ERROR_INVALID_OPERATION | Backend isn't enabled in current context. |
VPI_ERROR_INVALID_OPERATION | The needed backends aren't enabled in templImage . |
VPI_ERROR_INVALID_CONTEXT | Current context is destroyed. |
VPI_ERROR_OUT_OF_MEMORY | Cannot allocate required resources. |
VPI_SUCCESS | Operation executed successfully. |
VPIStatus vpiSubmitTemplateMatching | ( | VPIStream | stream, |
uint64_t | backend, | ||
VPIPayload | payload, | ||
VPIImage | output, | ||
VPITemplateMatchingMethod | method | ||
) |
#include </opt/nvidia/vpi2/include/vpi/algo/TemplateMatching.h>
Runs the template matching algorithm with provided template.
[in] | stream | A stream handle where the operation will be queued into.
|
[in] | backend | Backend that will execute the algorithm.
|
[in] | payload | Pointer to the payload variable that receives the created handle. |
[out] | output | Output image where the template matching score is written to.
|
[in] | method | Specify the method when calculating the template matching score. |
VPI_ERROR_INVALID_ARGUMENT | stream is NULL. |
VPI_ERROR_INVALID_ARGUMENT | output is NULL. |
VPI_ERROR_INVALID_ARGUMENT | backend is invalid or unknown. |
VPI_ERROR_INVALID_IMAGE_FORMAT | output image format not supported. |
VPI_ERROR_INVALID_OPERATION | Backend hardware is not available. |
VPI_ERROR_INVALID_OPERATION | The needed backends aren't enabled in stream and output . |
VPI_ERROR_NOT_IMPLEMENTED | Algorithm is not supported by given backend. |
VPI_SUCCESS | Operation executed successfully. |