merged the trunk r8735:8766, r8769, r8777:8780, r8790 and r8800:8811
This commit is contained in:
@@ -94,9 +94,9 @@ Finds keypoints in an image and computes their descriptors
|
||||
|
||||
:param useProvidedKeypoints: If it is true, then the method will use the provided vector of keypoints instead of detecting them.
|
||||
|
||||
FREAK
|
||||
FREAK
|
||||
-----
|
||||
.. ocv:class:: FREAK
|
||||
.. ocv:class:: FREAK : public DescriptorExtractor
|
||||
|
||||
Class implementing the FREAK (*Fast Retina Keypoint*) keypoint descriptor, described in [AOV12]_. The algorithm propose a novel keypoint descriptor inspired by the human visual system and more precisely the retina, coined Fast Retina Key- point (FREAK). A cascade of binary strings is computed by efficiently comparing image intensities over a retinal sampling pattern. FREAKs are in general faster to compute with lower memory load and also more robust than SIFT, SURF or BRISK. They are competitive alternatives to existing keypoints in particular for embedded applications.
|
||||
|
||||
@@ -106,12 +106,12 @@ FREAK::FREAK
|
||||
------------
|
||||
The FREAK constructor
|
||||
|
||||
.. ocv:function:: FREAK::FREAK(bool orientationNormalized = true, bool scaleNormalized = true, float patternScale = 22.0f, int nbOctave = 4, const vector<int>& selectedPairs = vector<int>())
|
||||
.. ocv:function:: FREAK::FREAK( bool orientationNormalized=true, bool scaleNormalized=true, float patternScale=22.0f, int nOctaves=4, const vector<int>& selectedPairs=vector<int>() )
|
||||
|
||||
:param orientationNormalized: Enable orientation normalization.
|
||||
:param scaleNormalized: Enable scale normalization.
|
||||
:param patternScale: Scaling of the description pattern.
|
||||
:param nbOctave: Number of octaves covered by the detected keypoints.
|
||||
:param nOctaves: Number of octaves covered by the detected keypoints.
|
||||
:param selectedPairs: (Optional) user defined selected pairs indexes,
|
||||
|
||||
FREAK::selectPairs
|
||||
@@ -126,4 +126,3 @@ We notice that for keypoint matching applications, image content has little effe
|
||||
:param keypoints: Set of detected keypoints
|
||||
:param corrThresh: Correlation threshold.
|
||||
:param verbose: Prints pair selection informations.
|
||||
|
@@ -328,7 +328,7 @@ public:
|
||||
float patternScale = 22.0f,
|
||||
int nOctaves = 4,
|
||||
const vector<int>& selectedPairs = vector<int>());
|
||||
FREAK( const FREAK& rhs );
|
||||
FREAK( const FREAK& rhs );
|
||||
FREAK& operator=( const FREAK& );
|
||||
|
||||
virtual ~FREAK();
|
||||
@@ -349,51 +349,51 @@ public:
|
||||
vector<int> selectPairs( const vector<Mat>& images, vector<vector<KeyPoint> >& keypoints,
|
||||
const double corrThresh = 0.7, bool verbose = true );
|
||||
|
||||
AlgorithmInfo* info() const;
|
||||
AlgorithmInfo* info() const;
|
||||
|
||||
enum
|
||||
{
|
||||
NB_SCALES = 64, NB_PAIRS = 512, NB_ORIENPAIRS = 45
|
||||
};
|
||||
enum
|
||||
{
|
||||
NB_SCALES = 64, NB_PAIRS = 512, NB_ORIENPAIRS = 45
|
||||
};
|
||||
|
||||
protected:
|
||||
virtual void computeImpl( const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors ) const;
|
||||
void buildPattern();
|
||||
uchar meanIntensity( const Mat& image, const Mat& integral, const float kp_x, const float kp_y,
|
||||
void buildPattern();
|
||||
uchar meanIntensity( const Mat& image, const Mat& integral, const float kp_x, const float kp_y,
|
||||
const unsigned int scale, const unsigned int rot, const unsigned int point ) const;
|
||||
|
||||
bool orientationNormalized; //true if the orientation is normalized, false otherwise
|
||||
bool orientationNormalized; //true if the orientation is normalized, false otherwise
|
||||
bool scaleNormalized; //true if the scale is normalized, false otherwise
|
||||
double patternScale; //scaling of the pattern
|
||||
int nOctaves; //number of octaves
|
||||
bool extAll; // true if all pairs need to be extracted for pairs selection
|
||||
|
||||
|
||||
double patternScale0;
|
||||
int nOctaves0;
|
||||
vector<int> selectedPairs0;
|
||||
|
||||
struct PatternPoint
|
||||
{
|
||||
float x; // x coordinate relative to center
|
||||
float y; // x coordinate relative to center
|
||||
float sigma; // Gaussian smoothing sigma
|
||||
};
|
||||
struct PatternPoint
|
||||
{
|
||||
float x; // x coordinate relative to center
|
||||
float y; // x coordinate relative to center
|
||||
float sigma; // Gaussian smoothing sigma
|
||||
};
|
||||
|
||||
struct DescriptionPair
|
||||
{
|
||||
uchar i; // index of the first point
|
||||
uchar j; // index of the second point
|
||||
};
|
||||
struct DescriptionPair
|
||||
{
|
||||
uchar i; // index of the first point
|
||||
uchar j; // index of the second point
|
||||
};
|
||||
|
||||
struct OrientationPair
|
||||
{
|
||||
uchar i; // index of the first point
|
||||
uchar j; // index of the second point
|
||||
int weight_dx; // dx/(norm_sq))*4096
|
||||
int weight_dy; // dy/(norm_sq))*4096
|
||||
};
|
||||
|
||||
vector<PatternPoint> patternLookup; // look-up table for the pattern points (position+sigma of all points at all scales and orientation)
|
||||
struct OrientationPair
|
||||
{
|
||||
uchar i; // index of the first point
|
||||
uchar j; // index of the second point
|
||||
int weight_dx; // dx/(norm_sq))*4096
|
||||
int weight_dy; // dy/(norm_sq))*4096
|
||||
};
|
||||
|
||||
vector<PatternPoint> patternLookup; // look-up table for the pattern points (position+sigma of all points at all scales and orientation)
|
||||
int patternSizes[NB_SCALES]; // size of the pattern at a specific scale (used to check if a point is within image boundaries)
|
||||
DescriptionPair descriptionPairs[NB_PAIRS];
|
||||
OrientationPair orientationPairs[NB_ORIENPAIRS];
|
||||
@@ -603,7 +603,7 @@ public:
|
||||
|
||||
// TODO implement read/write
|
||||
virtual bool empty() const;
|
||||
|
||||
|
||||
AlgorithmInfo* info() const;
|
||||
|
||||
protected:
|
||||
@@ -641,8 +641,8 @@ protected:
|
||||
class CV_EXPORTS AdjusterAdapter: public FeatureDetector
|
||||
{
|
||||
public:
|
||||
/** pure virtual interface
|
||||
*/
|
||||
/** pure virtual interface
|
||||
*/
|
||||
virtual ~AdjusterAdapter() {}
|
||||
/** too few features were detected so, adjust the detector params accordingly
|
||||
* \param min the minimum number of desired features
|
||||
@@ -682,7 +682,7 @@ public:
|
||||
/** \param adjuster an AdjusterAdapter that will do the detection and parameter adjustment
|
||||
* \param max_features the maximum desired number of features
|
||||
* \param max_iters the maximum number of times to try to adjust the feature detector params
|
||||
* for the FastAdjuster this can be high, but with Star or Surf this can get time consuming
|
||||
* for the FastAdjuster this can be high, but with Star or Surf this can get time consuming
|
||||
* \param min_features the minimum desired features
|
||||
*/
|
||||
DynamicAdaptedFeatureDetector( const Ptr<AdjusterAdapter>& adjuster, int min_features=400, int max_features=500, int max_iters=5 );
|
||||
@@ -693,8 +693,8 @@ protected:
|
||||
virtual void detectImpl( const Mat& image, vector<KeyPoint>& keypoints, const Mat& mask=Mat() ) const;
|
||||
|
||||
private:
|
||||
DynamicAdaptedFeatureDetector& operator=(const DynamicAdaptedFeatureDetector&);
|
||||
DynamicAdaptedFeatureDetector(const DynamicAdaptedFeatureDetector&);
|
||||
DynamicAdaptedFeatureDetector& operator=(const DynamicAdaptedFeatureDetector&);
|
||||
DynamicAdaptedFeatureDetector(const DynamicAdaptedFeatureDetector&);
|
||||
|
||||
int escape_iters_;
|
||||
int min_features_, max_features_;
|
||||
@@ -792,7 +792,7 @@ public:
|
||||
virtual bool empty() const;
|
||||
|
||||
protected:
|
||||
virtual void computeImpl( const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors ) const;
|
||||
virtual void computeImpl( const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors ) const;
|
||||
|
||||
Ptr<DescriptorExtractor> descriptorExtractor;
|
||||
};
|
||||
@@ -962,7 +962,7 @@ class CV_EXPORTS_W DescriptorMatcher : public Algorithm
|
||||
public:
|
||||
virtual ~DescriptorMatcher();
|
||||
|
||||
/*
|
||||
/*
|
||||
* Add descriptors to train descriptor collection.
|
||||
* descriptors Descriptors to add. Each descriptors[i] is a descriptors set from one image.
|
||||
*/
|
||||
@@ -1078,7 +1078,7 @@ protected:
|
||||
static bool isMaskedOut( const vector<Mat>& masks, int queryIdx );
|
||||
|
||||
static Mat clone_op( Mat m ) { return m.clone(); }
|
||||
void checkMasks( const vector<Mat>& masks, int queryDescriptorsCount ) const;
|
||||
void checkMasks( const vector<Mat>& masks, int queryDescriptorsCount ) const;
|
||||
|
||||
// Collection of descriptors from train images.
|
||||
vector<Mat> trainDescCollection;
|
||||
|
@@ -48,8 +48,8 @@ class CV_FastTest : public cvtest::BaseTest
|
||||
{
|
||||
public:
|
||||
CV_FastTest();
|
||||
~CV_FastTest();
|
||||
protected:
|
||||
~CV_FastTest();
|
||||
protected:
|
||||
void run(int);
|
||||
};
|
||||
|
||||
@@ -58,13 +58,13 @@ CV_FastTest::~CV_FastTest() {}
|
||||
|
||||
void CV_FastTest::run( int )
|
||||
{
|
||||
Mat image1 = imread(string(ts->get_data_path()) + "inpaint/orig.jpg");
|
||||
Mat image2 = imread(string(ts->get_data_path()) + "cameracalibration/chess9.jpg");
|
||||
Mat image1 = imread(string(ts->get_data_path()) + "inpaint/orig.jpg");
|
||||
Mat image2 = imread(string(ts->get_data_path()) + "cameracalibration/chess9.jpg");
|
||||
string xml = string(ts->get_data_path()) + "fast/result.xml";
|
||||
|
||||
|
||||
if (image1.empty() || image2.empty())
|
||||
{
|
||||
ts->set_failed_test_info( cvtest::TS::FAIL_INVALID_TEST_DATA );
|
||||
ts->set_failed_test_info( cvtest::TS::FAIL_INVALID_TEST_DATA );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -73,20 +73,20 @@ void CV_FastTest::run( int )
|
||||
cvtColor(image2, gray2, CV_BGR2GRAY);
|
||||
|
||||
vector<KeyPoint> keypoints1;
|
||||
vector<KeyPoint> keypoints2;
|
||||
vector<KeyPoint> keypoints2;
|
||||
FAST(gray1, keypoints1, 30);
|
||||
FAST(gray2, keypoints2, 30);
|
||||
|
||||
for(size_t i = 0; i < keypoints1.size(); ++i)
|
||||
{
|
||||
const KeyPoint& kp = keypoints1[i];
|
||||
cv::circle(image1, kp.pt, cvRound(kp.size/2), CV_RGB(255, 0, 0));
|
||||
cv::circle(image1, kp.pt, cvRound(kp.size/2), CV_RGB(255, 0, 0));
|
||||
}
|
||||
|
||||
for(size_t i = 0; i < keypoints2.size(); ++i)
|
||||
{
|
||||
const KeyPoint& kp = keypoints2[i];
|
||||
cv::circle(image2, kp.pt, cvRound(kp.size/2), CV_RGB(255, 0, 0));
|
||||
cv::circle(image2, kp.pt, cvRound(kp.size/2), CV_RGB(255, 0, 0));
|
||||
}
|
||||
|
||||
Mat kps1(1, (int)(keypoints1.size() * sizeof(KeyPoint)), CV_8U, &keypoints1[0]);
|
||||
@@ -99,14 +99,14 @@ void CV_FastTest::run( int )
|
||||
fs << "exp_kps1" << kps1;
|
||||
fs << "exp_kps2" << kps2;
|
||||
fs.release();
|
||||
}
|
||||
}
|
||||
|
||||
if (!fs.isOpened())
|
||||
fs.open(xml, FileStorage::READ);
|
||||
|
||||
Mat exp_kps1, exp_kps2;
|
||||
|
||||
Mat exp_kps1, exp_kps2;
|
||||
read( fs["exp_kps1"], exp_kps1, Mat() );
|
||||
read( fs["exp_kps2"], exp_kps2, Mat() );
|
||||
read( fs["exp_kps2"], exp_kps2, Mat() );
|
||||
fs.release();
|
||||
|
||||
if ( 0 != norm(exp_kps1, kps1, NORM_L2) || 0 != norm(exp_kps2, kps2, NORM_L2))
|
||||
@@ -114,7 +114,7 @@ void CV_FastTest::run( int )
|
||||
ts->set_failed_test_info(cvtest::TS::FAIL_MISMATCH);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* cv::namedWindow("Img1"); cv::imshow("Img1", image1);
|
||||
cv::namedWindow("Img2"); cv::imshow("Img2", image2);
|
||||
cv::waitKey(0);*/
|
||||
|
@@ -50,8 +50,8 @@ using namespace cv;
|
||||
class CV_MserTest : public cvtest::BaseTest
|
||||
{
|
||||
public:
|
||||
CV_MserTest();
|
||||
protected:
|
||||
CV_MserTest();
|
||||
protected:
|
||||
void run(int);
|
||||
int LoadBoxes(const char* path, vector<CvBox2D>& boxes);
|
||||
int SaveBoxes(const char* path, const vector<CvBox2D>& boxes);
|
||||
@@ -71,7 +71,7 @@ int CV_MserTest::LoadBoxes(const char* path, vector<CvBox2D>& boxes)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
while (!feof(f))
|
||||
{
|
||||
CvBox2D box;
|
||||
@@ -175,12 +175,12 @@ void CV_MserTest::run(int)
|
||||
{
|
||||
RotatedRect box = fitEllipse(msers[i]);
|
||||
box.angle=(float)CV_PI/2-box.angle;
|
||||
boxes.push_back(box);
|
||||
boxes.push_back(box);
|
||||
}
|
||||
|
||||
string boxes_path = string(ts->get_data_path()) + "mser/boxes.txt";
|
||||
string calc_boxes_path = string(ts->get_data_path()) + "mser/boxes.calc.txt";
|
||||
|
||||
|
||||
if (!LoadBoxes(boxes_path.c_str(),boxes_orig))
|
||||
{
|
||||
SaveBoxes(boxes_path.c_str(),boxes);
|
||||
|
@@ -128,7 +128,7 @@ void NearestNeighborTest::run( int /*start_from*/ ) {
|
||||
randu( desc, Scalar(minValue), Scalar(maxValue) );
|
||||
|
||||
createModel( desc );
|
||||
|
||||
|
||||
tempCode = checkGetPoins( desc );
|
||||
if( tempCode != cvtest::TS::OK )
|
||||
{
|
||||
@@ -149,9 +149,9 @@ void NearestNeighborTest::run( int /*start_from*/ ) {
|
||||
ts->printf( cvtest::TS::LOG, "bad accuracy of Find \n" );
|
||||
code = tempCode;
|
||||
}
|
||||
|
||||
|
||||
releaseModel();
|
||||
|
||||
|
||||
ts->set_failed_test_info( code );
|
||||
}
|
||||
|
||||
@@ -398,7 +398,7 @@ void CV_FlannSavedIndexTest::createModel(const cv::Mat &data)
|
||||
}
|
||||
string filename = tempfile();
|
||||
index->save( filename );
|
||||
|
||||
|
||||
createIndex( data, SavedIndexParams(filename.c_str()));
|
||||
remove( filename.c_str() );
|
||||
}
|
||||
|
Reference in New Issue
Block a user