libcvautomation
2.0
|
This page describes the methods libcv uses to search for a sub image in a root image.
Tolerance values are used to control how strict each of the following search methods are. Acceptable values are from INT_MIN
to INT_MAX
.
Additionally, each of the reference programs - cva-input
and cva-match
- have a "sane tolerance" built in. This is accessed by the "-o" switch, and allows you to specify a tolerance on scale of 1-100, where 1 is incredibly strict, and 100 is incredibly loose.
INT_MAX
. The formula used does mean that we will never be able to generate values lower than 0. #define CV_TM_SQDIFF 0
Squared Difference is the default search method used by libcvautomation
, as well as cva-match
and cva-input
.
Formula: \(R(x,y) = \sum_{x',y'} (T(x',y') - I(x + x', y+y'))^2 \)
#define CV_TM_SQDIFF_NORMED 1
This is a normalized version of the Squared Difference search method.
Formula: \( R(x,y) = \frac{\sum_{x',y'}(T(x',y') - I(x + x', y + y'))^2}{ \sqrt{\sum_{x',y'}T(x',y')^2 \cdot \sum_{x',y'}I(x + x', y + y')^2}} \)
#define CV_TM_CCORR 2
This is the Cross Correlation search method.
Formula: \( R(x,y)= \sum _{x',y'} (T(x',y') \cdot I(x+x',y+y')) \)
#define CV_TM_CCORR_NORMED 3
This is the normalized version of the Cross Correlation search method.
Formula: \( R(x,y)= \frac{\sum_{x',y'} (T(x',y') \cdot I'(x+x',y+y'))}{\sqrt{\sum_{x',y'}T(x',y')^2 \cdot \sum_{x',y'} I(x+x',y+y')^2}} \)
#define CV_TM_CCOEFF 4
This is the Correlation Coefficient search method.
Formula: \( R(x,y)= \sum _{x',y'} (T'(x',y') \cdot I(x+x',y+y')) \) where: \( \begin{array}{l} T'(x',y')=T(x',y') - 1/(w \cdot h) \cdot \sum _{x'',y''} T(x'',y'') \\ I'(x+x',y+y')=I(x+x',y+y') - 1/(w \cdot h) \cdot \sum _{x'',y''} I(x+x'',y+y'') \end{array} \)
#define CV_TM_CCOEFF_NORMED 5
This is the normalized version of the Correlation Coefficient search method.
Formula: \( R(x,y)= \frac{ \sum_{x',y'} (T'(x',y') \cdot I'(x+x',y+y')) }{ \sqrt{\sum_{x',y'}T'(x',y')^2 \cdot \sum_{x',y'} I'(x+x',y+y')^2} } \)