Using the Auto-Select Tool
This section describes how to use the Auto-select tool to locate good candidate regions in images for use as pattern or model training images.
- Create a ccAutoSelectParams and configure it to specify the model size, number of candidates, and sub-sampling factor.
- Create and configure a run-time search parameter object for the search method you want to use (CNLSearch or PatMax).
- Create a vector of ccAutoSelectResults to hold the results.
- Call the cfAutoSelect() global function, supplying an input image, the ccAutoSelectParams, the ccCnlSearchRunParams (or ccPMAlignRunParams), and the vector of ccAutoSelectResults.
- Extract the results.
ccAutoSelectParams params;
params.sample(1);
params.maxNumResult(1);
params.modelSize(ccIPair(128, 128));
// Construct the run-time parameters structure for CnlSearch
//
ccCnlSearchRunParams
(cnlsParamsccCnlSearchDefs::eNormalizedCnlpas);
cmStd vector<ccAutoSelectResult> results;
cfAutoSelect(source, params, cnlsParams, results);
cogOut << "Result coordinates: ("
<< results[0].location().x()
<< ", " << results[0].location().y() << ")"
<< cmStd endl;