mirror of
https://github.com/opencv/opencv.git
synced 2024-11-30 22:40:17 +08:00
Merged the trunk 8892,8894,8898
This commit is contained in:
parent
cf97209f95
commit
a66cd5698a
@ -1820,7 +1820,7 @@ Finds the global minimum and maximum in an array
|
|||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
When ``minIdx`` is not NULL, it must have at least 2 elements (as well as ``maxIdx``), even if ``src`` is a single-row or single-column matrix. In OpenCV (following MATLAB) each array has at least 2 dimensions, i.e. single-row matrix is ``Mx1`` matrix (and therefore ``minIdx``/``maxIdx`` will be ``(i1,0)``/``(i2,0)``) and single-column matrix is ``1xN`` matrix (and therefore ``minIdx``/``maxIdx`` will be ``(0,j1)``/``(0,j2)``).
|
When ``minIdx`` is not NULL, it must have at least 2 elements (as well as ``maxIdx``), even if ``src`` is a single-row or single-column matrix. In OpenCV (following MATLAB) each array has at least 2 dimensions, i.e. single-column matrix is ``Mx1`` matrix (and therefore ``minIdx``/``maxIdx`` will be ``(i1,0)``/``(i2,0)``) and single-row matrix is ``1xN`` matrix (and therefore ``minIdx``/``maxIdx`` will be ``(0,j1)``/``(0,j2)``).
|
||||||
|
|
||||||
:param maxIdx: Pointer to the returned maximum location (in nD case). ``NULL`` is used if not required.
|
:param maxIdx: Pointer to the returned maximum location (in nD case). ``NULL`` is used if not required.
|
||||||
|
|
||||||
|
@ -667,7 +667,7 @@ struct SURFInvoker
|
|||||||
besty = sumy;
|
besty = sumy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
descriptor_dir = fastAtan2( besty, bestx );
|
descriptor_dir = fastAtan2( -besty, bestx );
|
||||||
}
|
}
|
||||||
kp.angle = descriptor_dir;
|
kp.angle = descriptor_dir;
|
||||||
if( !descriptors || !descriptors->data )
|
if( !descriptors || !descriptors->data )
|
||||||
|
@ -291,9 +291,9 @@ public:
|
|||||||
typedef typename Distance::ValueType ValueType;
|
typedef typename Distance::ValueType ValueType;
|
||||||
typedef typename Distance::ResultType DistanceType;
|
typedef typename Distance::ResultType DistanceType;
|
||||||
|
|
||||||
CV_DescriptorExtractorTest( const string _name, DistanceType _maxDist, const Ptr<DescriptorExtractor>& _dextractor, float _prevTime,
|
CV_DescriptorExtractorTest( const string _name, DistanceType _maxDist, const Ptr<DescriptorExtractor>& _dextractor,
|
||||||
Distance d = Distance() ):
|
Distance d = Distance() ):
|
||||||
name(_name), maxDist(_maxDist), prevTime(_prevTime), dextractor(_dextractor), distance(d) {}
|
name(_name), maxDist(_maxDist), dextractor(_dextractor), distance(d) {}
|
||||||
protected:
|
protected:
|
||||||
virtual void createDescriptorExtractor() {}
|
virtual void createDescriptorExtractor() {}
|
||||||
|
|
||||||
@ -401,7 +401,7 @@ protected:
|
|||||||
double t = (double)getTickCount();
|
double t = (double)getTickCount();
|
||||||
dextractor->compute( img, keypoints, calcDescriptors );
|
dextractor->compute( img, keypoints, calcDescriptors );
|
||||||
t = getTickCount() - t;
|
t = getTickCount() - t;
|
||||||
ts->printf(cvtest::TS::LOG, "\nAverage time of computing one descriptor = %g ms (previous time = %g ms).\n", t/((double)cvGetTickFrequency()*1000.)/calcDescriptors.rows, prevTime );
|
ts->printf(cvtest::TS::LOG, "\nAverage time of computing one descriptor = %g ms.\n", t/((double)cvGetTickFrequency()*1000.)/calcDescriptors.rows );
|
||||||
|
|
||||||
if( calcDescriptors.rows != (int)keypoints.size() )
|
if( calcDescriptors.rows != (int)keypoints.size() )
|
||||||
{
|
{
|
||||||
@ -486,7 +486,6 @@ protected:
|
|||||||
|
|
||||||
string name;
|
string name;
|
||||||
const DistanceType maxDist;
|
const DistanceType maxDist;
|
||||||
const float prevTime;
|
|
||||||
Ptr<DescriptorExtractor> dextractor;
|
Ptr<DescriptorExtractor> dextractor;
|
||||||
Distance distance;
|
Distance distance;
|
||||||
|
|
||||||
@ -988,28 +987,28 @@ TEST( Features2d_Detector_SURF, regression )
|
|||||||
TEST( Features2d_DescriptorExtractor_SIFT, regression )
|
TEST( Features2d_DescriptorExtractor_SIFT, regression )
|
||||||
{
|
{
|
||||||
CV_DescriptorExtractorTest<L2<float> > test( "descriptor-sift", 0.03f,
|
CV_DescriptorExtractorTest<L2<float> > test( "descriptor-sift", 0.03f,
|
||||||
DescriptorExtractor::create("SIFT"), 8.06652f );
|
DescriptorExtractor::create("SIFT") );
|
||||||
test.safe_run();
|
test.safe_run();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST( Features2d_DescriptorExtractor_SURF, regression )
|
TEST( Features2d_DescriptorExtractor_SURF, regression )
|
||||||
{
|
{
|
||||||
CV_DescriptorExtractorTest<L2<float> > test( "descriptor-surf", 0.05f,
|
CV_DescriptorExtractorTest<L2<float> > test( "descriptor-surf", 0.05f,
|
||||||
DescriptorExtractor::create("SURF"), 0.147372f );
|
DescriptorExtractor::create("SURF") );
|
||||||
test.safe_run();
|
test.safe_run();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST( Features2d_DescriptorExtractor_OpponentSIFT, regression )
|
TEST( Features2d_DescriptorExtractor_OpponentSIFT, regression )
|
||||||
{
|
{
|
||||||
CV_DescriptorExtractorTest<L2<float> > test( "descriptor-opponent-sift", 0.18f,
|
CV_DescriptorExtractorTest<L2<float> > test( "descriptor-opponent-sift", 0.18f,
|
||||||
DescriptorExtractor::create("OpponentSIFT"), 8.06652f );
|
DescriptorExtractor::create("OpponentSIFT") );
|
||||||
test.safe_run();
|
test.safe_run();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST( Features2d_DescriptorExtractor_OpponentSURF, regression )
|
TEST( Features2d_DescriptorExtractor_OpponentSURF, regression )
|
||||||
{
|
{
|
||||||
CV_DescriptorExtractorTest<L2<float> > test( "descriptor-opponent-surf", 0.3f,
|
CV_DescriptorExtractorTest<L2<float> > test( "descriptor-opponent-surf", 0.3f,
|
||||||
DescriptorExtractor::create("OpponentSURF"), 0.147372f );
|
DescriptorExtractor::create("OpponentSURF") );
|
||||||
test.safe_run();
|
test.safe_run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user