uncommented Opponent descriptors test, fixed descriptors mat size

This commit is contained in:
Maria Dimashova 2011-06-17 10:47:35 +00:00
parent 814336f4cb
commit e95f8194e2
2 changed files with 9 additions and 7 deletions

View File

@ -371,6 +371,7 @@ void OpponentColorDescriptorExtractor::computeImpl( const Mat& bgrImage, vector<
vector<int> idxs[N];
// Compute descriptors three times, once for each Opponent channel to concatenate into a single color descriptor
int maxKeypointsCount = 0;
for( int ci = 0; ci < N; ci++ )
{
channelKeypoints[ci].insert( channelKeypoints[ci].begin(), keypoints.begin(), keypoints.end() );
@ -385,13 +386,14 @@ void OpponentColorDescriptorExtractor::computeImpl( const Mat& bgrImage, vector<
idxs[ci][ki] = (int)ki;
}
std::sort( idxs[ci].begin(), idxs[ci].end(), KP_LessThan(channelKeypoints[ci]) );
maxKeypointsCount = std::max( maxKeypointsCount, (int)channelKeypoints[ci].size());
}
vector<KeyPoint> outKeypoints;
outKeypoints.reserve( keypoints.size() );
int descriptorSize = descriptorExtractor->descriptorSize();
Mat mergedDescriptors( (int)keypoints.size(), 3*descriptorSize, descriptorExtractor->descriptorType() );
Mat mergedDescriptors( maxKeypointsCount, 3*descriptorSize, descriptorExtractor->descriptorType() );
int mergedCount = 0;
// cp - current channel position
size_t cp[] = {0, 0, 0};

View File

@ -1059,12 +1059,12 @@ TEST( Features2d_DescriptorExtractor_BRIEF, regression )
test.safe_run();
}
//TEST( Features2d_DescriptorExtractor_OpponentSIFT, regression )
//{
// CV_DescriptorExtractorTest<L2<float> > test( "descriptor-opponent-sift", 0.18f,
// DescriptorExtractor::create("OpponentSIFT"), 8.06652f );
// test.safe_run();
//}
TEST( Features2d_DescriptorExtractor_OpponentSIFT, regression )
{
CV_DescriptorExtractorTest<L2<float> > test( "descriptor-opponent-sift", 0.18f,
DescriptorExtractor::create("OpponentSIFT"), 8.06652f );
test.safe_run();
}
TEST( Features2d_DescriptorExtractor_OpponentSURF, regression )
{