namespace detail {\r
\r
void FeaturesFinder::operator ()(const Mat &image, ImageFeatures &features)\r
-{ \r
+{\r
find(image, features);\r
features.img_size = image.size();\r
}\r
\r
\r
void FeaturesFinder::operator ()(const Mat &image, ImageFeatures &features, const vector<Rect> &rois)\r
-{ \r
+{\r
vector<ImageFeatures> roi_features(rois.size());\r
size_t total_kps_count = 0;\r
int total_descriptors_height = 0;\r
\r
features.img_size = image.size();\r
features.keypoints.resize(total_kps_count);\r
- features.descriptors.create(total_descriptors_height, \r
- roi_features[0].descriptors.cols, \r
+ features.descriptors.create(total_descriptors_height,\r
+ roi_features[0].descriptors.cols,\r
roi_features[0].descriptors.type());\r
\r
int kp_idx = 0;\r
{\r
detector_ = Algorithm::create<FeatureDetector>("Feature2D.SURF");\r
extractor_ = Algorithm::create<DescriptorExtractor>("Feature2D.SURF");\r
- \r
+\r
if( detector_.empty() || extractor_.empty() )\r
CV_Error( CV_StsNotImplemented, "OpenCV was built without SURF support" );\r
- \r
+\r
detector_->set("hessianThreshold", hess_thresh);\r
detector_->set("nOctaves", num_octaves);\r
detector_->set("nOctaveLayers", num_layers);\r
- \r
+\r
extractor_->set("nOctaves", num_octaves_descr);\r
extractor_->set("nOctaveLayers", num_layers_descr);\r
}\r
int xr = (c+1) * gray_image.cols / grid_size.width;\r
int yr = (r+1) * gray_image.rows / grid_size.height;\r
\r
- LOGLN("OrbFeaturesFinder::find: gray_image.empty=" << (gray_image.empty()?"true":"false") << ", "\r
- << " gray_image.size()=(" << gray_image.size().width << "x" << gray_image.size().height << "), "\r
- << " yl=" << yl << ", yr=" << yr << ", "\r
- << " xl=" << xl << ", xr=" << xr << ", gray_image.data=" << ((size_t)gray_image.data) << ", "\r
- << "gray_image.dims=" << gray_image.dims << "\n");\r
+ // LOGLN("OrbFeaturesFinder::find: gray_image.empty=" << (gray_image.empty()?"true":"false") << ", "\r
+ // << " gray_image.size()=(" << gray_image.size().width << "x" << gray_image.size().height << "), "\r
+ // << " yl=" << yl << ", yr=" << yr << ", "\r
+ // << " xl=" << xl << ", xr=" << xr << ", gray_image.data=" << ((size_t)gray_image.data) << ", "\r
+ // << "gray_image.dims=" << gray_image.dims << "\n");\r
\r
Mat gray_image_part=gray_image(Range(yl, yr), Range(xl, xr));\r
- LOGLN("OrbFeaturesFinder::find: gray_image_part.empty=" << (gray_image_part.empty()?"true":"false") << ", "\r
- << " gray_image_part.size()=(" << gray_image_part.size().width << "x" << gray_image_part.size().height << "), "\r
- << " gray_image_part.dims=" << gray_image_part.dims << ", "\r
- << " gray_image_part.data=" << ((size_t)gray_image_part.data) << "\n");\r
+ // LOGLN("OrbFeaturesFinder::find: gray_image_part.empty=" << (gray_image_part.empty()?"true":"false") << ", "\r
+ // << " gray_image_part.size()=(" << gray_image_part.size().width << "x" << gray_image_part.size().height << "), "\r
+ // << " gray_image_part.dims=" << gray_image_part.dims << ", "\r
+ // << " gray_image_part.data=" << ((size_t)gray_image_part.data) << "\n");\r
\r
(*orb)(gray_image_part, Mat(), points, descriptors);\r
\r
if (matches_info.inliers_mask[i])\r
matches_info.num_inliers++;\r
\r
- // These coeffs are from paper M. Brown and D. Lowe. "Automatic Panoramic Image Stitching \r
+ // These coeffs are from paper M. Brown and D. Lowe. "Automatic Panoramic Image Stitching\r
// using Invariant Features"\r
matches_info.confidence = matches_info.num_inliers / (8 + 0.3 * matches_info.matches.size());\r
\r
- // Set zero confidence to remove matches between too close images, as they don't provide \r
+ // Set zero confidence to remove matches between too close images, as they don't provide\r
// additional information anyway. The threshold was set experimentally.\r
matches_info.confidence = matches_info.confidence > 3. ? 0. : matches_info.confidence;\r
\r