mirror of
https://github.com/opencv/opencv.git
synced 2024-11-28 13:10:12 +08:00
uncommented Opponent descriptors test, fixed descriptors mat size
This commit is contained in:
parent
814336f4cb
commit
e95f8194e2
@ -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};
|
||||
|
@ -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 )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user