From e87a07e2aa188520a1b7259aa2b5e78a2b881cdd Mon Sep 17 00:00:00 2001 From: Alexey Spizhevoy Date: Mon, 19 Mar 2012 11:51:18 +0000 Subject: [PATCH] Fixed bug #1693. Also corrected default parameters for stitching. --- .../stitching/include/opencv2/stitching/detail/matchers.hpp | 2 +- modules/stitching/src/matchers.cpp | 4 ++-- samples/cpp/stitching_detailed.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/stitching/include/opencv2/stitching/detail/matchers.hpp b/modules/stitching/include/opencv2/stitching/detail/matchers.hpp index 5d77ad996e..991f01d5f8 100644 --- a/modules/stitching/include/opencv2/stitching/detail/matchers.hpp +++ b/modules/stitching/include/opencv2/stitching/detail/matchers.hpp @@ -169,7 +169,7 @@ protected: class CV_EXPORTS BestOf2NearestMatcher : public FeaturesMatcher { public: - BestOf2NearestMatcher(bool try_use_gpu = false, float match_conf = 0.65f, int num_matches_thresh1 = 6, + BestOf2NearestMatcher(bool try_use_gpu = false, float match_conf = 0.3f, int num_matches_thresh1 = 6, int num_matches_thresh2 = 6); void collectGarbage(); diff --git a/modules/stitching/src/matchers.cpp b/modules/stitching/src/matchers.cpp index ad697f9cd2..1cc630e88e 100644 --- a/modules/stitching/src/matchers.cpp +++ b/modules/stitching/src/matchers.cpp @@ -351,9 +351,9 @@ void SurfFeaturesFinder::find(const Mat &image, ImageFeatures &features) } else { - vector descriptors; + Mat descriptors; (*surf)(gray_image, Mat(), features.keypoints, descriptors); - features.descriptors = Mat(descriptors, true).reshape(1, (int)features.keypoints.size()); + features.descriptors = descriptors.reshape(1, (int)features.keypoints.size()); } } diff --git a/samples/cpp/stitching_detailed.cpp b/samples/cpp/stitching_detailed.cpp index 1849142fb8..26e3694ad2 100644 --- a/samples/cpp/stitching_detailed.cpp +++ b/samples/cpp/stitching_detailed.cpp @@ -135,7 +135,7 @@ bool save_graph = false; std::string save_graph_to; string warp_type = "spherical"; int expos_comp_type = ExposureCompensator::GAIN_BLOCKS; -float match_conf = 0.65f; +float match_conf = 0.3f; string seam_find_type = "gc_color"; int blend_type = Blender::MULTI_BAND; float blend_strength = 5; -- GitLab