]> rtime.felk.cvut.cz Git - opencv.git/commitdiff
renamed Keypoint to KeyPoint
authorvp153 <vp153@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Fri, 24 Jul 2009 01:36:34 +0000 (01:36 +0000)
committervp153 <vp153@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Fri, 24 Jul 2009 01:36:34 +0000 (01:36 +0000)
git-svn-id: https://code.ros.org/svn/opencv/trunk@1978 73c94f0f-984f-4a5f-82bc-2d8db8d8ee08

opencv/apps/haartraining/cvhaartraining.cpp
opencv/include/opencv/cv.hpp
opencv/include/opencv/cvaux.hpp
opencv/src/cv/cvfeatureselect.cpp
opencv/src/cv/cvstardetector.cpp
opencv/src/cv/cvsurf.cpp
opencv/src/cvaux/cvplanardetect.cpp

index 7943c2bd0130cfd7212dd24befd81ee44bdb93e9..a09c95fe659099b7ab30257a0194d7f31fd5c474 100644 (file)
@@ -1759,7 +1759,7 @@ int icvGetHaarTrainingData( CvHaarTrainingData* data, int first, int count,
 //    CCOUNTER_SET_ZERO(thread_consumed_count);
 //
 //    #ifdef _OPENMP
-//    #pragma omp parallel private(img, sum, tilted, sqsum, sumdata, tilteddata, \
+//    #pragma omp parallel private(img, sum, tilted, sqsum, sumdata, tilteddata,
 //                                 normfactor, thread_consumed_count)
 //    #endif /* _OPENMP */
 //    {
index 405640619efe90e28ea4419303697fba931ad404..9b8e570f53b8cc114092edf985a397eb213cfcd7 100644 (file)
@@ -839,13 +839,13 @@ CV_EXPORTS void reprojectImageTo3D( const Mat& disparity,
                                     Mat& _3dImage, const Mat& Q,
                                     bool handleMissingValues=false );
 
-class CV_EXPORTS Keypoint
+class CV_EXPORTS KeyPoint
 {
 public:    
-    Keypoint() : pt(0,0), size(0), angle(-1), response(0), octave(0) {}
-    Keypoint(Point2f _pt, float _size, float _angle=-1, float _response=0, int _octave=0)
+    KeyPoint() : pt(0,0), size(0), angle(-1), response(0), octave(0) {}
+    KeyPoint(Point2f _pt, float _size, float _angle=-1, float _response=0, int _octave=0)
     : pt(_pt), size(_size), angle(_angle), response(_response), octave(_octave) {}
-    Keypoint(float x, float y, float _size, float _angle=-1, float _response=0, int _octave=0)
+    KeyPoint(float x, float y, float _size, float _angle=-1, float _response=0, int _octave=0)
     : pt(x, y), size(_size), angle(_angle), response(_response), octave(_octave) {}
     
     Point2f pt;
@@ -855,8 +855,8 @@ public:
     int octave;
 };
 
-CV_EXPORTS void write(FileStorage& fs, const String& name, const Vector<Keypoint>& keypoints);
-CV_EXPORTS void read(const FileNode& node, Vector<Keypoint>& keypoints);    
+CV_EXPORTS void write(FileStorage& fs, const String& name, const Vector<KeyPoint>& keypoints);
+CV_EXPORTS void read(const FileNode& node, Vector<KeyPoint>& keypoints);    
 
 class CV_EXPORTS SURF : public CvSURFParams
 {
@@ -866,9 +866,9 @@ public:
 
     int descriptorSize() const;
     void operator()(const Mat& img, const Mat& mask,
-                    Vector<Keypoint>& keypoints) const;
+                    Vector<KeyPoint>& keypoints) const;
     void operator()(const Mat& img, const Mat& mask,
-                    Vector<Keypoint>& keypoints,
+                    Vector<KeyPoint>& keypoints,
                     Vector<float>& descriptors,
                     bool useProvidedKeypoints=false) const;
 };
