mirror of
				https://github.com/bspeice/libcvautomation
				synced 2025-11-04 02:10:35 -05:00 
			
		
		
		
	Document and implement the "tolerance" setting better
This commit is contained in:
		@ -64,6 +64,12 @@ void matchSubImage_a_location_center ( const char *rootImageFileName, cvautomati
 | 
			
		||||
 | 
			
		||||
/** \page libcv_search_methods Libcv Search Methods
 | 
			
		||||
This page describes the methods libcv uses to search for a sub image in a root image.
 | 
			
		||||
\section tolerance Tolerance Values
 | 
			
		||||
Tolerance values are used to control how strict each of the following search methods are. Acceptable values are from \c INT_MIN to \c INT_MAX.
 | 
			
		||||
 | 
			
		||||
Additionally, each of the reference programs - \c cva-input and \c 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.
 | 
			
		||||
\note The formula for calculating the sane tolerance is: \f$ T(x) = (10^{\frac{\log{INT\_MAX}}{\lambda}})^x \f$ where \f$ \lambda \f$ 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 \c INT_MAX. The formula used does mean that we will never be able to generate values lower than 0.
 | 
			
		||||
\warning The "sane-tolerance" option doesn't know which search method you are using - Thus while 1 is an incredibly strict search for \ref SQDIFF and \ref SQDIFF_NORMED, it is fairly loose search for \ref CCORR, \ref CCORR_NORMED, \ref CCOEFF, and \ref CCOEFF_NORMED
 | 
			
		||||
\section SQDIFF Squared Difference
 | 
			
		||||
\code #define CV_TM_SQDIFF	0 \endcode
 | 
			
		||||
Squared Difference is the default search method used by \c libcvautomation, as well as \c cva-match and \c cva-input.
 | 
			
		||||
 | 
			
		||||
@ -262,14 +262,23 @@ typedef struct {
 | 
			
		||||
 * <li>First things first, run through the testing wrapper to make sure that everything is O.K.
 | 
			
		||||
 * <li>If you need to, some things you can do to tune the application test are as follows:
 | 
			
		||||
 * 		<ul>
 | 
			
		||||
 * 		<li>Set the \c SEARCH_METHOD
 | 
			
		||||
 * 			<ul>
 | 
			
		||||
 * 			<li>This value adjusts how libcvautomation searches for sub-images. See \ref libcv_search_methods for more information on accepted values, and how each works.
 | 
			
		||||
 * 			</ul>
 | 
			
		||||
 * 		<li>Set the \c TOLERANCE
 | 
			
		||||
 * 			<ul>
 | 
			
		||||
 * 			<li>This value adjusts how strict libcvautomation is when trying to find a sub-image. See \ref libcv_search_methods for more information on how to control how libcvautomation searches for images.
 | 
			
		||||
 * 			</ul>
 | 
			
		||||
 * 		<li>Set the \c CENTER
 | 
			
		||||
 * 		<li>Set \c USE_SANE_TOLERANCE
 | 
			
		||||
 * 			<ul>
 | 
			
		||||
 * 			<li>By default, the wrapper will use the center of an image as opposed to the upper-left corner to click on. To change this behavior, set: \code CENTER="" \endcode
 | 
			
		||||
 * 			<li>To set the behavior back to using center-based matching, set: \code CENTER="c" \endcode
 | 
			
		||||
 * 			<li>This value implements a more sane way of setting the tolerance value - Where normally the tolerance ranges from \c INT_MIN to \c INT_MAX, the sane tolerance accepts values of 1 - 100 (\f$ 1 \approx 0 \f$, and \f$ 100 \approx \c INT_MAX \f$)
 | 
			
		||||
 * 			<li>To enable sane tolerance, set: \code USE_SANE_TOLERANCE="<any_value>" \endcode
 | 
			
		||||
 * 			<li>To disable sane tolerance (the default) set: \code USE_SANE_TOLERANCE="" \endcode
 | 
			
		||||
 * 		<li>Set \c USE_CENTER
 | 
			
		||||
 * 			<ul>
 | 
			
		||||
 * 			<li>By default, the wrapper will use the center of an image as opposed to the upper-left corner to click on. To disable this behavior, set: \code USE_CENTER="" \endcode
 | 
			
		||||
 * 			<li>To set the behavior back to using center-based matching, set: \code USE_CENTER="<any_value>" \endcode
 | 
			
		||||
 * 			</ul>
 | 
			
		||||
 * 		<li>Set the \c OUTFILE and \c ERRFILE
 | 
			
		||||
 * 			<ul>
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user