CoreFlow 1.0.0
A modern orchestration and execution runtime
Loading...
Searching...
No Matches
Kernel: Match Template

Enumerations

enum  vx_comp_metric_e {
  VX_COMPARE_HAMMING = VX_ENUM_BASE( VX_ID_KHRONOS, VX_ENUM_COMP_METRIC ) + 0x0 ,
  VX_COMPARE_L1 = VX_ENUM_BASE( VX_ID_KHRONOS, VX_ENUM_COMP_METRIC ) + 0x1 ,
  VX_COMPARE_L2 = VX_ENUM_BASE( VX_ID_KHRONOS, VX_ENUM_COMP_METRIC ) + 0x2 ,
  VX_COMPARE_CCORR = VX_ENUM_BASE( VX_ID_KHRONOS, VX_ENUM_COMP_METRIC ) + 0x3 ,
  VX_COMPARE_L2_NORM = VX_ENUM_BASE( VX_ID_KHRONOS, VX_ENUM_COMP_METRIC ) + 0x4 ,
  VX_COMPARE_CCORR_NORM = VX_ENUM_BASE( VX_ID_KHRONOS, VX_ENUM_COMP_METRIC ) + 0x5
}
 comparing metrics. More...
 

Functions

VX_API_ENTRY vx_node VX_API_CALL vxMatchTemplateNode (vx_graph graph, vx_image src, vx_image templateImage, vx_enum matchingMethod, vx_image output)
 [Graph] The Node Compares an image template against overlapped image regions.
 
VX_API_ENTRY vx_status VX_API_CALL vxuMatchTemplate (vx_context context, vx_image src, vx_image templateImage, vx_enum matchingMethod, vx_image output)
 [Immediate] The function compares an image template against overlapped image regions.
 

Detailed Description

Enumeration Type Documentation

◆ vx_comp_metric_e

#include <vx_types.h>

comparing metrics.

In all the equations below w and h are width and height of the template image respectively. \( R \) is the compare map. \( T \) is the template image. \( I \) is the image on which the template is searched.

Enumerator
VX_COMPARE_HAMMING 

hamming distance \( R(x,y) = \frac{1}{w*h}\sum_{\grave{x},\grave{y}}^{w,h} XOR(T(\grave{x},\grave{y}),I(x+\grave{x},y+\grave{y}))\)

VX_COMPARE_L1 

L1 distance \( R(x,y) = \frac{1}{w*h}\sum_{\grave{x},\grave{y}}^{w,h} ABS(T(\grave{x},\grave{y}) - I(x+\grave{x},y+\grave{y}))\).

VX_COMPARE_L2 

L2 distance normalized by image size \( R(x,y) = \frac{1}{w*h}\sum_{\grave{x},\grave{y}}^{w,h} (T(\grave{x},\grave{y}) - I(x+\grave{x},y+\grave{y}))^2\).

VX_COMPARE_CCORR 

cross correlation distance \( R(x,y) = \frac{1}{w*h}\sum_{\grave{x},\grave{y}}^{w,h} (T(\grave{x},\grave{y})*I(x+\grave{x},y+\grave{y}))\)

VX_COMPARE_L2_NORM 

L2 normalized distance \( R(x,y) = \frac{\sum_{\grave{x},\grave{y}}^{w,h} (T(\grave{x},\grave{y}) - I(x+\grave{x},y+\grave{y}))^2} {\sqrt{\sum_{\grave{x},\grave{y}}^{w,h} T(\grave{x},\grave{y})^2 * I(x+\grave{x},y+\grave{y})^2}} \).

VX_COMPARE_CCORR_NORM 

cross correlation normalized distance \( R(x,y) = \frac{\sum_{\grave{x},\grave{y}}^{w,h} T(\grave{x},\grave{y}) * I(x+\grave{x},y+\grave{y})*2^{15}} {\sqrt{\sum_{\grave{x},\grave{y}}^{w,h} T(\grave{x},\grave{y})^2 * I(x+\grave{x},y+\grave{y})^2}} \)

Function Documentation

◆ vxMatchTemplateNode()

VX_API_ENTRY vx_node VX_API_CALL vxMatchTemplateNode ( vx_graph graph,
vx_image src,
vx_image templateImage,
vx_enum matchingMethod,
vx_image output )

#include <vx_nodes.h>

[Graph] The Node Compares an image template against overlapped image regions.

The detailed equation to the matching can be found in vx_comp_metric_e. The output of the template matching node is a comparison map as described in vx_comp_metric_e. The Node have a limitation on the template image size (width*height). It should not be larger then 65535. If the valid region of the template image is smaller than the entire template image, the result in the destination image is implementation-dependent.

Parameters
[in]graphThe reference to the graph.
[in]srcThe input image of type VX_DF_IMAGE_U8.
[in]templateImageSearched template of type VX_DF_IMAGE_U8.
[in]matchingMethodattribute specifying the comparison method vx_comp_metric_e. This function support only VX_COMPARE_CCORR_NORM and VX_COMPARE_L2.
[out]outputMap of comparison results. The output is an image of type VX_DF_IMAGE_S16
Returns
vx_node.
Return values
vx_nodeA node reference. Any possible errors preventing a successful creation should be checked using vxGetStatus

◆ vxuMatchTemplate()

VX_API_ENTRY vx_status VX_API_CALL vxuMatchTemplate ( vx_context context,
vx_image src,
vx_image templateImage,
vx_enum matchingMethod,
vx_image output )

#include <vxu.h>

[Immediate] The function compares an image template against overlapped image regions.

The detailed equation to the matching can be found in vx_comp_metric_e. The output of the template matching node is a comparison map as described in vx_comp_metric_e. The Node have a limitation on the template image size (width*height). It should not be larger then 65535. If the valid region of the template image is smaller than the entire template image, the result in the destination image is implementation-dependent.

Parameters
[in]contextThe reference to the overall context.
[in]srcThe input image of type VX_DF_IMAGE_U8.
[in]templateImageSearched template of type VX_DF_IMAGE_U8.
[in]matchingMethodattribute specifying the comparison method vx_comp_metric_e. This function support only VX_COMPARE_CCORR_NORM and VX_COMPARE_L2.
[out]outputMap of comparison results. The output is an image of type VX_DF_IMAGE_S16
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSSuccess
*An error occurred. See vx_status_e.