<divclass="textblock"><p>This page describes the methods libcv uses to search for a sub image in a root image. </p>
<h2><aclass="anchor"id="tolerance"></a>
Tolerance Values</h2>
<p>Tolerance values are used to control how strict each of the following search methods are. Acceptable values are from <code>INT_MIN</code> to <code>INT_MAX</code>.</p>
<p>Additionally, each of the reference programs - <code>cva-input</code> and <code>cva-match</code> - 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. </p>
<dlclass="note"><dt><b>Note:</b></dt><dd>The formula for calculating the sane tolerance is: \( T(x) = (10^{\frac{\log{INT\_MAX}}{\lambda}})^x \) where \( \lambda \) is the highest tolerance value (in our case, 100). Finally, we have to round down a little bit to ensure that we don't accidentally generate a value higher than <code>INT_MAX</code>. The formula used does mean that we will never be able to generate values lower than 0. </dd></dl>
<dlclass="warning"><dt><b>Warning:</b></dt><dd>The "sane-tolerance" option doesn't know which search method you are using - Thus while 1 is an incredibly strict search for <aclass="el"href="libcvautomation_search_methods.html#SQDIFF">Squared Difference</a> and <aclass="el"href="libcvautomation_search_methods.html#SQDIFF_NORMED">Squared Difference (Normalized)</a>, it is fairly loose search for <aclass="el"href="libcvautomation_search_methods.html#CCORR">Cross Correlation</a>, <aclass="el"href="libcvautomation_search_methods.html#CCORR_NORMED">Cross Correlation (Normalized)</a>, <aclass="el"href="libcvautomation_search_methods.html#CCOEFF">Correlation Coefficient</a>, and <aclass="el"href="libcvautomation_search_methods.html#CCOEFF_NORMED">Correlation Coefficient (Normalized)</a></dd></dl>
</pre></div><p> Squared Difference is the default search method used by <code>libcvautomation</code>, as well as <code>cva-match</code> and <code>cva-input</code>. </p>
<dlclass="user"><dt><b>For this method, setting a low tolerance value results in a more strict match.</b></dt><dd></dd></dl>
</pre></div><p> This is a normalized version of the <aclass="el"href="libcvautomation_search_methods.html#SQDIFF">Squared Difference</a> search method. </p>
</pre></div><p> This is the normalized version of the <aclass="el"href="libcvautomation_search_methods.html#CCORR">Cross Correlation</a> search method. </p>
</pre></div><p> This is the normalized version of the <aclass="el"href="libcvautomation_search_methods.html#CCOEFF">Correlation Coefficient</a> search method. </p>