From ab15b5954ebc19eb824310a12e9040e9253c163f Mon Sep 17 00:00:00 2001 From: Alexander Shishkov Date: Sat, 28 Apr 2012 12:48:23 +0000 Subject: [PATCH] fixed #1824 --- modules/features2d/src/descriptors.cpp | 6 +++--- modules/features2d/test/test_features2d.cpp | 7 ------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/modules/features2d/src/descriptors.cpp b/modules/features2d/src/descriptors.cpp index f1bc1b991..7d8d9fc80 100644 --- a/modules/features2d/src/descriptors.cpp +++ b/modules/features2d/src/descriptors.cpp @@ -232,9 +232,9 @@ void OpponentColorDescriptorExtractor::computeImpl( const Mat& bgrImage, vector< cp[1] < channelKeypoints[1].size() && cp[2] < channelKeypoints[2].size() ) { - const int maxInitIdx = std::max( channelKeypoints[0][idxs[0][cp[0]]].class_id, - std::max( channelKeypoints[1][idxs[1][cp[1]]].class_id, - channelKeypoints[2][idxs[2][cp[2]]].class_id ) ); + const int maxInitIdx = std::max( 0, std::max( channelKeypoints[0][idxs[0][cp[0]]].class_id, + std::max( channelKeypoints[1][idxs[1][cp[1]]].class_id, + channelKeypoints[2][idxs[2][cp[2]]].class_id ) ) ); while( channelKeypoints[0][idxs[0][cp[0]]].class_id < maxInitIdx && cp[0] < channelKeypoints[0].size() ) { cp[0]++; } while( channelKeypoints[1][idxs[1][cp[1]]].class_id < maxInitIdx && cp[1] < channelKeypoints[1].size() ) { cp[1]++; } diff --git a/modules/features2d/test/test_features2d.cpp b/modules/features2d/test/test_features2d.cpp index 36052e979..713c0c4a9 100644 --- a/modules/features2d/test/test_features2d.cpp +++ b/modules/features2d/test/test_features2d.cpp @@ -1059,13 +1059,6 @@ TEST( Features2d_DescriptorExtractor_BRIEF, regression ) test.safe_run(); } -/*TEST( Features2d_DescriptorExtractor_OpponentSIFT, regression ) -{ - CV_DescriptorExtractorTest > test( "descriptor-opponent-sift", 0.18f, - DescriptorExtractor::create("OpponentSIFT"), 8.06652f ); - test.safe_run(); -}*/ - #if CV_SSE2 TEST( Features2d_DescriptorExtractor_Calonder_uchar, regression ) {