@@ -895,7 +895,7 @@ public:
                  int _lineThresholdBinarized,
                  int _suppressNonmaxSize);
 
-    void operator()(const Mat& image, Vector<Keypoint>& keypoints) const;
+    void operator()(const Mat& image, Vector<KeyPoint>& keypoints) const;
 };
     
 }
index 8f0035ede7edf751b3c879146a962dbe11a0e9a4..913d271bf29ec692c3b254c347a5f88032a71a54 100644 (file)
@@ -523,9 +523,9 @@ public:
     LDetector();\r
     LDetector(int _radius, int _threshold, int _nOctaves,\r
               int _nViews, double _baseFeatureSize, double _clusteringDistance);\r
-    void operator()(const Mat& image, Vector<Keypoint>& keypoints, int maxCount=0, bool scaleCoords=true) const;\r
-    void operator()(const Vector<Mat>& pyr, Vector<Keypoint>& keypoints, int maxCount=0, bool scaleCoords=true) const;\r
-    void getMostStable2D(const Mat& image, Vector<Keypoint>& keypoints,\r
+    void operator()(const Mat& image, Vector<KeyPoint>& keypoints, int maxCount=0, bool scaleCoords=true) const;\r
+    void operator()(const Vector<Mat>& pyr, Vector<KeyPoint>& keypoints, int maxCount=0, bool scaleCoords=true) const;\r
+    void getMostStable2D(const Mat& image, Vector<KeyPoint>& keypoints,\r
                          int maxCount, const PatchGenerator& patchGenerator) const;\r
     void setVerbose(bool verbose);\r
     \r
@@ -562,7 +562,7 @@ public:
     virtual void read(const FileNode& n);\r
     virtual void write(FileStorage& fs, const String& name=String()) const;\r
     virtual void trainFromSingleView(const Mat& image,\r
-                                     const Vector<Keypoint>& keypoints,\r
+                                     const Vector<KeyPoint>& keypoints,\r
                                      int _patchSize=PATCH_SIZE,\r
                                      int _signatureSize=DEFAULT_SIGNATURE_SIZE,\r
                                      int _nstructs=DEFAULT_STRUCTS,\r
@@ -656,7 +656,7 @@ public:
                        int _nviews=FernClassifier::DEFAULT_VIEWS,\r
                        const LDetector& detector=LDetector(),\r
                        const PatchGenerator& patchGenerator=PatchGenerator());\r
-    virtual void train(const Vector<Mat>& pyr, const Vector<Keypoint>& keypoints,\r
+    virtual void train(const Vector<Mat>& pyr, const Vector<KeyPoint>& keypoints,\r
                        int _patchSize=FernClassifier::PATCH_SIZE,\r
                        int _nstructs=FernClassifier::DEFAULT_STRUCTS,\r
                        int _structSize=FernClassifier::DEFAULT_STRUCT_SIZE,\r
@@ -664,7 +664,7 @@ public:
                        const LDetector& detector=LDetector(),\r
                        const PatchGenerator& patchGenerator=PatchGenerator());\r
     Rect getModelROI() const;\r
-    Vector<Keypoint> getModelPoints() const;\r
+    Vector<KeyPoint> getModelPoints() const;\r
     const LDetector& getDetector() const;\r
     const FernClassifier& getClassifier() const;\r
     void setVerbose(bool verbose);\r
@@ -672,13 +672,13 @@ public:
     void read(const FileNode& node);\r
     void write(FileStorage& fs, const String& name=String()) const;\r
     bool operator()(const Mat& image, Mat& H, Vector<Point2f>& corners) const;\r
-    bool operator()(const Vector<Mat>& pyr, const Vector<Keypoint>& keypoints,\r
+    bool operator()(const Vector<Mat>& pyr, const Vector<KeyPoint>& keypoints,\r
                     Mat& H, Vector<Point2f>& corners, Vector<int>* pairs=0) const;\r
     \r
 protected:\r
     bool verbose;\r
     Rect modelROI;\r
-    Vector<Keypoint> modelPoints;\r
+    Vector<KeyPoint> modelPoints;\r
     LDetector ldetector;\r
     FernClassifier fernClassifier;\r
 };\r
index 4e809dbfc9fa878464bffa39af96dc7a1cdfdfd7..0b5d176e18f8eebe44715b4017021a24a031a59a 100644 (file)
@@ -121,14 +121,14 @@ void goodFeaturesToTrack( const Mat& image, Vector<Point2f>& corners,
     }
 }
     
-void write(FileStorage& fs, const String& objname, const Vector<Keypoint>& keypoints)
+void write(FileStorage& fs, const String& objname, const Vector<KeyPoint>& keypoints)
 {
     WriteStructContext ws(fs, objname, CV_NODE_SEQ + CV_NODE_FLOW);
     
     int i, npoints = (int)keypoints.size();
     for( i = 0; i < npoints; i++ )
     {
-        const Keypoint& kpt = keypoints[i];
+        const KeyPoint& kpt = keypoints[i];
         write(fs, kpt.pt.x);
         write(fs, kpt.pt.y);
         write(fs, kpt.size);
@@ -139,13 +139,13 @@ void write(FileStorage& fs, const String& objname, const Vector<Keypoint>& keypo
 }
 
 
-void read(const FileNode& node, Vector<Keypoint>& keypoints)
+void read(const FileNode& node, Vector<KeyPoint>& keypoints)
 {
     keypoints.resize(0);
     FileNodeIterator it = node.begin(), it_end = node.end();
     for( ; it != it_end; )
     {
-        Keypoint kpt;
+        KeyPoint kpt;
         it >> kpt.pt.x >> kpt.pt.y >> kpt.size >> kpt.angle >> kpt.response >> kpt.octave;
         keypoints.push_back(kpt);
     }
index 1fd4be2a542709015a3ee8c5b5d6369f5050c1c9..5ab8be7fec747b79f6c4c4d1d63ee14be8538166 100644 (file)
@@ -450,7 +450,7 @@ StarDetector::StarDetector(int _maxSize, int _responseThreshold,
             _lineThresholdProjected, _lineThresholdBinarized, _suppressNonmaxSize);
 }
 
-void StarDetector::operator()(const Mat& image, Vector<Keypoint>& keypoints) const
+void StarDetector::operator()(const Mat& image, Vector<KeyPoint>& keypoints) const
 {
     CvMat _image = image;
     MemStorage storage(cvCreateMemStorage(0));
@@ -461,7 +461,7 @@ void StarDetector::operator()(const Mat& image, Vector<Keypoint>& keypoints) con
     for( i = 0; i < n; i++, ++it )
     {
         const CvStarKeypoint& kpt = *it;
-        keypoints[i] = Keypoint(kpt.pt, (float)kpt.size, -1.f, kpt.response, 0);
+        keypoints[i] = KeyPoint(kpt.pt, (float)kpt.size, -1.f, kpt.response, 0);
     }
 }
 
index cc66cb2a3436ebfa840ab115d27963343ae6a42f..98ca35d55d6b16e8804fba97e514ccd2b226a1d4 100644 (file)
@@ -52,7 +52,7 @@
 */
 
 /*
-Keypoint position and scale interpolation has been implemented as described in
+KeyPoint position and scale interpolation has been implemented as described in
 the Brown and Lowe paper cited by the SURF paper.
 
 The sampling step along the x and y axes of the image for the determinant of the
@@ -79,7 +79,7 @@ octave.
 The extraction of the patch of pixels surrounding a keypoint used to build a
 descriptor has been simplified.
 
-Keypoint descriptor normalisation has been changed from normalising each 4x4 
+KeyPoint descriptor normalisation has been changed from normalising each 4x4 
 cell (resulting in a descriptor of magnitude 16) to normalising the entire 
 descriptor to magnitude 1.
 
@@ -362,7 +362,7 @@ static CvSeq* icvFastHessianDetector( const CvMat* sum, const CvMat* mask_sum,
                                 point.pt.x >= 0 && point.pt.x <= (sum->cols-1) &&
                                 point.pt.y >= 0 && point.pt.y <= (sum->rows-1) )
                             {    
-                                /*printf( "Keypoint %f %f %d\n", point.pt.x, point.pt.y, point.size );*/
+                                /*printf( "KeyPoint %f %f %d\n", point.pt.x, point.pt.y, point.size );*/
                                 cvSeqPush( points, &point );
                             }    
                         }
@@ -805,7 +805,7 @@ static int getPointOctave(const CvSURFPoint& kpt, const CvSURFParams& params)
     
 
 void SURF::operator()(const Mat& img, const Mat& mask,
-                      Vector<Keypoint>& keypoints) const
+                      Vector<KeyPoint>& keypoints) const
 {
     CvMat _img = img, _mask, *pmask = 0;
     if( mask.data )
@@ -819,13 +819,13 @@ void SURF::operator()(const Mat& img, const Mat& mask,
     for( i = 0; i < n; i++, ++it )
     {
         const CvSURFPoint& kpt = *it;
-        keypoints[i] = Keypoint(kpt.pt, (float)kpt.size, kpt.dir,
+        keypoints[i] = KeyPoint(kpt.pt, (float)kpt.size, kpt.dir,
                                 kpt.hessian, getPointOctave(kpt, *this));
     }
 }
 
 void SURF::operator()(const Mat& img, const Mat& mask,
-                Vector<Keypoint>& keypoints,
+                Vector<KeyPoint>& keypoints,
                 Vector<float>& descriptors,
                 bool useProvidedKeypoints) const
 {
@@ -842,7 +842,7 @@ void SURF::operator()(const Mat& img, const Mat& mask,
         n = keypoints.size();
         for( i = 0; i < n; i++ )
         {
-            const Keypoint& kpt = keypoints[i];
+            const KeyPoint& kpt = keypoints[i];
             kp.push_back(cvSURFPoint(kpt.pt, 1, cvRound(kpt.size), kpt.angle, kpt.response));
         }
     }
@@ -857,7 +857,7 @@ void SURF::operator()(const Mat& img, const Mat& mask,
         for( i = 0; i < n; i++, ++it )
         {
             const CvSURFPoint& kpt = *it;
-            keypoints[i] = Keypoint(kpt.pt, (float)kpt.size, kpt.dir,
+            keypoints[i] = KeyPoint(kpt.pt, (float)kpt.size, kpt.dir,
                                     kpt.hessian, getPointOctave(kpt, *this));
         }
     }
index d8e0d9e1becdd5648cad9e7238cdd13b3f59e860..b1e3f620e20799e382c0b5fbc395ed101ead404a 100644 (file)
@@ -50,7 +50,7 @@ namespace cv
  
   References:
    1. Mustafa Ã–zuysal, Michael Calonder, Vincent Lepetit, Pascal Fua,
-      "Fast Keypoint Recognition Using Random Ferns,"
+      "Fast KeyPoint Recognition Using Random Ferns,"
       IEEE Transactions on Pattern Analysis and Machine Intelligence, 15 Jan. 2009.
  
    2. Vincent Lepetit, Pascal Fua,
@@ -293,11 +293,11 @@ static void getDiscreteCircle(int R, Vector<Point>& circle, Vector<int>& filledH
 
 struct CmpKeypointScores
 {
-    bool operator ()(const Keypoint& a, const Keypoint& b) const { return std::abs(a.response) > std::abs(b.response); }
+    bool operator ()(const KeyPoint& a, const KeyPoint& b) const { return std::abs(a.response) > std::abs(b.response); }
 };
 
 
-void LDetector::getMostStable2D(const Mat& image, Vector<Keypoint>& keypoints,
+void LDetector::getMostStable2D(const Mat& image, Vector<KeyPoint>& keypoints,
                                 int maxPoints, const PatchGenerator& _patchGenerator) const
 {
     PatchGenerator patchGenerator = _patchGenerator;
@@ -308,7 +308,7 @@ void LDetector::getMostStable2D(const Mat& image, Vector<Keypoint>& keypoints,
     double *M = (double*)_M.data, *iM = (double*)_iM.data;
     RNG& rng = theRNG();
     int i, k;
-    Vector<Keypoint> tempKeypoints;
+    Vector<KeyPoint> tempKeypoints;
     double d2 = clusteringDistance*clusteringDistance;
     keypoints.clear();
     
@@ -342,8 +342,8 @@ void LDetector::getMostStable2D(const Mat& image, Vector<Keypoint>& keypoints,
         int j, sz0 = (int)tempKeypoints.size(), sz1;
         for( j = 0; j < sz0; j++ )
         {
-            Keypoint kpt1 = tempKeypoints[j];
-            Keypoint kpt0((float)(iM[0]*kpt1.pt.x + iM[1]*kpt1.pt.y + iM[2]),
+            KeyPoint kpt1 = tempKeypoints[j];
+            KeyPoint kpt0((float)(iM[0]*kpt1.pt.x + iM[1]*kpt1.pt.y + iM[2]),
                           (float)(iM[3]*kpt1.pt.x + iM[4]*kpt1.pt.y + iM[5]),
                           kpt1.size, -1.f, 1.f, kpt1.octave);
             float r = kpt1.size*0.5f;
@@ -354,13 +354,13 @@ void LDetector::getMostStable2D(const Mat& image, Vector<Keypoint>& keypoints,
             sz1 = (int)keypoints.size();
             for( k = 0; k < sz1; k++ )
             {
-                Keypoint kpt = keypoints[k];
+                KeyPoint kpt = keypoints[k];
                 if( kpt.octave != kpt0.octave )
                     continue;
                 double dx = kpt.pt.x - kpt0.pt.x, dy = kpt.pt.y - kpt0.pt.y;
                 if( dx*dx + dy*dy <= d2*(1 << kpt.octave*2) )
                 {
-                    keypoints[k] = Keypoint((kpt.pt.x*kpt.response + kpt0.pt.x)/(kpt.response+1),
+                    keypoints[k] = KeyPoint((kpt.pt.x*kpt.response + kpt0.pt.x)/(kpt.response+1),
                                             (kpt.pt.y*kpt.response + kpt0.pt.y)/(kpt.response+1),
                                             kpt.size, -1.f, kpt.response + 1, kpt.octave);
                     break;
@@ -414,14 +414,14 @@ static Point2f adjustCorner(const float* fval, float& fvaln)
     return Point2f((float)dx, (float)dy);
 }    
 
-void LDetector::operator()(const Mat& image, Vector<Keypoint>& keypoints, int maxCount, bool scaleCoords) const
+void LDetector::operator()(const Mat& image, Vector<KeyPoint>& keypoints, int maxCount, bool scaleCoords) const
 {
     Vector<Mat> pyr;
     buildPyramid(image, pyr, std::max(nOctaves-1, 0));
     (*this)(pyr, keypoints, maxCount, scaleCoords);    
 }       
 
-void LDetector::operator()(const Vector<Mat>& pyr, Vector<Keypoint>& keypoints, int maxCount, bool scaleCoords) const
+void LDetector::operator()(const Vector<Mat>& pyr, Vector<KeyPoint>& keypoints, int maxCount, bool scaleCoords) const
 {
     const int lthreshold = 3;
     int L, x, y, i, j, k, tau = lthreshold;
@@ -581,7 +581,7 @@ void LDetector::operator()(const Vector<Mat>& pyr, Vector<Keypoint>& keypoints,
                 Point2f pt = adjustCorner(fval, fvaln);
                 pt.x += x;
                 pt.y += y;
-                keypoints.push_back(Keypoint((float)(pt.x*cscale), (float)(pt.y*cscale),
+                keypoints.push_back(KeyPoint((float)(pt.x*cscale), (float)(pt.y*cscale),
                                              (float)(baseFeatureSize*cscale), -1, fvaln, L));
             }
         }
@@ -860,7 +860,7 @@ void FernClassifier::train(const Vector<Point2f>& points,
 
 
 void FernClassifier::trainFromSingleView(const Mat& image,
-                                         const Vector<Keypoint>& keypoints,
+                                         const Vector<KeyPoint>& keypoints,
                                          int _patchSize, int _signatureSize,
                                          int _nstructs, int _structSize,
                                          int _nviews, int _compressionMethod,
@@ -946,7 +946,7 @@ void FernClassifier::trainFromSingleView(const Mat& image,
         
         for( j = 0; j < nsamples; j++ )
         {
-            Keypoint kpt = keypoints[j];
+            KeyPoint kpt = keypoints[j];
             float scale = 1.f/(1 << kpt.octave);
             Point2f pt((float)((M[0]*kpt.pt.x + M[1]*kpt.pt.y + M[2])*scale),
                        (float)((M[3]*kpt.pt.x + M[4]*kpt.pt.y + M[5])*scale));
@@ -1208,7 +1208,7 @@ PlanarObjectDetector::~PlanarObjectDetector()
 {
 }    
 
-Vector<Keypoint> PlanarObjectDetector::getModelPoints() const
+Vector<KeyPoint> PlanarObjectDetector::getModelPoints() const
 {
     return modelPoints;
 }   
@@ -1230,7 +1230,7 @@ void PlanarObjectDetector::train(const Vector<Mat>& pyr, int npoints,
                                        FernClassifier::COMPRESSION_NONE, patchGenerator);
 }
 
-void PlanarObjectDetector::train(const Vector<Mat>& pyr, const Vector<Keypoint>& keypoints,
+void PlanarObjectDetector::train(const Vector<Mat>& pyr, const Vector<KeyPoint>& keypoints,
                                  int patchSize, int nstructs, int structSize,
                                  int nviews, const LDetector& detector,
                                  const PatchGenerator& patchGenerator)
@@ -1278,13 +1278,13 @@ bool PlanarObjectDetector::operator()(const Mat& image, Mat& H, Vector<Point2f>&
 {
     Vector<Mat> pyr;
     buildPyramid(image, pyr, ldetector.nOctaves - 1);
-    Vector<Keypoint> keypoints;
+    Vector<KeyPoint> keypoints;
     ldetector(pyr, keypoints);
     
     return (*this)(pyr, keypoints, H, corners);
 }
 
-bool PlanarObjectDetector::operator()(const Vector<Mat>& pyr, const Vector<Keypoint>& keypoints,
+bool PlanarObjectDetector::operator()(const Vector<Mat>& pyr, const Vector<KeyPoint>& keypoints,
                                       Mat& _H, Vector<Point2f>& corners, Vector<int>* pairs) const
 {
     int i, j, m = (int)modelPoints.size(), n = (int)keypoints.size();
@@ -1295,7 +1295,7 @@ bool PlanarObjectDetector::operator()(const Vector<Mat>& pyr, const Vector<Keypo
     
     for( i = 0; i < n; i++ )
     {
-        Keypoint kpt = keypoints[i];
+        KeyPoint kpt = keypoints[i];
         CV_Assert(0 <= kpt.octave && kpt.octave < (int)pyr.size());
         kpt.pt.x /= (float)(1 << kpt.octave);
         kpt.pt.y /= (float)(1 << kpt.octave);