diff --git a/modules/core/include/opencv2/core/types.hpp b/modules/core/include/opencv2/core/types.hpp index 819fd52817..2ef4d3b4e8 100644 --- a/modules/core/include/opencv2/core/types.hpp +++ b/modules/core/include/opencv2/core/types.hpp @@ -714,6 +714,14 @@ public: //! the default constructor CV_WRAP KeyPoint(); /** + @param _pt x & y coordinates of the keypoint while z is the response + @param _size keypoint diameter + @param _angle keypoint orientation + @param _octave pyramid octave in which the keypoint has been detected + @param _class_id object id + */ + KeyPoint(Point3f _pt, float _size, float _angle=-1, int _octave=0, int _class_id=-1); + /** @param _pt x & y coordinates of the keypoint @param _size keypoint diameter @param _angle keypoint orientation @@ -2427,6 +2435,10 @@ inline KeyPoint::KeyPoint() : pt(0,0), size(0), angle(-1), response(0), octave(0), class_id(-1) {} +inline +KeyPoint::KeyPoint(Point3f _pt, float _size, float _angle, int _octave, int _class_id) + : pt(_pt.x, _pt.y), size(_size), angle(_angle), response(_pt.z), octave(_octave), class_id(_class_id) {} + inline KeyPoint::KeyPoint(Point2f _pt, float _size, float _angle, float _response, int _octave, int _class_id) : pt(_pt), size(_size), angle(_angle), response(_response), octave(_octave), class_id(_class_id) {} diff --git a/modules/features2d/src/gftt.cpp b/modules/features2d/src/gftt.cpp index 11ed29f39d..6e4c17876e 100644 --- a/modules/features2d/src/gftt.cpp +++ b/modules/features2d/src/gftt.cpp @@ -86,7 +86,7 @@ public: return; } - std::vector corners; + std::vector corners; if (_image.isUMat()) { @@ -110,10 +110,10 @@ public: } keypoints.resize(corners.size()); - std::vector::const_iterator corner_it = corners.begin(); + std::vector::const_iterator corner_it = corners.begin(); std::vector::iterator keypoint_it = keypoints.begin(); for( ; corner_it != corners.end() && keypoint_it != keypoints.end(); ++corner_it, ++keypoint_it ) - *keypoint_it = KeyPoint( *corner_it, (float)blockSize ); + *keypoint_it = KeyPoint( *corner_it, (float)blockSize); }