2012-07-18 14:11:30 -04:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" >
< head >
< meta http-equiv = "Content-Type" content = "text/xhtml;charset=UTF-8" / >
< meta http-equiv = "X-UA-Compatible" content = "IE=9" / >
2012-07-17 16:07:18 -04:00
< title > libcvautomation: Libcv Search Methods< / title >
2012-07-18 14:11:30 -04:00
< link href = "tabs.css" rel = "stylesheet" type = "text/css" / >
< link href = "doxygen.css" rel = "stylesheet" type = "text/css" / >
< link href = "search/search.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "jquery.js" > < / script >
< script type = "text/javascript" src = "search/search.js" > < / script >
< script type = "text/javascript" >
$(document).ready(function() { searchBox.OnSelectItem(0); });
< / script >
< script type = "text/x-mathjax-config" >
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
< / script > < script src = "http://www.mathjax.org/mathjax/MathJax.js" > < / script >
< / head >
< body >
< div id = "top" > <!-- do not remove this div! -->
< div id = "titlearea" >
< table cellspacing = "0" cellpadding = "0" >
< tbody >
< tr style = "height: 56px;" >
< td style = "padding-left: 0.5em;" >
< div id = "projectname" > libcvautomation
2012-10-11 17:43:53 -04:00
  < span id = "projectnumber" > 2.0< / span >
