" Resolution for compositing step. Use -1 for original resolution.\n"\r
" The default is -1.\n"\r
" --match_conf <float>\n"\r
- " Confidence for feature matching step. The default is 0.6.\n"\r
+ " Confidence for feature matching step. The default is 0.7.\n"\r
" --ba (ray|focal_ray)\n"\r
" Bundle adjustment cost function. The default is 'focal_ray'.\n"\r
" --conf_thresh <float>\n"\r
bool wave_correct = true;\r
int warp_type = Warper::SPHERICAL;\r
int expos_comp_type = ExposureCompensator::GAIN;\r
-bool user_match_conf = false;\r
-float match_conf = 0.6f;\r
+float match_conf = 0.7f;\r
int seam_find_type = SeamFinder::GC_COLOR;\r
int blend_type = Blender::MULTI_BAND;\r
int num_bands = 5;\r
}\r
for (int i = 1; i < argc; ++i)\r
{\r
- if (string(argv[i]) == "--preview")\r
+ if (string(argv[i]) == "--help" || string(argv[i]) == "/?")\r
+ {\r
+ printUsage();\r
+ return -1;\r
+ }\r
+ else if (string(argv[i]) == "--preview")\r
{\r
preview = true;\r
}\r
}\r
else if (string(argv[i]) == "--match_conf")\r
{\r
- user_match_conf = true;\r
match_conf = static_cast<float>(atof(argv[i + 1]));\r
i++;\r
}\r
\r
finder(img, features[i]);\r
features[i].img_idx = i;\r
- LOGLN("Features in image #" << i << ": " << features[i].keypoints.size());\r
+ LOGLN("Features in image #" << i+1 << ": " << features[i].keypoints.size());\r
\r
resize(full_img, img, Size(), seam_scale, seam_scale);\r
images[i] = img.clone();\r
\r
LOGLN("Finding features, time: " << ((getTickCount() - t) / getTickFrequency()) << " sec");\r
\r
- LOGLN("Pairwise matching... ");\r
+ LOG("Pairwise matching");\r
t = getTickCount();\r
vector<MatchesInfo> pairwise_matches;\r
- BestOf2NearestMatcher matcher(try_gpu);\r
- if (user_match_conf)\r
- matcher = BestOf2NearestMatcher(try_gpu, match_conf);\r
+ BestOf2NearestMatcher matcher(try_gpu, match_conf);\r
matcher(features, pairwise_matches);\r
LOGLN("Pairwise matching, time: " << ((getTickCount() - t) / getTickFrequency()) << " sec");\r
\r
Mat R;\r
cameras[i].R.convertTo(R, CV_32F);\r
cameras[i].R = R;\r
- LOGLN("Initial focal length #" << i << ": " << cameras[i].focal);\r
+ LOGLN("Initial focal length #" << indices[i]+1 << ": " << cameras[i].focal);\r
}\r
\r
- LOGLN("Bundle adjustment... ");\r
+ LOG("Bundle adjustment");\r
t = getTickCount();\r
BundleAdjuster adjuster(ba_space, conf_thresh);\r
adjuster(features, pairwise_matches, cameras);\r
LOGLN("Bundle adjustment, time: " << ((getTickCount() - t) / getTickFrequency()) << " sec");\r
\r
+ // Find median focal length\r
+ vector<double> focals;\r
+ for (size_t i = 0; i < cameras.size(); ++i)\r
+ {\r
+ LOGLN("Camera #" << indices[i]+1 << " focal length: " << cameras[i].focal);\r
+ focals.push_back(cameras[i].focal);\r
+ }\r
+ nth_element(focals.begin(), focals.begin() + focals.size()/2, focals.end());\r
+ float warped_image_scale = static_cast<float>(focals[focals.size() / 2]);\r
+\r
if (wave_correct)\r
{\r
LOGLN("Wave correcting...");\r
LOGLN("Wave correcting, time: " << ((getTickCount() - t) / getTickFrequency()) << " sec");\r
}\r
\r
- // Find median focal length\r
- vector<double> focals;\r
- for (size_t i = 0; i < cameras.size(); ++i)\r
- {\r
- LOGLN("Camera #" << i << " focal length: " << cameras[i].focal);\r
- focals.push_back(cameras[i].focal);\r
- }\r
- nth_element(focals.begin(), focals.begin() + focals.size()/2, focals.end());\r
- float warped_image_scale = static_cast<float>(focals[focals.size() / 2]);\r
-\r
LOGLN("Warping images (auxiliary)... ");\r
t = getTickCount();\r
\r
\r
for (int img_idx = 0; img_idx < num_images; ++img_idx)\r
{\r
- LOGLN("Compositing image #" << img_idx);\r
+ LOGLN("Compositing image #" << indices[img_idx]+1);\r
\r
// Read image and resize it if necessary\r
full_img = imread(img_names[img_idx]);\r