34 std::cout <<
"based on Pan-o-matic by Anael Orlinski" << std::endl;
40 std::cout << std::endl
41 <<
"Basic usage: " << std::endl
42 <<
" cpfind -o output_project project.pto" << std::endl
43 <<
" cpfind -k i0 -k i1 ... -k in project.pto" << std::endl
44 <<
" cpfind --kall project.pto" << std::endl
45 << std::endl <<
"The input project file is required." << std::endl
46 << std::endl <<
"General options" << std::endl
47 <<
" -q|--quiet Do not output progress" << std::endl
48 <<
" -v|--verbose Verbose output" << std::endl
49 <<
" -h|--help Shows this help screen" << std::endl
50 <<
" --version Prints the version number and exits then" << std::endl
51 <<
" -o|--output=<string> Sets the filename of the output file" << std::endl
52 <<
" (default: default.pto)" << std::endl
53 << std::endl <<
"Matching strategy (these options are mutually exclusive)" << std::endl
54 <<
" --linearmatch Enable linear images matching" << std::endl
55 <<
" Can be fine tuned with" << std::endl
56 <<
" --linearmatchlen=<int> Number of images to match (default: 1)" << std::endl
57 <<
" --multirow Enable heuristic multi row matching" << std::endl
58 <<
" default matching strategy, keep for backward reason" << std::endl
59 <<
" --prealigned Match only overlapping images," << std::endl
60 <<
" requires a rough aligned panorama" << std::endl
61 <<
" --allpairs Match all image pairs (slow)" << std::endl
62 << std::endl <<
"Feature description options" << std::endl
63 <<
" --sieve1width=<int> Sieve 1: Number of buckets on width (default: 10)" << std::endl
64 <<
" --sieve1height=<int> Sieve 1: Number of buckets on height (default: 10)" << std::endl
65 <<
" --sieve1size=<int> Sieve 1: Max points per bucket (default: 100)" << std::endl
66 <<
" --kdtreesteps=<int> KDTree: search steps (default: 200)" << std::endl
67 <<
" --kdtreeseconddist=<double> KDTree: distance of 2nd match (default: 0.25)" << std::endl
68 << std::endl <<
"Feature matching options" << std::endl
69 <<
" --ransaciter=<int> Ransac: iterations (default: 1000)" << std::endl
70 <<
" --ransacdist=<int> Ransac: homography estimation distance threshold" << std::endl
71 <<
" (in pixels) (default: 50)" << std::endl
72 <<
" --ransacmode=<string> Ransac: Select the mode used in the ransac step." << std::endl
73 <<
" Possible values: auto, hom, rpy, rpyv, rpyb" << std::endl
74 <<
" (default: auto)" << std::endl
75 <<
" --minmatches=<int> Minimum matches (default: 6)" << std::endl
76 <<
" --sieve2width=<int> Sieve 2: Number of buckets on width (default: 5)" << std::endl
77 <<
" --sieve2height=<int> Sieve 2: Number of buckets on height (default: 5)" << std::endl
78 <<
" --sieve2size=<int> Sieve 2: Max points per bucket (default: 1)" << std::endl
79 << std::endl <<
"Caching options" << std::endl
80 <<
" -c|--cache Caches keypoints to external file" << std::endl
81 <<
" --clean Clean up cached keyfiles" << std::endl
82 <<
" -p|--keypath=<string> Store keyfiles in given path" << std::endl
83 <<
" -k|--writekeyfile=<int> Write a keyfile for this image number" << std::endl
84 <<
" --kall Write keyfiles for all images in the project" << std::endl
85 << std::endl <<
"Advanced options" << std::endl
86 <<
" --celeste Masks area with clouds before running feature descriptor" << std::endl
87 <<
" Celeste can be fine tuned with the following parameters" << std::endl
88 <<
" --celestethreshold=<int> Threshold for celeste (default 0.5)" << std::endl
89 <<
" --celesteradius=<int> Radius for celeste (in pixels, default 20)" << std::endl
90 <<
" --ncores=<int> Number of threads to use (default: autodetect number of cores)" << std::endl;
121 const char* optstring =
"qvftn:o:k:cp:h";
122 static struct option longOptions[] =
124 {
"quiet", no_argument, NULL,
'q' },
125 {
"verbose", no_argument, NULL,
'v'},
126 {
"fullscale", no_argument, NULL,
'f'},
127 {
"sieve1width", required_argument, NULL, SIEVE1WIDTH},
128 {
"sieve1height", required_argument, NULL, SIEVE1HEIGHT},
129 {
"sieve1size", required_argument, NULL, SIEVE1SIZE},
130 {
"linearmatch", no_argument, NULL, LINEARMATCH},
131 {
"linearmatchlen", required_argument, NULL, LINEARMATCHLEN},
132 {
"multirow", no_argument, NULL, MULTIROW},
133 {
"prealigned", no_argument, NULL, PREALIGNED},
134 {
"allpairs", no_argument, NULL, ALLPAIRS},
135 {
"kdtreesteps", required_argument, NULL, KDTREESTEPS},
136 {
"kdtreeseconddist", required_argument, NULL, KDTREESECONDDIST},
137 {
"minmatches", required_argument, NULL, MINMATCHES},
138 {
"ransacmode", required_argument, NULL, RANSACMODE},
139 {
"ransaciter", required_argument, NULL, RANSACITER},
140 {
"ransacdist", required_argument, NULL, RANSACDIST},
141 {
"sieve2width", required_argument, NULL, SIEVE2WIDTH},
142 {
"sieve2height", required_argument, NULL, SIEVE2HEIGHT},
143 {
"sieve2size", required_argument, NULL, SIEVE2SIZE},
144 {
"test", no_argument, NULL,
't'},
145 {
"ncores", required_argument, NULL,
'n'},
146 {
"output", required_argument, NULL,
'o'},
147 {
"writekeyfile", required_argument, NULL,
'k'},
148 {
"kall", no_argument, NULL, KALL},
149 {
"cache", no_argument, NULL,
'c'},
150 {
"clean", no_argument, NULL, CLEAN},
151 {
"keypath", required_argument, NULL,
'p'},
152 {
"celeste", no_argument, NULL, CELESTE},
153 {
"celestethreshold", required_argument, NULL, CELESTETHRESHOLD},
154 {
"celesteradius", required_argument, NULL, CELESTERADIUS},
155 {
"version", no_argument, NULL, CPFINDVERSION},
156 {
"help", no_argument, NULL,
'h'},
163 std::string ransacMode;
164 std::vector<int> keyfilesIndex;
169 while ((c = getopt_long (argc, argv, optstring, longOptions,
nullptr)) != -1)
229 case KDTREESECONDDIST:
230 floatNumber=atof(optarg);
245 std::cout <<
"Ransac: " << ransacMode << std::endl;
247 std::cout <<
"Ransac: " << ransacMode << std::endl;
248 if(ransacMode==
"auto")
254 if(ransacMode==
"hom")
260 if(ransacMode==
"rpy")
266 if(ransacMode==
"rpyv")
272 if(ransacMode==
"rpyvb")
278 std::cout <<
"Warning: Invalid parameter in --ransacmode." << std::endl;
335 if((number==0) && (strcmp(optarg,
"0")!=0))
337 std::cout <<
"Warning: " << optarg <<
" is not a valid image number of writekeyfile." << std::endl;
341 keyfilesIndex.push_back(number);
359 case CELESTETHRESHOLD:
360 floatNumber=atof(optarg);
392 if (argc - optind != 1)
394 if (argc - optind < 1)
405 if(doLinearMatch + doMultirow + doPrealign + doAllParis >1)
407 std::cerr <<
hugin_utils::stripPath(argv[0]) <<
": The arguments --linearmatch, --multirow, --prealigned and --allpairs" << std::endl
408 <<
" are mutually exclusive. Use only one of them." << std::endl;
427 if(!keyfilesIndex.empty())
434 int main(
int argc,
char** argv)
bool parseOptions(int argc, char **argv, PanoDetector &ioPanoDetector)
void setSieve2Height(int iHeight)
void setVerbose(int level)
void setMatchingStrategy(MatchingStrategy iMatchStrategy)
void setSieve1Height(int iHeight)
void setCores(int iCores)
void setCached(bool iCached)
void setKDTreeSecondDistance(double iDist)
void setCleanup(bool iCleanup)
void setSieve2Width(int iWidth)
void setDownscale(bool iDown)
#define TIMETRACE(TEXT, CODE)
void setSieve1Size(int iSize)
void setLinearMatchLen(int iLen)
void setKeyPointsIdx(std::vector< int > keyPointsIdx)
void setKDTreeSearchSteps(int iSteps)
void setSieve1Width(int iWidth)
void setCelesteThreshold(double iCelesteThreshold)
void setOutputFile(const std::string &outputFile)
void setSieve2Size(int iSize)
void setRansacDistanceThreshold(int iDT)
void setWriteAllKeyPoints(bool writeAllKeyPoints=true)
std::string GetHuginVersion()
return a string with version numbers
void setCelesteRadius(int iCelesteRadius)
void setMinimumMatches(int iMatches)
void setRansacIterations(int iIters)
void setKeyfilesPath(const std::string &keypath)
void setInputFile(const std::string &inputFile)
void setCeleste(bool iCeleste)
std::string tolower(const std::string &s)
convert a string to lowercase
void setRansacMode(HuginBase::RANSACOptimizer::Mode mode)
std::string stripPath(const std::string &filename)
remove the path of a filename (mainly useful for gui display of filenames)
int main(int argc, char *argv[])