From cce2d9927e2bf900ebdb5f4e3dbc2894d58f5f4e Mon Sep 17 00:00:00 2001 From: Leonid Beynenson Date: Fri, 11 Jul 2014 16:37:30 +0400 Subject: [PATCH 1/2] Fixed bug which caused crash of GPU version of feature matcher in stitcher The bug caused crash of GPU version of feature matcher in stitcher when we use ORB features. --- modules/stitching/src/matchers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/stitching/src/matchers.cpp b/modules/stitching/src/matchers.cpp index ac29d7ca2..a0cb13203 100644 --- a/modules/stitching/src/matchers.cpp +++ b/modules/stitching/src/matchers.cpp @@ -212,7 +212,7 @@ void GpuMatcher::match(const ImageFeatures &features1, const ImageFeatures &feat descriptors1_.upload(features1.descriptors); descriptors2_.upload(features2.descriptors); - BFMatcher_GPU matcher(NORM_L2); + BFMatcher_GPU matcher(NORM_L1); MatchesSet matches; // Find 1->2 matches From 8578f9c5651308bd5ae265e061e902fff46e58da Mon Sep 17 00:00:00 2001 From: LeonidBeynenson Date: Tue, 15 Jul 2014 13:26:32 +0400 Subject: [PATCH 2/2] Added a TODO comment about changes which should be done in GpuMatcher::match --- modules/stitching/src/matchers.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/stitching/src/matchers.cpp b/modules/stitching/src/matchers.cpp index a0cb13203..e0e477940 100644 --- a/modules/stitching/src/matchers.cpp +++ b/modules/stitching/src/matchers.cpp @@ -212,6 +212,10 @@ void GpuMatcher::match(const ImageFeatures &features1, const ImageFeatures &feat descriptors1_.upload(features1.descriptors); descriptors2_.upload(features2.descriptors); + //TODO: NORM_L1 allows to avoid matcher crashes for ORB features, but is not absolutely correct for them. + // The best choice for ORB features is NORM_HAMMING, but it is incorrect for SURF features. + // More accurate fix in this place should be done in the future -- the type of the norm + // should be either a parameter of this method, or a field of the class. BFMatcher_GPU matcher(NORM_L1); MatchesSet matches;