diff --git a/modules/tracker/mbt/include/visp3/mbt/vpMbGenericTracker.h b/modules/tracker/mbt/include/visp3/mbt/vpMbGenericTracker.h index ca3b07483b..b576899404 100644 --- a/modules/tracker/mbt/include/visp3/mbt/vpMbGenericTracker.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbGenericTracker.h @@ -783,7 +783,7 @@ class VISP_EXPORT vpMbGenericTracker : public vpMbTracker using vpMbDepthDenseTracker::setPose; #endif virtual void setPose(const vpImage *const I, const vpImage *const I_color, - const vpHomogeneousMatrix &cdMo); + const vpHomogeneousMatrix &cdMo) override; }; #ifdef VISP_HAVE_NLOHMANN_JSON friend void to_json(nlohmann::json &j, const TrackerWrapper &t); diff --git a/modules/vision/include/visp3/vision/vpKeyPoint.h b/modules/vision/include/visp3/vision/vpKeyPoint.h index 68c907dd6f..e92de87162 100644 --- a/modules/vision/include/visp3/vision/vpKeyPoint.h +++ b/modules/vision/include/visp3/vision/vpKeyPoint.h @@ -369,40 +369,40 @@ class VISP_EXPORT vpKeyPoint : public vpBasicKeyPoint unsigned int width); /*! - Build the reference keypoints list in a region of interest in the image. + * Build the reference keypoints list in a region of interest in the image. * - \param I : Input image. - \param rectangle : Rectangle of the region of interest. - \return The number of detected keypoints in the current image I. + * \param I : Input image. + * \param rectangle : Rectangle of the region of interest. + * \return The number of detected keypoints in the current image I. */ unsigned int buildReference(const vpImage &I, const vpRect &rectangle); /*! - Build the reference keypoints list and compute the 3D position - corresponding of the keypoints locations. + * Build the reference keypoints list and compute the 3D position + * corresponding of the keypoints locations. * - \param I : Input image. - \param trainKeyPoints : List of the train keypoints. - \param points3f : Output list of the 3D position corresponding of the keypoints locations. - \param append : If true, append the supply train keypoints with those already present. - \param class_id : The class id to be set to the input cv::KeyPoint if != -1. - \return The number of detected keypoints in the current image I. + * \param I : Input image. + * \param trainKeyPoints : List of the train keypoints. + * \param points3f : Output list of the 3D position corresponding of the keypoints locations. + * \param append : If true, append the supply train keypoints with those already present. + * \param class_id : The class id to be set to the input cv::KeyPoint if != -1. + * \return The number of detected keypoints in the current image I. */ unsigned int buildReference(const vpImage &I, std::vector &trainKeyPoints, std::vector &points3f, bool append = false, int class_id = -1); /*! - Build the reference keypoints list and compute the 3D position - corresponding of the keypoints locations. + * Build the reference keypoints list and compute the 3D position + * corresponding of the keypoints locations. * - \param I : Input image. - \param trainKeyPoints : List of the train keypoints. - \param points3f : List of the 3D position corresponding of the keypoints locations. - \param trainDescriptors : List of the train descriptors. - \param append : If true, append the supply train keypoints with those already present. - \param class_id : The class id to be set to the input cv::KeyPoint if != -1. + * \param I : Input image. + * \param trainKeyPoints : List of the train keypoints. + * \param points3f : List of the 3D position corresponding of the keypoints locations. + * \param trainDescriptors : List of the train descriptors. + * \param append : If true, append the supply train keypoints with those already present. + * \param class_id : The class id to be set to the input cv::KeyPoint if != -1. * - \return The number of keypoints in the current image I. + * \return The number of keypoints in the current image I. */ unsigned int buildReference(const vpImage &I, const std::vector &trainKeyPoints, const cv::Mat &trainDescriptors, const std::vector &points3f, @@ -417,107 +417,107 @@ class VISP_EXPORT vpKeyPoint : public vpBasicKeyPoint unsigned int buildReference(const vpImage &I_color); /*! - Build the reference keypoints list in a region of interest in the image. + * Build the reference keypoints list in a region of interest in the image. * - \param I_color : Input reference image. - \param iP : Position of the top-left corner of the region of interest. - \param height : Height of the region of interest. - \param width : Width of the region of interest. - \return The number of detected keypoints in the current image I. + * \param I_color : Input reference image. + * \param iP : Position of the top-left corner of the region of interest. + * \param height : Height of the region of interest. + * \param width : Width of the region of interest. + * \return The number of detected keypoints in the current image I. */ unsigned int buildReference(const vpImage &I_color, const vpImagePoint &iP, unsigned int height, unsigned int width); /*! - Build the reference keypoints list in a region of interest in the image. + * Build the reference keypoints list in a region of interest in the image. * - \param I_color : Input image. - \param rectangle : Rectangle of the region of interest. - \return The number of detected keypoints in the current image I. + * \param I_color : Input image. + * \param rectangle : Rectangle of the region of interest. + * \return The number of detected keypoints in the current image I. */ unsigned int buildReference(const vpImage &I_color, const vpRect &rectangle); /*! - Build the reference keypoints list and compute the 3D position - corresponding of the keypoints locations. + * Build the reference keypoints list and compute the 3D position + * corresponding of the keypoints locations. * - \param I_color : Input image. - \param trainKeyPoints : List of the train keypoints. - \param points3f : Output list of the 3D position corresponding of the keypoints locations. - \param append : If true, append the supply train keypoints with those already present. - \param class_id : The class id to be set to the input cv::KeyPoint if != -1. - \return The number of detected keypoints in the current image I. + * \param I_color : Input image. + * \param trainKeyPoints : List of the train keypoints. + * \param points3f : Output list of the 3D position corresponding of the keypoints locations. + * \param append : If true, append the supply train keypoints with those already present. + * \param class_id : The class id to be set to the input cv::KeyPoint if != -1. + * \return The number of detected keypoints in the current image I. */ unsigned int buildReference(const vpImage &I_color, std::vector &trainKeyPoints, std::vector &points3f, bool append = false, int class_id = -1); /*! - Build the reference keypoints list and compute the 3D position - corresponding of the keypoints locations. + * Build the reference keypoints list and compute the 3D position + * corresponding of the keypoints locations. * - \param I_color : Input image. - \param trainKeyPoints : List of the train keypoints. - \param points3f : List of the 3D position corresponding of the keypoints locations. - \param trainDescriptors : List of the train descriptors. - \param append : If true, append the supply train keypoints with those already present. - \param class_id : The class id to be set to the input cv::KeyPoint if != -1. - \return The number of detected keypoints in the current image I. + * \param I_color : Input image. + * \param trainKeyPoints : List of the train keypoints. + * \param points3f : List of the 3D position corresponding of the keypoints locations. + * \param trainDescriptors : List of the train descriptors. + * \param append : If true, append the supply train keypoints with those already present. + * \param class_id : The class id to be set to the input cv::KeyPoint if != -1. + * \return The number of detected keypoints in the current image I. */ - unsigned int buildReference(const vpImage &I, const std::vector &trainKeyPoints, + unsigned int buildReference(const vpImage &I_color, const std::vector &trainKeyPoints, const cv::Mat &trainDescriptors, const std::vector &points3f, bool append = false, int class_id = -1); /*! - Compute the 3D coordinate in the world/object frame given the 2D image - coordinate and under the assumption that the point is located on a plane - whose the plane equation is known in the camera frame. - The Z-coordinate is retrieved according to the proportional relationship - between the plane equation expressed in the normalized camera frame - (derived from the image coordinate) and the same plane equation expressed - in the camera frame. + * Compute the 3D coordinate in the world/object frame given the 2D image + * coordinate and under the assumption that the point is located on a plane + * whose the plane equation is known in the camera frame. + * The Z-coordinate is retrieved according to the proportional relationship + * between the plane equation expressed in the normalized camera frame + * (derived from the image coordinate) and the same plane equation expressed + * in the camera frame. * - \param candidate : Keypoint we want to compute the 3D coordinate. - \param roi : List of 3D points in the camera frame representing a planar face. - \param cam : Camera parameters. - \param cMo : Homogeneous matrix between the world and the camera frames. - \param point : 3D coordinate in the world/object frame computed. + * \param candidate : Keypoint we want to compute the 3D coordinate. + * \param roi : List of 3D points in the camera frame representing a planar face. + * \param cam : Camera parameters. + * \param cMo : Homogeneous matrix between the world and the camera frames. + * \param point : 3D coordinate in the world/object frame computed. */ static void compute3D(const cv::KeyPoint &candidate, const std::vector &roi, const vpCameraParameters &cam, const vpHomogeneousMatrix &cMo, cv::Point3f &point); /*! - Compute the 3D coordinate in the world/object frame given the 2D image - coordinate and under the assumption that the point is located on a plane - whose the plane equation is known in the camera frame. - The Z-coordinate is retrieved according to the proportional relationship - between the plane equation expressed in the normalized camera frame - (derived from the image coordinate) and the same plane equation expressed - in the camera frame. + * Compute the 3D coordinate in the world/object frame given the 2D image + * coordinate and under the assumption that the point is located on a plane + * whose the plane equation is known in the camera frame. + * The Z-coordinate is retrieved according to the proportional relationship + * between the plane equation expressed in the normalized camera frame + * (derived from the image coordinate) and the same plane equation expressed + * in the camera frame. * - \param candidate : vpImagePoint we want to compute the 3D coordinate. - \param roi : List of 3D points in the camera frame representing a planar face. - \param cam : Camera parameters. - \param cMo : Homogeneous matrix between the world and the camera frames. - \param point : 3D coordinate in the world/object frame computed. + * \param candidate : vpImagePoint we want to compute the 3D coordinate. + * \param roi : List of 3D points in the camera frame representing a planar face. + * \param cam : Camera parameters. + * \param cMo : Homogeneous matrix between the world and the camera frames. + * \param point : 3D coordinate in the world/object frame computed. */ static void compute3D(const vpImagePoint &candidate, const std::vector &roi, const vpCameraParameters &cam, const vpHomogeneousMatrix &cMo, vpPoint &point); /*! - Keep only keypoints located on faces and compute for those keypoints the 3D - coordinate in the world/object frame given the 2D image coordinate and - under the assumption that the point is located on a plane. + * Keep only keypoints located on faces and compute for those keypoints the 3D + * coordinate in the world/object frame given the 2D image coordinate and + * under the assumption that the point is located on a plane. * - \param cMo : Homogeneous matrix between the world and the camera frames. - \param cam : Camera parameters. - \param candidates : In input, list of keypoints detected in the whole - image, in output, list of keypoints only located on planes. - \param polygons : List of 2D polygons representing the projection of the faces in - the image plane. - \param roisPt : List of faces, with the 3D coordinates known in the camera frame. - \param points : Output list of computed 3D coordinates (in - the world/object frame) of keypoints located only on faces. - \param descriptors : Optional parameter, pointer to the descriptors to filter. + * \param cMo : Homogeneous matrix between the world and the camera frames. + * \param cam : Camera parameters. + * \param candidates : In input, list of keypoints detected in the whole + * image, in output, list of keypoints only located on planes. + * \param polygons : List of 2D polygons representing the projection of the faces in + * the image plane. + * \param roisPt : List of faces, with the 3D coordinates known in the camera frame. + * \param points : Output list of computed 3D coordinates (in + * the world/object frame) of keypoints located only on faces. + * \param descriptors : Optional parameter, pointer to the descriptors to filter. */ static void compute3DForPointsInPolygons(const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, std::vector &candidates, @@ -526,20 +526,20 @@ class VISP_EXPORT vpKeyPoint : public vpBasicKeyPoint std::vector &points, cv::Mat *descriptors = NULL); /*! - Keep only keypoints located on faces and compute for those keypoints the 3D - coordinate in the world/object frame given the 2D image coordinate and - under the assumption that the point is located on a plane. + * Keep only keypoints located on faces and compute for those keypoints the 3D + * coordinate in the world/object frame given the 2D image coordinate and + * under the assumption that the point is located on a plane. * - \param cMo : Homogeneous matrix between the world and the camera frames. - \param cam : Camera parameters. - \param candidates : In input, list of vpImagePoint located in the whole - image, in output, list of vpImagePoint only located on planes. - \param polygons : List of 2D polygons representing the projection of the faces in - the image plane. - \param roisPt : List of faces, with the 3D coordinates known in the camera frame. - \param points : Output list of computed 3D coordinates (in the world/object frame) - of vpImagePoint located only on faces. - \param descriptors : Optional parameter, pointer to the descriptors to filter. + * \param cMo : Homogeneous matrix between the world and the camera frames. + * \param cam : Camera parameters. + * \param candidates : In input, list of vpImagePoint located in the whole + * image, in output, list of vpImagePoint only located on planes. + * \param polygons : List of 2D polygons representing the projection of the faces in + * the image plane. + * \param roisPt : List of faces, with the 3D coordinates known in the camera frame. + * \param points : Output list of computed 3D coordinates (in the world/object frame) + * of vpImagePoint located only on faces. + * \param descriptors : Optional parameter, pointer to the descriptors to filter. */ static void compute3DForPointsInPolygons(const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, std::vector &candidates, @@ -548,19 +548,19 @@ class VISP_EXPORT vpKeyPoint : public vpBasicKeyPoint std::vector &points, cv::Mat *descriptors = NULL); /*! - Keep only keypoints located on cylinders and compute the 3D coordinates in - the world/object frame given the 2D image coordinates. + * Keep only keypoints located on cylinders and compute the 3D coordinates in + * the world/object frame given the 2D image coordinates. * - \param cMo : Homogeneous matrix between the world and the camera frames. - \param cam : Camera parameters. - \param candidates : In input, list of keypoints detected in the whole - image, in output, list of keypoints only located on cylinders. - \param cylinders : List of vpCylinder corresponding of the cylinder objects in the - scene, projected in the camera frame. - \param vectorOfCylinderRois : For each cylinder, the corresponding list of bounding box. - \param points : Output list of computed 3D coordinates in the world/object frame for each - keypoint located on a cylinder. - \param descriptors : Optional parameter, pointer to the descriptors to filter. + * \param cMo : Homogeneous matrix between the world and the camera frames. + * \param cam : Camera parameters. + * \param candidates : In input, list of keypoints detected in the whole + * image, in output, list of keypoints only located on cylinders. + * \param cylinders : List of vpCylinder corresponding of the cylinder objects in the + * scene, projected in the camera frame. + * \param vectorOfCylinderRois : For each cylinder, the corresponding list of bounding box. + * \param points : Output list of computed 3D coordinates in the world/object frame for each + * keypoint located on a cylinder. + * \param descriptors : Optional parameter, pointer to the descriptors to filter. */ static void compute3DForPointsOnCylinders(const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, @@ -569,19 +569,19 @@ class VISP_EXPORT vpKeyPoint : public vpBasicKeyPoint std::vector &points, cv::Mat *descriptors = NULL); /*! - Keep only vpImagePoint located on cylinders and compute the 3D coordinates - in the world/object frame given the 2D image coordinates. + * Keep only vpImagePoint located on cylinders and compute the 3D coordinates + * in the world/object frame given the 2D image coordinates. * - \param cMo : Homogeneous matrix between the world and the camera frames. - \param cam : Camera parameters. - \param candidates : In input, list of vpImagePoint located in the image, in - output, list of vpImagePoint only located on cylinders. - \param cylinders : List of vpCylinder corresponding of the cylinder objects in the scene, - projected in the camera frame. - \param vectorOfCylinderRois : For each cylinder, the corresponding list of bounding box. - \param points : Output list of computed 3D coordinates in the world/object frame for each - vpImagePoint located on a cylinder. - \param descriptors : Optional parameter, pointer to the descriptors to filter. + * \param cMo : Homogeneous matrix between the world and the camera frames. + * \param cam : Camera parameters. + * \param candidates : In input, list of vpImagePoint located in the image, in + * output, list of vpImagePoint only located on cylinders. + * \param cylinders : List of vpCylinder corresponding of the cylinder objects in the scene, + * projected in the camera frame. + * \param vectorOfCylinderRois : For each cylinder, the corresponding list of bounding box. + * \param points : Output list of computed 3D coordinates in the world/object frame for each + * vpImagePoint located on a cylinder. + * \param descriptors : Optional parameter, pointer to the descriptors to filter. */ static void compute3DForPointsOnCylinders(const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, @@ -590,361 +590,361 @@ class VISP_EXPORT vpKeyPoint : public vpBasicKeyPoint std::vector &points, cv::Mat *descriptors = NULL); /*! - Compute the pose using the correspondence between 2D points and 3D points - using OpenCV function with RANSAC method. + * Compute the pose using the correspondence between 2D points and 3D points + * using OpenCV function with RANSAC method. * - \param imagePoints : List of 2D points corresponding to the location of the detected keypoints. - \param objectPoints : List of the 3D points in the object frame matched. - \param cam : Camera parameters. - \param cMo : Homogeneous matrix between the object frame and the camera frame. - \param inlierIndex : List of indexes of inliers. - \param elapsedTime : Elapsed time. - \param func : Function pointer to filter the final pose returned by OpenCV pose estimation method. - \return True if the pose has been computed, false otherwise (not enough points, or size list mismatch). - */ + * \param imagePoints : List of 2D points corresponding to the location of the detected keypoints. + * \param objectPoints : List of the 3D points in the object frame matched. + * \param cam : Camera parameters. + * \param cMo : Homogeneous matrix between the object frame and the camera frame. + * \param inlierIndex : List of indexes of inliers. + * \param elapsedTime : Elapsed time. + * \param func : Function pointer to filter the final pose returned by OpenCV pose estimation method. + * \return True if the pose has been computed, false otherwise (not enough points, or size list mismatch). + */ bool computePose(const std::vector &imagePoints, const std::vector &objectPoints, const vpCameraParameters &cam, vpHomogeneousMatrix &cMo, std::vector &inlierIndex, double &elapsedTime, bool (*func)(const vpHomogeneousMatrix &) = NULL); /*! - Compute the pose using the correspondence between 2D points and 3D points - using ViSP function with RANSAC method. + * Compute the pose using the correspondence between 2D points and 3D points + * using ViSP function with RANSAC method. * - \param objectVpPoints : List of vpPoint with coordinates expressed in the object and in the camera frame. - \param cMo : Homogeneous matrix between the object frame and the camera frame. - \param inliers : List of inliers. - \param elapsedTime : Elapsed time. - \param func : Function pointer to filter the pose in Ransac pose estimation, if we want - to eliminate the poses which do not respect some criterion - \return True if the pose has been computed, false otherwise (not enough points, or size list mismatch). + * \param objectVpPoints : List of vpPoint with coordinates expressed in the object and in the camera frame. + * \param cMo : Homogeneous matrix between the object frame and the camera frame. + * \param inliers : List of inliers. + * \param elapsedTime : Elapsed time. + * \param func : Function pointer to filter the pose in Ransac pose estimation, if we want + * to eliminate the poses which do not respect some criterion + * \return True if the pose has been computed, false otherwise (not enough points, or size list mismatch). */ bool computePose(const std::vector &objectVpPoints, vpHomogeneousMatrix &cMo, std::vector &inliers, double &elapsedTime, bool (*func)(const vpHomogeneousMatrix &) = NULL); /*! - Compute the pose using the correspondence between 2D points and 3D points - using ViSP function with RANSAC method. + * Compute the pose using the correspondence between 2D points and 3D points + * using ViSP function with RANSAC method. * - \param objectVpPoints : List of vpPoint with coordinates expressed in the object and in the camera frame. - \param cMo : Homogeneous matrix between the object frame and the camera frame. - \param inliers : List of inlier points. - \param inlierIndex : List of inlier index. - \param elapsedTime : Elapsed time. - \return True if the pose has been computed, false otherwise (not enough points, or size list mismatch). - \param func : Function pointer to filter the pose in Ransac pose estimation, if we want to eliminate the poses which - do not respect some criterion + * \param objectVpPoints : List of vpPoint with coordinates expressed in the object and in the camera frame. + * \param cMo : Homogeneous matrix between the object frame and the camera frame. + * \param inliers : List of inlier points. + * \param inlierIndex : List of inlier index. + * \param elapsedTime : Elapsed time. + * \return True if the pose has been computed, false otherwise (not enough points, or size list mismatch). + * \param func : Function pointer to filter the pose in Ransac pose estimation, if we want to eliminate the poses which + * do not respect some criterion */ bool computePose(const std::vector &objectVpPoints, vpHomogeneousMatrix &cMo, std::vector &inliers, std::vector &inlierIndex, double &elapsedTime, bool (*func)(const vpHomogeneousMatrix &) = NULL); /*! - Initialize the size of the matching image (case with a matching side by - side between IRef and ICurrent). + * Initialize the size of the matching image (case with a matching side by + * side between IRef and ICurrent). * - \param IRef : Reference image. - \param ICurrent : Current image. - \param IMatching : Image matching. + * \param IRef : Reference image. + * \param ICurrent : Current image. + * \param IMatching : Image matching. */ void createImageMatching(vpImage &IRef, vpImage &ICurrent, vpImage &IMatching); /*! - Initialize the size of the matching image with appropriate size according - to the number of training images. Used to display the matching of keypoints - detected in the current image with those detected in multiple training - images. + * Initialize the size of the matching image with appropriate size according + * to the number of training images. Used to display the matching of keypoints + * detected in the current image with those detected in multiple training + * images. * - \param ICurrent : Current image. - \param IMatching : Image initialized with appropriate size. + * \param ICurrent : Current image. + * \param IMatching : Image initialized with appropriate size. */ void createImageMatching(vpImage &ICurrent, vpImage &IMatching); /*! - Initialize the size of the matching image (case with a matching side by - side between IRef and ICurrent). + * Initialize the size of the matching image (case with a matching side by + * side between IRef and ICurrent). * - \param IRef : Reference image. - \param ICurrent : Current image. - \param IMatching : Image matching. + * \param IRef : Reference image. + * \param ICurrent : Current image. + * \param IMatching : Image matching. */ void createImageMatching(vpImage &IRef, vpImage &ICurrent, vpImage &IMatching); /*! - Initialize the size of the matching image with appropriate size according - to the number of training images. Used to display the matching of keypoints - detected in the current image with those detected in multiple training - images. + * Initialize the size of the matching image with appropriate size according + * to the number of training images. Used to display the matching of keypoints + * detected in the current image with those detected in multiple training + * images. * - \param ICurrent : Current image. - \param IMatching : Image initialized with appropriate size. + * \param ICurrent : Current image. + * \param IMatching : Image initialized with appropriate size. */ void createImageMatching(vpImage &ICurrent, vpImage &IMatching); /*! - Detect keypoints in the image. + * Detect keypoints in the image. * - \param I : Input image. - \param keyPoints : Output list of the detected keypoints. - \param rectangle : Optional rectangle of the region of interest. + * \param I : Input image. + * \param keyPoints : Output list of the detected keypoints. + * \param rectangle : Optional rectangle of the region of interest. */ void detect(const vpImage &I, std::vector &keyPoints, const vpRect &rectangle = vpRect()); /*! - Detect keypoints in the image. + * Detect keypoints in the image. * - \param I_color : Input image. - \param keyPoints : Output list of the detected keypoints. - \param rectangle : Optional rectangle of the region of interest. + * \param I_color : Input image. + * \param keyPoints : Output list of the detected keypoints. + * \param rectangle : Optional rectangle of the region of interest. */ void detect(const vpImage &I_color, std::vector &keyPoints, const vpRect &rectangle = vpRect()); /*! - Detect keypoints in the image. + * Detect keypoints in the image. * - \param matImg : Input image. - \param keyPoints : Output list of the detected keypoints. - \param mask : Optional 8-bit integer mask to detect only where mask[i][j] != 0. + * \param matImg : Input image. + * \param keyPoints : Output list of the detected keypoints. + * \param mask : Optional 8-bit integer mask to detect only where mask[i][j] != 0. */ void detect(const cv::Mat &matImg, std::vector &keyPoints, const cv::Mat &mask = cv::Mat()); /*! - Detect keypoints in the image. + * Detect keypoints in the image. * - \param I : Input image. - \param keyPoints : Output list of the detected keypoints. - \param elapsedTime : Elapsed time. - \param rectangle : Optional rectangle of the region of interest. + * \param I : Input image. + * \param keyPoints : Output list of the detected keypoints. + * \param elapsedTime : Elapsed time. + * \param rectangle : Optional rectangle of the region of interest. */ void detect(const vpImage &I, std::vector &keyPoints, double &elapsedTime, const vpRect &rectangle = vpRect()); /*! - Detect keypoints in the image. + * Detect keypoints in the image. * - \param I_color : Input image. - \param keyPoints : Output list of the detected keypoints. - \param elapsedTime : Elapsed time. - \param rectangle : Optional rectangle of the region of interest. + * \param I_color : Input image. + * \param keyPoints : Output list of the detected keypoints. + * \param elapsedTime : Elapsed time. + * \param rectangle : Optional rectangle of the region of interest. */ void detect(const vpImage &I_color, std::vector &keyPoints, double &elapsedTime, const vpRect &rectangle = vpRect()); /*! - Detect keypoints in the image. + * Detect keypoints in the image. * - \param matImg : Input image. - \param keyPoints : Output list of the detected keypoints. - \param elapsedTime : Elapsed time. - \param mask : Optional 8-bit integer mask to detect only where mask[i][j] != 0. + * \param matImg : Input image. + * \param keyPoints : Output list of the detected keypoints. + * \param elapsedTime : Elapsed time. + * \param mask : Optional 8-bit integer mask to detect only where mask[i][j] != 0. */ void detect(const cv::Mat &matImg, std::vector &keyPoints, double &elapsedTime, - const cv::Mat &mask = cv::Mat()); - - /*! - Apply a set of affine transformations to the image, detect keypoints and - reproject them into initial image coordinates. - See http://www.ipol.im/pub/algo/my_affine_sift/ for the details. - See https://github.com/Itseez/opencv/blob/master/samples/python2/asift.py - for the Python implementation by Itseez and Matt Sheckells for the current - implementation in C++. - \param I : Input image. - \param listOfKeypoints : List of detected keypoints in the multiple images after - affine transformations. - \param listOfDescriptors : Corresponding list of descriptors. - \param listOfAffineI : Optional parameter, list of images after affine - transformations. - */ + const cv::Mat &mask = cv::Mat()); + + /*! + * Apply a set of affine transformations to the image, detect keypoints and + * reproject them into initial image coordinates. + * See http://www.ipol.im/pub/algo/my_affine_sift/ for the details. + * See https://github.com/Itseez/opencv/blob/master/samples/python2/asift.py + * for the Python implementation by Itseez and Matt Sheckells for the current + * implementation in C++. + * \param I : Input image. + * \param listOfKeypoints : List of detected keypoints in the multiple images after + * affine transformations. + * \param listOfDescriptors : Corresponding list of descriptors. + * \param listOfAffineI : Optional parameter, list of images after affine + * transformations. + */ void detectExtractAffine(const vpImage &I, std::vector > &listOfKeypoints, std::vector &listOfDescriptors, std::vector > *listOfAffineI = NULL); /*! - Display the reference and the detected keypoints in the images. + * Display the reference and the detected keypoints in the images. * - \param IRef : Input reference image. - \param ICurrent : Input current image. - \param size : Size of the displayed cross. + * \param IRef : Input reference image. + * \param ICurrent : Input current image. + * \param size : Size of the displayed cross. */ void display(const vpImage &IRef, const vpImage &ICurrent, unsigned int size = 3); /*! - Display the reference keypoints. + * Display the reference keypoints. * - \param ICurrent : Input current image. - \param size : Size of the displayed crosses. - \param color : Color of the crosses. + * \param ICurrent : Input current image. + * \param size : Size of the displayed crosses. + * \param color : Color of the crosses. */ void display(const vpImage &ICurrent, unsigned int size = 3, const vpColor &color = vpColor::green); /*! - Display the reference and the detected keypoints in the images. + * Display the reference and the detected keypoints in the images. * - \param IRef : Input reference image. - \param ICurrent : Input current image. - \param size : Size of the displayed cross. + * \param IRef : Input reference image. + * \param ICurrent : Input current image. + * \param size : Size of the displayed cross. */ void display(const vpImage &IRef, const vpImage &ICurrent, unsigned int size = 3); /*! - Display the reference keypoints. + * Display the reference keypoints. * - \param ICurrent : Input current image. - \param size : Size of the displayed crosses. - \param color : Color of the crosses. + * \param ICurrent : Input current image. + * \param size : Size of the displayed crosses. + * \param color : Color of the crosses. */ void display(const vpImage &ICurrent, unsigned int size = 3, const vpColor &color = vpColor::green); /*! - Display the matching lines between the detected keypoints with those - detected in one training image. + * Display the matching lines between the detected keypoints with those + * detected in one training image. * - \param IRef : Reference image, used to have the x-offset. - \param IMatching : Resulting image matching. - \param crossSize : Size of the displayed crosses. - \param lineThickness : Thickness of the displayed lines. - \param color : Color to use, if none, we pick randomly a color for each pair - of matching. + * \param IRef : Reference image, used to have the x-offset. + * \param IMatching : Resulting image matching. + * \param crossSize : Size of the displayed crosses. + * \param lineThickness : Thickness of the displayed lines. + * \param color : Color to use, if none, we pick randomly a color for each pair + * of matching. */ void displayMatching(const vpImage &IRef, vpImage &IMatching, unsigned int crossSize, unsigned int lineThickness = 1, const vpColor &color = vpColor::green); /*! - Display matching between keypoints detected in the current image and with - those detected in the multiple training images. Display also RANSAC inliers - if the list is supplied. + * Display matching between keypoints detected in the current image and with + * those detected in the multiple training images. Display also RANSAC inliers + * if the list is supplied. * - \param ICurrent : Current image. - \param IMatching : Resulting matching image. - \param ransacInliers : List of Ransac inliers or empty list if not available. - \param crossSize : Size of the displayed crosses. - \param lineThickness : Thickness of the displayed line. + * \param ICurrent : Current image. + * \param IMatching : Resulting matching image. + * \param ransacInliers : List of Ransac inliers or empty list if not available. + * \param crossSize : Size of the displayed crosses. + * \param lineThickness : Thickness of the displayed line. */ void displayMatching(const vpImage &ICurrent, vpImage &IMatching, const std::vector &ransacInliers = std::vector(), unsigned int crossSize = 3, unsigned int lineThickness = 1); /*! - Display the matching lines between the detected keypoints with those - detected in one training image. + * Display the matching lines between the detected keypoints with those + * detected in one training image. * - \param IRef : Reference image, used to have the x-offset. - \param IMatching : Resulting image matching. - \param crossSize : Size of the displayed crosses. - \param lineThickness : Thickness of the displayed lines. - \param color : Color to use, if none, we pick randomly a color for each pair - of matching. + * \param IRef : Reference image, used to have the x-offset. + * \param IMatching : Resulting image matching. + * \param crossSize : Size of the displayed crosses. + * \param lineThickness : Thickness of the displayed lines. + * \param color : Color to use, if none, we pick randomly a color for each pair + * of matching. */ void displayMatching(const vpImage &IRef, vpImage &IMatching, unsigned int crossSize, unsigned int lineThickness = 1, const vpColor &color = vpColor::green); /*! - Display the matching lines between the detected keypoints with those - detected in one training image. + * Display the matching lines between the detected keypoints with those + * detected in one training image. * - \param IRef : Reference image, used to have the x-offset. - \param IMatching : Resulting image matching. - \param crossSize : Size of the displayed crosses. - \param lineThickness : Thickness of the displayed lines. - \param color : Color to use, if none, we pick randomly a color for each pair - of matching. + * \param IRef : Reference image, used to have the x-offset. + * \param IMatching : Resulting image matching. + * \param crossSize : Size of the displayed crosses. + * \param lineThickness : Thickness of the displayed lines. + * \param color : Color to use, if none, we pick randomly a color for each pair + * of matching. */ void displayMatching(const vpImage &IRef, vpImage &IMatching, unsigned int crossSize, unsigned int lineThickness = 1, const vpColor &color = vpColor::green); /*! - Display matching between keypoints detected in the current image and with - those detected in the multiple training images. Display also RANSAC inliers - if the list is supplied. + * Display matching between keypoints detected in the current image and with + * those detected in the multiple training images. Display also RANSAC inliers + * if the list is supplied. * - \param ICurrent : Current image. - \param IMatching : Resulting matching image. - \param ransacInliers : List of Ransac inliers or empty list if not available. - \param crossSize : Size of the displayed crosses. - \param lineThickness : Thickness of the displayed line. + * \param ICurrent : Current image. + * \param IMatching : Resulting matching image. + * \param ransacInliers : List of Ransac inliers or empty list if not available. + * \param crossSize : Size of the displayed crosses. + * \param lineThickness : Thickness of the displayed line. */ void displayMatching(const vpImage &ICurrent, vpImage &IMatching, const std::vector &ransacInliers = std::vector(), unsigned int crossSize = 3, unsigned int lineThickness = 1); /*! - Extract the descriptors for each keypoints of the list. + * Extract the descriptors for each keypoints of the list. * - \param I : Input image. - \param keyPoints : List of keypoints we want to extract their descriptors. - \param descriptors : Descriptors matrix with at each row the descriptors - values for each keypoint. - \param trainPoints : Pointer to the list of 3D train points, when a keypoint - cannot be extracted, we need to remove the corresponding 3D point. + * \param I : Input image. + * \param keyPoints : List of keypoints we want to extract their descriptors. + * \param descriptors : Descriptors matrix with at each row the descriptors + * values for each keypoint. + * \param trainPoints : Pointer to the list of 3D train points, when a keypoint + * cannot be extracted, we need to remove the corresponding 3D point. */ void extract(const vpImage &I, std::vector &keyPoints, cv::Mat &descriptors, std::vector *trainPoints = NULL); /*! - Extract the descriptors for each keypoints of the list. + * Extract the descriptors for each keypoints of the list. * - \param I_color : Input image. - \param keyPoints : List of keypoints we want to extract their descriptors. - \param descriptors : Descriptors matrix with at each row the descriptors - values for each keypoint. - \param trainPoints : Pointer to the list of 3D train points, when a keypoint - cannot be extracted, we need to remove the corresponding 3D point. + * \param I_color : Input image. + * \param keyPoints : List of keypoints we want to extract their descriptors. + * \param descriptors : Descriptors matrix with at each row the descriptors + * values for each keypoint. + * \param trainPoints : Pointer to the list of 3D train points, when a keypoint + * cannot be extracted, we need to remove the corresponding 3D point. */ void extract(const vpImage &I_color, std::vector &keyPoints, cv::Mat &descriptors, std::vector *trainPoints = NULL); /*! - Extract the descriptors for each keypoints of the list. + * Extract the descriptors for each keypoints of the list. * - \param matImg : Input image. - \param keyPoints : List of keypoints we want to extract their descriptors. - \param descriptors : Descriptors matrix with at each row the descriptors - values for each keypoint. - \param trainPoints : Pointer to the list of 3D train points, when a keypoint cannot - be extracted, we need to remove the corresponding 3D point. + * \param matImg : Input image. + * \param keyPoints : List of keypoints we want to extract their descriptors. + * \param descriptors : Descriptors matrix with at each row the descriptors + * values for each keypoint. + * \param trainPoints : Pointer to the list of 3D train points, when a keypoint cannot + * be extracted, we need to remove the corresponding 3D point. */ void extract(const cv::Mat &matImg, std::vector &keyPoints, cv::Mat &descriptors, std::vector *trainPoints = NULL); /*! - Extract the descriptors for each keypoints of the list. + * Extract the descriptors for each keypoints of the list. * - \param I : Input image. - \param keyPoints : List of keypoints we want to extract their descriptors. - \param descriptors : Descriptors matrix with at each row the descriptors - values for each keypoint. - \param elapsedTime : Elapsed time. - \param trainPoints : Pointer to the list of 3D train points, when a keypoint - cannot be extracted, we need to remove the corresponding 3D point. + * \param I : Input image. + * \param keyPoints : List of keypoints we want to extract their descriptors. + * \param descriptors : Descriptors matrix with at each row the descriptors + * values for each keypoint. + * \param elapsedTime : Elapsed time. + * \param trainPoints : Pointer to the list of 3D train points, when a keypoint + * cannot be extracted, we need to remove the corresponding 3D point. */ void extract(const vpImage &I, std::vector &keyPoints, cv::Mat &descriptors, double &elapsedTime, std::vector *trainPoints = NULL); /*! - Extract the descriptors for each keypoints of the list. + * Extract the descriptors for each keypoints of the list. * - \param I_color : Input image. - \param keyPoints : List of keypoints we want to extract their descriptors. - \param descriptors : Descriptors matrix with at each row the descriptors - values for each keypoint. - \param elapsedTime : Elapsed time. - \param trainPoints : Pointer to the list of 3D train points, when a keypoint - cannot be extracted, we need to remove the corresponding 3D point. + * \param I_color : Input image. + * \param keyPoints : List of keypoints we want to extract their descriptors. + * \param descriptors : Descriptors matrix with at each row the descriptors + * values for each keypoint. + * \param elapsedTime : Elapsed time. + * \param trainPoints : Pointer to the list of 3D train points, when a keypoint + * cannot be extracted, we need to remove the corresponding 3D point. */ void extract(const vpImage &I_color, std::vector &keyPoints, cv::Mat &descriptors, double &elapsedTime, std::vector *trainPoints = NULL); /*! - Extract the descriptors for each keypoints of the list. + * Extract the descriptors for each keypoints of the list. * - \param matImg : Input image. - \param keyPoints : List of keypoints we want to extract their descriptors. - \param descriptors : Descriptors matrix with at each row the descriptors - values for each keypoint. - \param elapsedTime : Elapsed time. - \param trainPoints : Pointer to the list of 3D train points, when a keypoint - cannot be extracted, we need to remove the corresponding 3D point. + * \param matImg : Input image. + * \param keyPoints : List of keypoints we want to extract their descriptors. + * \param descriptors : Descriptors matrix with at each row the descriptors + * values for each keypoint. + * \param elapsedTime : Elapsed time. + * \param trainPoints : Pointer to the list of 3D train points, when a keypoint + * cannot be extracted, we need to remove the corresponding 3D point. */ void extract(const cv::Mat &matImg, std::vector &keyPoints, cv::Mat &descriptors, double &elapsedTime, std::vector *trainPoints = NULL); @@ -1148,20 +1148,20 @@ class VISP_EXPORT vpKeyPoint : public vpBasicKeyPoint inline unsigned int getNbImages() const { return static_cast(m_mapOfImages.size()); } /*! - Get the 3D coordinates of the object points matched (the corresponding 3D - coordinates in the object frame of the keypoints detected in the current - image after the matching). + * Get the 3D coordinates of the object points matched (the corresponding 3D + * coordinates in the object frame of the keypoints detected in the current + * image after the matching). * - \param objectPoints : List of 3D coordinates in the object frame. + * \param objectPoints : List of 3D coordinates in the object frame. */ void getObjectPoints(std::vector &objectPoints) const; /*! - Get the 3D coordinates of the object points matched (the corresponding 3D - coordinates in the object frame of the keypoints detected in the current - image after the matching). + * Get the 3D coordinates of the object points matched (the corresponding 3D + * coordinates in the object frame of the keypoints detected in the current + * image after the matching). * - \param objectPoints : List of 3D coordinates in the object frame. + * \param objectPoints : List of 3D coordinates in the object frame. */ void getObjectPoints(std::vector &objectPoints) const; @@ -1181,22 +1181,22 @@ class VISP_EXPORT vpKeyPoint : public vpBasicKeyPoint inline cv::Mat getQueryDescriptors() const { return m_queryDescriptors; } /*! - Get the query keypoints list in OpenCV type. + * Get the query keypoints list in OpenCV type. * - \param matches : If false return the list of all query keypoints extracted in the current image. - If true, return only the query keypoints list that have matches. - \param keyPoints : List of query keypoints (or keypoints detected in the - current image). + * \param matches : If false return the list of all query keypoints extracted in the current image. + * If true, return only the query keypoints list that have matches. + * \param keyPoints : List of query keypoints (or keypoints detected in the + * current image). */ void getQueryKeyPoints(std::vector &keyPoints, bool matches = true) const; /*! - Get the query keypoints list in ViSP type. + * Get the query keypoints list in ViSP type. * - \param keyPoints : List of query keypoints (or keypoints detected in the - current image). - \param matches : If false return the list of all query keypoints extracted in the current image. - If true, return only the query keypoints list that have matches. + * \param keyPoints : List of query keypoints (or keypoints detected in the + * current image). + * \param matches : If false return the list of all query keypoints extracted in the current image. + * If true, return only the query keypoints list that have matches. */ void getQueryKeyPoints(std::vector &keyPoints, bool matches = true) const; @@ -1223,204 +1223,204 @@ class VISP_EXPORT vpKeyPoint : public vpBasicKeyPoint inline cv::Mat getTrainDescriptors() const { return m_trainDescriptors; } /*! - Get the train keypoints list in OpenCV type. + * Get the train keypoints list in OpenCV type. * - \param keyPoints : List of train keypoints (or reference keypoints). + * \param keyPoints : List of train keypoints (or reference keypoints). */ void getTrainKeyPoints(std::vector &keyPoints) const; /*! - Get the train keypoints list in ViSP type. + * Get the train keypoints list in ViSP type. * - \param keyPoints : List of train keypoints (or reference keypoints). + * \param keyPoints : List of train keypoints (or reference keypoints). */ void getTrainKeyPoints(std::vector &keyPoints) const; /*! - Get the train points (the 3D coordinates in the object frame) list in - OpenCV type. + * Get the train points (the 3D coordinates in the object frame) list in + * OpenCV type. * - \param points : List of train points (or reference points). + * \param points : List of train points (or reference points). */ void getTrainPoints(std::vector &points) const; /*! - Get the train points (the 3D coordinates in the object frame) list in ViSP - type. + * Get the train points (the 3D coordinates in the object frame) list in ViSP + * type. * - \param points : List of train points (or reference points). + * \param points : List of train points (or reference points). */ void getTrainPoints(std::vector &points) const; /*! - Initialize a matcher based on its name. + * Initialize a matcher based on its name. * - \param matcherName : Name of the matcher (e.g BruteForce, FlannBased). + * \param matcherName : Name of the matcher (e.g BruteForce, FlannBased). */ void initMatcher(const std::string &matcherName); /*! - Insert a reference image and a current image side-by-side. + * Insert a reference image and a current image side-by-side. * - \param IRef : Reference image. - \param ICurrent : Current image. - \param IMatching : Matching image for displaying all the matching between - the query keypoints and those detected in the training images. + * \param IRef : Reference image. + * \param ICurrent : Current image. + * \param IMatching : Matching image for displaying all the matching between + * the query keypoints and those detected in the training images. */ void insertImageMatching(const vpImage &IRef, const vpImage &ICurrent, vpImage &IMatching); /*! - Insert the different training images in the matching image. + * Insert the different training images in the matching image. * - \param ICurrent : Current image. - \param IMatching : Matching image for displaying all the matching between - the query keypoints and those detected in the training images + * \param ICurrent : Current image. + * \param IMatching : Matching image for displaying all the matching between + * the query keypoints and those detected in the training images */ void insertImageMatching(const vpImage &ICurrent, vpImage &IMatching); /*! - Insert a reference image and a current image side-by-side. + * Insert a reference image and a current image side-by-side. * - \param IRef : Reference image. - \param ICurrent : Current image. - \param IMatching : Matching image for displaying all the matching between - the query keypoints and those detected in the training images. + * \param IRef : Reference image. + * \param ICurrent : Current image. + * \param IMatching : Matching image for displaying all the matching between + * the query keypoints and those detected in the training images. */ void insertImageMatching(const vpImage &IRef, const vpImage &ICurrent, vpImage &IMatching); /*! - Insert the different training images in the matching image. + * Insert the different training images in the matching image. * - \param ICurrent : Current image. - \param IMatching : Matching image for displaying all the matching between - the query keypoints and those detected in the training images + * \param ICurrent : Current image. + * \param IMatching : Matching image for displaying all the matching between + * the query keypoints and those detected in the training images */ void insertImageMatching(const vpImage &ICurrent, vpImage &IMatching); /*! - Load configuration parameters from an XML config file. + * Load configuration parameters from an XML config file. * - \param configFile : Path to the XML config file. + * \param configFile : Path to the XML config file. */ void loadConfigFile(const std::string &configFile); /*! - Load learning data saved on disk. + * Load learning data saved on disk. * - \param filename : Path of the learning file. - \param binaryMode : If true, the learning file is in a binary mode, - otherwise it is in XML mode. - \param append : If true, concatenate the learning data, otherwise reset the variables. + * \param filename : Path of the learning file. + * \param binaryMode : If true, the learning file is in a binary mode, + * otherwise it is in XML mode. + * \param append : If true, concatenate the learning data, otherwise reset the variables. */ void loadLearningData(const std::string &filename, bool binaryMode = false, bool append = false); /*! - Match keypoints based on distance between their descriptors. + * Match keypoints based on distance between their descriptors. * - \param trainDescriptors : Train descriptors (or reference descriptors). - \param queryDescriptors : Query descriptors. - \param matches : Output list of matches. - \param elapsedTime : Elapsed time. + * \param trainDescriptors : Train descriptors (or reference descriptors). + * \param queryDescriptors : Query descriptors. + * \param matches : Output list of matches. + * \param elapsedTime : Elapsed time. */ void match(const cv::Mat &trainDescriptors, const cv::Mat &queryDescriptors, std::vector &matches, double &elapsedTime); /*! - Match keypoints detected in the image with those built in the reference - list. + * Match keypoints detected in the image with those built in the reference + * list. * - \param I : Input current image. - \return The number of matched keypoints. + * \param I : Input current image. + * \return The number of matched keypoints. */ unsigned int matchPoint(const vpImage &I); /*! - Match keypoints detected in a region of interest of the image with those - built in the reference list. + * Match keypoints detected in a region of interest of the image with those + * built in the reference list. * - \param I : Input image. - \param iP : Coordinate of the top-left corner of the region of interest. - \param height : Height of the region of interest. - \param width : Width of the region of interest. - \return The number of matched keypoints. + * \param I : Input image. + * \param iP : Coordinate of the top-left corner of the region of interest. + * \param height : Height of the region of interest. + * \param width : Width of the region of interest. + * \return The number of matched keypoints. */ unsigned int matchPoint(const vpImage &I, const vpImagePoint &iP, unsigned int height, unsigned int width); /*! - Match keypoints detected in a region of interest of the image with those - built in the reference list. + * Match keypoints detected in a region of interest of the image with those + * built in the reference list. * - \param I : Input image. - \param rectangle : Rectangle of the region of interest. - \return The number of matched keypoints. + * \param I : Input image. + * \param rectangle : Rectangle of the region of interest. + * \return The number of matched keypoints. */ unsigned int matchPoint(const vpImage &I, const vpRect &rectangle); /*! - Match query keypoints with those built in the reference list using buildReference(). + * Match query keypoints with those built in the reference list using buildReference(). * - \param queryKeyPoints : List of the query keypoints. - \param queryDescriptors : List of the query descriptors. - - \return The number of matched keypoints. + * \param queryKeyPoints : List of the query keypoints. + * \param queryDescriptors : List of the query descriptors. + * + * \return The number of matched keypoints. */ unsigned int matchPoint(const std::vector &queryKeyPoints, const cv::Mat &queryDescriptors); /*! - Match keypoints detected in the image with those built in the reference - list and compute the pose. + * Match keypoints detected in the image with those built in the reference + * list and compute the pose. * - \param I : Input image. - \param cam : Camera parameters. - \param cMo : Homogeneous matrix between the object frame and the camera frame. - \param func : Function pointer to filter the pose in Ransac pose - estimation, if we want to eliminate the poses which do not respect some criterion. - \param rectangle : Rectangle corresponding to the ROI (Region of Interest) to consider. - \return True if the matching and the pose estimation are OK, false otherwise. + * \param I : Input image. + * \param cam : Camera parameters. + * \param cMo : Homogeneous matrix between the object frame and the camera frame. + * \param func : Function pointer to filter the pose in Ransac pose + * estimation, if we want to eliminate the poses which do not respect some criterion. + * \param rectangle : Rectangle corresponding to the ROI (Region of Interest) to consider. + * \return True if the matching and the pose estimation are OK, false otherwise. */ bool matchPoint(const vpImage &I, const vpCameraParameters &cam, vpHomogeneousMatrix &cMo, bool (*func)(const vpHomogeneousMatrix &) = NULL, const vpRect &rectangle = vpRect()); /*! - Match keypoints detected in the image with those built in the reference - list and compute the pose. + * Match keypoints detected in the image with those built in the reference + * list and compute the pose. * - \param I : Input image. - \param cam : Camera parameters. - \param cMo : Homogeneous matrix between the object frame and the camera frame. - \param error : Reprojection mean square error (in pixel) between the - 2D points and the projection of the 3D points with the estimated pose. - \param elapsedTime : Time to detect, extract, match and compute the pose. - \param func : Function pointer to filter the pose in Ransac pose - estimation, if we want to eliminate the poses which do not respect some criterion. - \param rectangle : Rectangle corresponding to the ROI (Region of Interest) to consider. - \return True if the matching and the pose estimation are OK, false otherwise. + * \param I : Input image. + * \param cam : Camera parameters. + * \param cMo : Homogeneous matrix between the object frame and the camera frame. + * \param error : Reprojection mean square error (in pixel) between the + * 2D points and the projection of the 3D points with the estimated pose. + * \param elapsedTime : Time to detect, extract, match and compute the pose. + * \param func : Function pointer to filter the pose in Ransac pose + * estimation, if we want to eliminate the poses which do not respect some criterion. + * \param rectangle : Rectangle corresponding to the ROI (Region of Interest) to consider. + * \return True if the matching and the pose estimation are OK, false otherwise. */ bool matchPoint(const vpImage &I, const vpCameraParameters &cam, vpHomogeneousMatrix &cMo, double &error, double &elapsedTime, bool (*func)(const vpHomogeneousMatrix &) = NULL, const vpRect &rectangle = vpRect()); /*! - Match keypoints detected in the image with those built in the reference - list and return the bounding box and the center of gravity. - * - \param I : Input image. - \param boundingBox : Bounding box that contains the good matches. - \param centerOfGravity : Center of gravity computed from the location of - the good matches (could differ of the center of the bounding box). - \param isPlanarObject : If the object is planar, the homography matrix is - estimated to eliminate outliers, otherwise it is the fundamental matrix - which is estimated. - \param imPts1 : Pointer to the list of reference keypoints if not null. - \param imPts2 : Pointer to the list of current keypoints if not null. - \param meanDescriptorDistance : Pointer to the value - of the average distance of the descriptors if not null. - \param detection_score : Pointer to the value of the detection score if not null. - \param rectangle : Rectangle corresponding to the ROI (Region of Interest) - to consider. - \return True if the object is present, false otherwise. + * Match keypoints detected in the image with those built in the reference + * list and return the bounding box and the center of gravity. + * + * \param I : Input image. + * \param boundingBox : Bounding box that contains the good matches. + * \param centerOfGravity : Center of gravity computed from the location of + * the good matches (could differ of the center of the bounding box). + * \param isPlanarObject : If the object is planar, the homography matrix is + * estimated to eliminate outliers, otherwise it is the fundamental matrix + * which is estimated. + * \param imPts1 : Pointer to the list of reference keypoints if not null. + * \param imPts2 : Pointer to the list of current keypoints if not null. + * \param meanDescriptorDistance : Pointer to the value + * of the average distance of the descriptors if not null. + * \param detectionScore : Pointer to the value of the detection score if not null. + * \param rectangle : Rectangle corresponding to the ROI (Region of Interest) + * to consider. + * \return True if the object is present, false otherwise. */ bool matchPointAndDetect(const vpImage &I, vpRect &boundingBox, vpImagePoint ¢erOfGravity, const bool isPlanarObject = true, std::vector *imPts1 = NULL, @@ -1428,89 +1428,89 @@ class VISP_EXPORT vpKeyPoint : public vpBasicKeyPoint double *detectionScore = NULL, const vpRect &rectangle = vpRect()); /*! - Match keypoints detected in the image with those built in the reference - list, compute the pose and return also the bounding box and the center of - gravity. - * - \param I : Input image. - \param cam : Camera parameters. - \param cMo : Homogeneous matrix between the object frame and the camera frame. - \param error : Reprojection mean square error (in pixel) between the - 2D points and the projection of the 3D points with the estimated pose. - \param elapsedTime : Time to detect, extract, match and compute the pose. - \param boundingBox : Bounding box that contains the good matches. - \param centerOfGravity : Center of gravity computed from the location of - the good matches (could differ of the center of the bounding box). - \param func : Function pointer to filter the pose in Ransac pose estimation, if we - want to eliminate the poses which do not respect some criterion. - \param rectangle : Rectangle corresponding to the ROI (Region of Interest) to consider. - \return True if the matching and the pose estimation are OK, false otherwise. - */ + * Match keypoints detected in the image with those built in the reference + * list, compute the pose and return also the bounding box and the center of + * gravity. + * + * \param I : Input image. + * \param cam : Camera parameters. + * \param cMo : Homogeneous matrix between the object frame and the camera frame. + * \param error : Reprojection mean square error (in pixel) between the + * 2D points and the projection of the 3D points with the estimated pose. + * \param elapsedTime : Time to detect, extract, match and compute the pose. + * \param boundingBox : Bounding box that contains the good matches. + * \param centerOfGravity : Center of gravity computed from the location of + * the good matches (could differ of the center of the bounding box). + * \param func : Function pointer to filter the pose in Ransac pose estimation, if we + * want to eliminate the poses which do not respect some criterion. + * \param rectangle : Rectangle corresponding to the ROI (Region of Interest) to consider. + * \return True if the matching and the pose estimation are OK, false otherwise. + */ bool matchPointAndDetect(const vpImage &I, const vpCameraParameters &cam, vpHomogeneousMatrix &cMo, double &error, double &elapsedTime, vpRect &boundingBox, vpImagePoint ¢erOfGravity, bool (*func)(const vpHomogeneousMatrix &) = NULL, const vpRect &rectangle = vpRect()); /*! - Match keypoints detected in the image with those built in the reference - list. + * Match keypoints detected in the image with those built in the reference + * list. * - \param I_color : Input current image. - \return The number of matched keypoints. + * \param I_color : Input current image. + * \return The number of matched keypoints. */ unsigned int matchPoint(const vpImage &I_color); /*! - Match keypoints detected in a region of interest of the image with those - built in the reference list. + * Match keypoints detected in a region of interest of the image with those + * built in the reference list. * - \param I_color : Input image. - \param iP : Coordinate of the top-left corner of the region of interest. - \param height : Height of the region of interest. - \param width : Width of the region of interest. - \return The number of matched keypoints. + * \param I_color : Input image. + * \param iP : Coordinate of the top-left corner of the region of interest. + * \param height : Height of the region of interest. + * \param width : Width of the region of interest. + * \return The number of matched keypoints. */ unsigned int matchPoint(const vpImage &I_color, const vpImagePoint &iP, unsigned int height, unsigned int width); /*! - Match keypoints detected in a region of interest of the image with those - built in the reference list. + * Match keypoints detected in a region of interest of the image with those + * built in the reference list. * - \param I_color : Input image. - \param rectangle : Rectangle of the region of interest. - \return The number of matched keypoints. + * \param I_color : Input image. + * \param rectangle : Rectangle of the region of interest. + * \return The number of matched keypoints. */ unsigned int matchPoint(const vpImage &I_color, const vpRect &rectangle); /*! - Match keypoints detected in the image with those built in the reference - list and compute the pose. + * Match keypoints detected in the image with those built in the reference + * list and compute the pose. * - \param I_color : Input image. - \param cam : Camera parameters. - \param cMo : Homogeneous matrix between the object frame and the camera frame. - \param func : Function pointer to filter the pose in Ransac pose - estimation, if we want to eliminate the poses which do not respect some criterion. - \param rectangle : Rectangle corresponding to the ROI (Region of Interest) to consider. - \return True if the matching and the pose estimation are OK, false otherwise. + * \param I_color : Input image. + * \param cam : Camera parameters. + * \param cMo : Homogeneous matrix between the object frame and the camera frame. + * \param func : Function pointer to filter the pose in Ransac pose + * estimation, if we want to eliminate the poses which do not respect some criterion. + * \param rectangle : Rectangle corresponding to the ROI (Region of Interest) to consider. + * \return True if the matching and the pose estimation are OK, false otherwise. */ bool matchPoint(const vpImage &I_color, const vpCameraParameters &cam, vpHomogeneousMatrix &cMo, bool (*func)(const vpHomogeneousMatrix &) = NULL, const vpRect &rectangle = vpRect()); /*! - Match keypoints detected in the image with those built in the reference - list and compute the pose. + * Match keypoints detected in the image with those built in the reference + * list and compute the pose. * - \param I_color : Input image. - \param cam : Camera parameters. - \param cMo : Homogeneous matrix between the object frame and the camera frame. - \param error : Reprojection mean square error (in pixel) between the - 2D points and the projection of the 3D points with the estimated pose. - \param elapsedTime : Time to detect, extract, match and compute the pose. - \param func : Function pointer to filter the pose in Ransac pose - estimation, if we want to eliminate the poses which do not respect some criterion. - \param rectangle : Rectangle corresponding to the ROI (Region of Interest) to consider. - \return True if the matching and the pose estimation are OK, false otherwise. + * \param I_color : Input image. + * \param cam : Camera parameters. + * \param cMo : Homogeneous matrix between the object frame and the camera frame. + * \param error : Reprojection mean square error (in pixel) between the + * 2D points and the projection of the 3D points with the estimated pose. + * \param elapsedTime : Time to detect, extract, match and compute the pose. + * \param func : Function pointer to filter the pose in Ransac pose + * estimation, if we want to eliminate the poses which do not respect some criterion. + * \param rectangle : Rectangle corresponding to the ROI (Region of Interest) to consider. + * \return True if the matching and the pose estimation are OK, false otherwise. */ bool matchPoint(const vpImage &I_color, const vpCameraParameters &cam, vpHomogeneousMatrix &cMo, double &error, double &elapsedTime, bool (*func)(const vpHomogeneousMatrix &) = NULL, @@ -1522,12 +1522,12 @@ class VISP_EXPORT vpKeyPoint : public vpBasicKeyPoint void reset(); /*! - Save the learning data in a file in XML or binary mode. + * Save the learning data in a file in XML or binary mode. * - \param filename : Path of the save file. - \param binaryMode : If true, the data are saved in binary mode, otherwise - in XML mode. - \param saveTrainingImages : If true, save also the training images on disk. + * \param filename : Path of the save file. + * \param binaryMode : If true, the data are saved in binary mode, otherwise + * in XML mode. + * \param saveTrainingImages : If true, save also the training images on disk. */ void saveLearningData(const std::string &filename, bool binaryMode = false, bool saveTrainingImages = true); @@ -2107,18 +2107,18 @@ class VISP_EXPORT vpKeyPoint : public vpBasicKeyPoint void affineSkew(double tilt, double phi, cv::Mat &img, cv::Mat &mask, cv::Mat &Ai); /*! - Compute the pose estimation error, the mean square error (in pixel) between - the location of the detected keypoints and the location of the projection - of the 3D model with the estimated pose. + * Compute the pose estimation error, the mean square error (in pixel) between + * the location of the detected keypoints and the location of the projection + * of the 3D model with the estimated pose. * - \param matchKeyPoints : List of pairs between the detected keypoints and - the corresponding 3D points. - \param cam : Camera parameters. - \param cMo_est : Estimated pose of the object. + * \param matchKeyPoints : List of pairs between the detected keypoints and + * the corresponding 3D points. + * \param cam : Camera parameters. + * \param cMo_est : Estimated pose of the object. * - \return The mean square error (in pixel) between the location of the - detected keypoints and the location of the projection of the 3D model with - the estimated pose. + * \return The mean square error (in pixel) between the location of the + * detected keypoints and the location of the projection of the 3D model with + * the estimated pose. */ double computePoseEstimationError(const std::vector > &matchKeyPoints, const vpCameraParameters &cam, const vpHomogeneousMatrix &cMo_est); @@ -2129,38 +2129,38 @@ class VISP_EXPORT vpKeyPoint : public vpBasicKeyPoint void filterMatches(); /*! - Initialize method for RANSAC parameters and for detectors, extractors and - matcher, and for others parameters. + * Initialize method for RANSAC parameters and for detectors, extractors and + * matcher, and for others parameters. */ void init(); /*! - Initialize a keypoint detector based on its name. + * Initialize a keypoint detector based on its name. * - \param detectorName : Name of the detector (e.g FAST, SIFT, SURF, etc.). + * \param detectorName : Name of the detector (e.g FAST, SIFT, SURF, etc.). */ void initDetector(const std::string &detectorNames); /*! - Initialize a list of keypoints detectors if we want to concatenate multiple - detectors. + * Initialize a list of keypoints detectors if we want to concatenate multiple + * detectors. * - \param detectorNames : List of detector names. + * \param detectorNames : List of detector names. */ void initDetectors(const std::vector &detectorNames); /*! - Initialize a descriptor extractor based on its name. + * Initialize a descriptor extractor based on its name. * - \param extractorName : Name of the extractor (e.g SIFT, SURF, ORB, etc.). + * \param extractorName : Name of the extractor (e.g SIFT, SURF, ORB, etc.). */ void initExtractor(const std::string &extractorName); /*! - Initialize a list of descriptor extractors if we want to concatenate - multiple extractors. + * Initialize a list of descriptor extractors if we want to concatenate + * multiple extractors. * - \param extractorNames : List of extractor names. + * \param extractorNames : List of extractor names. */ void initExtractors(const std::vector &extractorNames); diff --git a/modules/vision/src/key-point/vpKeyPoint.cpp b/modules/vision/src/key-point/vpKeyPoint.cpp index c459d95982..ce49956d51 100644 --- a/modules/vision/src/key-point/vpKeyPoint.cpp +++ b/modules/vision/src/key-point/vpKeyPoint.cpp @@ -3266,7 +3266,7 @@ bool vpKeyPoint::matchPoint(const vpImage &I_color, const vpCameraParame bool vpKeyPoint::matchPointAndDetect(const vpImage &I, vpRect &boundingBox, vpImagePoint ¢erOfGravity, const bool isPlanarObject, std::vector *imPts1, std::vector *imPts2, - double *meanDescriptorDistance, double *detection_score, const vpRect &rectangle) + double *meanDescriptorDistance, double *detectionScore, const vpRect &rectangle) { if (imPts1 != NULL && imPts2 != NULL) { imPts1->clear(); @@ -3286,8 +3286,8 @@ bool vpKeyPoint::matchPointAndDetect(const vpImage &I, vpRect &bo if (meanDescriptorDistance != NULL) { *meanDescriptorDistance = meanDescriptorDistanceTmp; } - if (detection_score != NULL) { - *detection_score = score; + if (detectionScore != NULL) { + *detectionScore = score; } if (m_filteredMatches.size() >= 4) { diff --git a/modules/visual_features/include/visp3/visual_features/vpFeatureMomentCentered.h b/modules/visual_features/include/visp3/visual_features/vpFeatureMomentCentered.h index 2733ea9d0b..d48712d45d 100644 --- a/modules/visual_features/include/visp3/visual_features/vpFeatureMomentCentered.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureMomentCentered.h @@ -58,8 +58,9 @@ class vpMomentDatabase; * (i,j). * * vpFeatureMomentCentered computes interaction matrices all interaction - * matrices up to vpMomentObject::getOrder()-1. \attention The maximum order - * reached by vpFeatureMomentBasic is NOT the maximum order of the + * matrices up to vpMomentObject::getOrder()-1. + * + * \attention The maximum order reached by vpFeatureMomentBasic is NOT the maximum order of the * vpMomentObject, it is one unit smaller. For example if you define your * vpMomentObject up to order n then vpFeatureMomentBasic will be able to * compute interaction matrices up to order n-1 that is \f$ L_{m_{ij}} \f$ with @@ -72,7 +73,6 @@ class vpMomentDatabase; */ class VISP_EXPORT vpFeatureMomentCentered : public vpFeatureMoment { - protected: unsigned int order; /*! @@ -94,12 +94,7 @@ class VISP_EXPORT vpFeatureMomentCentered : public vpFeatureMoment throw vpException(vpException::functionNotImplementedError, "Not implemented!"); } #endif - /*! - * Interaction matrix corresponding to \f$ \mu_{ij} \f$ moment - * \param select_one : first index (i) - * \param select_two : second index (j) - * \return Interaction matrix corresponding to the moment - */ + vpMatrix interaction(unsigned int select_one, unsigned int select_two) const; /*! diff --git a/modules/visual_features/src/visual-feature/vpFeatureMomentCentered.cpp b/modules/visual_features/src/visual-feature/vpFeatureMomentCentered.cpp index 7373e2f280..a6642f887f 100644 --- a/modules/visual_features/src/visual-feature/vpFeatureMomentCentered.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureMomentCentered.cpp @@ -45,7 +45,7 @@ #include /*! - * Default constructor + * Default constructor. * \param moments_ : Database of moment primitives. * \param A_ : First plane coefficient for a plane equation of the following type Ax+By+C=1/Z. * \param B_ : Second plane coefficient for a plane equation of the following type Ax+By+C=1/Z. @@ -58,7 +58,7 @@ vpFeatureMomentCentered::vpFeatureMomentCentered(vpMomentDatabase &moments_, dou { } /*! - * Interaction matrix corresponding to \f$ \mu_{ij} \f$ moment + * Interaction matrix corresponding to \f$ \mu_{ij} \f$ moment. * \param select_one : first index (i). * \param select_two : second index (j). * \return Interaction matrix corresponding to the moment.