2012-07-18 14:11:30 -04:00
< / div >
< / td >
< / tr >
< / tbody >
< / table >
< / div >
<!-- Generated by Doxygen 1.7.6.1 -->
< script type = "text/javascript" >
var searchBox = new SearchBox("searchBox", "search",false,'Search');
< / script >
< div id = "navrow1" class = "tabs" >
< ul class = "tablist" >
< li > < a href = "index.html" > < span > Main  Page< / span > < / a > < / li >
< li class = "current" > < a href = "pages.html" > < span > Related  Pages< / span > < / a > < / li >
2012-10-11 17:43:53 -04:00
< li > < a href = "namespaces.html" > < span > Namespaces< / span > < / a > < / li >
2012-07-18 14:11:30 -04:00
< li > < a href = "annotated.html" > < span > Classes< / span > < / a > < / li >
< li > < a href = "files.html" > < span > Files< / span > < / a > < / li >
< li >
< div id = "MSearchBox" class = "MSearchBoxInactive" >
< span class = "left" >
< img id = "MSearchSelect" src = "search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
< input type = "text" id = "MSearchField" value = "Search" accesskey = "S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
< / span > < span class = "right" >
< a id = "MSearchClose" href = "javascript:searchBox.CloseResultsWindow()" > < img id = "MSearchCloseImg" border = "0" src = "search/close.png" alt = "" / > < / a >
< / span >
< / div >
< / li >
< / ul >
< / div >
< / div >
< div class = "header" >
< div class = "headertitle" >
< div class = "title" > Libcv Search Methods < / div > < / div >
< / div > <!-- header -->
< div class = "contents" >
< div class = "textblock" > < p > This page describes the methods libcv uses to search for a sub image in a root image. < / p >
< h2 > < a class = "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 >
< dl class = "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 >
2012-07-23 13:00:32 -04:00
< dl class = "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 < a class = "el" href = "libcvautomation_search_methods.html#SQDIFF" > Squared Difference< / a > and < a class = "el" href = "libcvautomation_search_methods.html#SQDIFF_NORMED" > Squared Difference (Normalized)< / a > , it is fairly loose search for < a class = "el" href = "libcvautomation_search_methods.html#CCORR" > Cross Correlation< / a > , < a class = "el" href = "libcvautomation_search_methods.html#CCORR_NORMED" > Cross Correlation (Normalized)< / a > , < a class = "el" href = "libcvautomation_search_methods.html#CCOEFF" > Correlation Coefficient< / a > , and < a class = "el" href = "libcvautomation_search_methods.html#CCOEFF_NORMED" > Correlation Coefficient (Normalized)< / a > < / dd > < / dl >
2012-07-18 14:11:30 -04:00
< h2 > < a class = "anchor" id = "SQDIFF" > < / a >
Squared Difference< / h2 >
2012-07-17 16:07:18 -04:00
< div class = "fragment" > < pre class = "fragment" > < span class = "preprocessor" > #define CV_TM_SQDIFF 0 < / span >
2012-07-18 14:11:30 -04:00
< / 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 >
< dl class = "user" > < dt > < b > For this method, setting a low tolerance value results in a more strict match.< / b > < / dt > < dd > < / dd > < / dl >
< p > Formula: \(R(x,y) = \sum_{x' ,y' } (T(x' ,y' ) - I(x + x' , y+y' ))^2 \)< / p >
< h2 > < a class = "anchor" id = "SQDIFF_NORMED" > < / a >
Squared Difference (Normalized)< / h2 >
2012-07-17 16:07:18 -04:00
< div class = "fragment" > < pre class = "fragment" > < span class = "preprocessor" > #define CV_TM_SQDIFF_NORMED 1 < / span >
2012-07-23 13:00:32 -04:00
< / pre > < / div > < p > This is a normalized version of the < a class = "el" href = "libcvautomation_search_methods.html#SQDIFF" > Squared Difference< / a > search method. < / p >
2012-07-18 14:11:30 -04:00
< dl class = "user" > < dt > < b > For this method, setting a low tolerance value results in a more strict match.< / b > < / dt > < dd > < / dd > < / dl >
< p > 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}} \)< / p >
< h2 > < a class = "anchor" id = "CCORR" > < / a >
Cross Correlation< / h2 >
2012-07-17 16:07:18 -04:00
< div class = "fragment" > < pre class = "fragment" > < span class = "preprocessor" > #define CV_TM_CCORR 2 < / span >
2012-07-18 14:11:30 -04:00
< / pre > < / div > < p > This is the Cross Correlation search method. < / p >
< dl class = "user" > < dt > < b > For this method, setting a high tolerance value results in a more strict match.< / b > < / dt > < dd > < / dd > < / dl >
< p > Formula: \( R(x,y)= \sum _{x' ,y' } (T(x' ,y' ) \cdot I(x+x' ,y+y' )) \)< / p >
< h2 > < a class = "anchor" id = "CCORR_NORMED" > < / a >
Cross Correlation (Normalized)< / h2 >
2012-07-17 16:07:18 -04:00
< div class = "fragment" > < pre class = "fragment" > < span class = "preprocessor" > #define CV_TM_CCORR_NORMED 3 < / span >
2012-07-23 13:00:32 -04:00
< / pre > < / div > < p > This is the normalized version of the < a class = "el" href = "libcvautomation_search_methods.html#CCORR" > Cross Correlation< / a > search method. < / p >
2012-07-18 14:11:30 -04:00
< dl class = "user" > < dt > < b > For this method, setting a high tolerance value results in a more strict match.< / b > < / dt > < dd > < / dd > < / dl >
< p > 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}} \)< / p >
< h2 > < a class = "anchor" id = "CCOEFF" > < / a >
Correlation Coefficient< / h2 >
2012-07-17 16:07:18 -04:00
< div class = "fragment" > < pre class = "fragment" > < span class = "preprocessor" > #define CV_TM_CCOEFF 4 < / span >
2012-07-18 14:11:30 -04:00
< / pre > < / div > < p > This is the Correlation Coefficient search method. < / p >
< dl class = "user" > < dt > < b > For this method, setting a high tolerance value results in a more strict match.< / b > < / dt > < dd > < / dd > < / dl >
< p > 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} \)< / p >
< h2 > < a class = "anchor" id = "CCOEFF_NORMED" > < / a >
Correlation Coefficient (Normalized)< / h2 >
2012-07-17 16:07:18 -04:00
< div class = "fragment" > < pre class = "fragment" > < span class = "preprocessor" > #define CV_TM_CCOEFF_NORMED 5 < / span >
2012-07-23 13:00:32 -04:00
< / pre > < / div > < p > This is the normalized version of the < a class = "el" href = "libcvautomation_search_methods.html#CCOEFF" > Correlation Coefficient< / a > search method. < / p >
2012-07-18 14:11:30 -04:00
< dl class = "user" > < dt > < b > For this method, setting a high tolerance value results in a more strict match.< / b > < / dt > < dd > < / dd > < / dl >
< p > 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} } \) < / p >
< / div > < / div > <!-- contents -->
<!-- window showing the filter options -->
< div id = "MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
2012-10-11 17:43:53 -04:00
< a class = "SelectItem" href = "javascript:void(0)" onclick = "searchBox.OnSelectItem(0)" > < span class = "SelectionMark" >   < / span > All< / a > < a class = "SelectItem" href = "javascript:void(0)" onclick = "searchBox.OnSelectItem(1)" > < span class = "SelectionMark" >   < / span > Classes< / a > < a class = "SelectItem" href = "javascript:void(0)" onclick = "searchBox.OnSelectItem(2)" > < span class = "SelectionMark" >   < / span > Namespaces< / a > < a class = "SelectItem" href = "javascript:void(0)" onclick = "searchBox.OnSelectItem(3)" > < span class = "SelectionMark" >   < / span > Files< / a > < a class = "SelectItem" href = "javascript:void(0)" onclick = "searchBox.OnSelectItem(4)" > < span class = "SelectionMark" >   < / span > Functions< / a > < a class = "SelectItem" href = "javascript:void(0)" onclick = "searchBox.OnSelectItem(5)" > < span class = "SelectionMark" >   < / span > Defines< / a > < / div >
2012-07-18 14:11:30 -04:00
<!-- iframe showing the search results (closed by default) -->
< div id = "MSearchResultsWindow" >
< iframe src = "javascript:void(0)" frameborder = "0"
name="MSearchResults" id="MSearchResults">
< / iframe >
< / div >
< hr class = "footer" / > < address class = "footer" > < small >
2012-10-11 17:43:53 -04:00
Generated on Thu Oct 11 2012 17:42:49 for libcvautomation by   < a href = "http://www.doxygen.org/index.html" >
2012-07-18 14:11:30 -04:00
< img class = "footer" src = "doxygen.png" alt = "doxygen" / >
< / a > 1.7.6.1
< / small > < / address >
2012-07-17 16:07:18 -04:00
< / body >
< / html >