33 #ifndef _vpKeyPoint_h_
34 #define _vpKeyPoint_h_
46 #include <visp3/core/vpConfig.h>
47 #include <visp3/core/vpDisplay.h>
48 #include <visp3/core/vpImageConvert.h>
49 #include <visp3/core/vpPixelMeterConversion.h>
50 #include <visp3/core/vpPlane.h>
51 #include <visp3/core/vpPoint.h>
52 #include <visp3/vision/vpBasicKeyPoint.h>
53 #include <visp3/vision/vpPose.h>
54 #ifdef VISP_HAVE_MODULE_IO
55 #include <visp3/io/vpImageIo.h>
57 #include <visp3/core/vpConvert.h>
58 #include <visp3/core/vpCylinder.h>
59 #include <visp3/core/vpMeterPixelConversion.h>
60 #include <visp3/core/vpPolygon.h>
61 #include <visp3/vision/vpXmlConfigParserKeyPoint.h>
64 #if defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_FEATURES2D)
65 #include <opencv2/features2d/features2d.hpp>
66 #include <opencv2/imgproc/imgproc.hpp>
67 #include <opencv2/imgproc/imgproc_c.h>
69 #if defined(VISP_HAVE_OPENCV_XFEATURES2D)
70 #include <opencv2/xfeatures2d.hpp>
71 #elif defined(VISP_HAVE_OPENCV_NONFREE) && (VISP_HAVE_OPENCV_VERSION >= 0x020400) && \
72 (VISP_HAVE_OPENCV_VERSION < 0x030000)
73 #include <opencv2/nonfree/nonfree.hpp>
226 constantFactorDistanceThreshold,
228 stdDistanceThreshold,
230 ratioDistanceThreshold,
233 stdAndRatioDistanceThreshold,
260 #if (VISP_HAVE_OPENCV_VERSION >= 0x020403)
267 #if (VISP_HAVE_OPENCV_VERSION < 0x030000) || (defined(VISP_HAVE_OPENCV_XFEATURES2D))
270 #if defined(VISP_HAVE_OPENCV_NONFREE) || defined(VISP_HAVE_OPENCV_XFEATURES2D) || \
271 (VISP_HAVE_OPENCV_VERSION >= 0x030411 && CV_MAJOR_VERSION < 4) || (VISP_HAVE_OPENCV_VERSION >= 0x040400)
274 #if defined(VISP_HAVE_OPENCV_NONFREE) || defined(VISP_HAVE_OPENCV_XFEATURES2D)
277 #if (VISP_HAVE_OPENCV_VERSION >= 0x030000)
282 #if (VISP_HAVE_OPENCV_VERSION >= 0x030100) && defined(VISP_HAVE_OPENCV_XFEATURES2D)
292 #if (VISP_HAVE_OPENCV_VERSION >= 0x020403)
295 #if (VISP_HAVE_OPENCV_VERSION < 0x030000) || (defined(VISP_HAVE_OPENCV_XFEATURES2D))
299 #if defined(VISP_HAVE_OPENCV_NONFREE) || defined(VISP_HAVE_OPENCV_XFEATURES2D) || \
300 (VISP_HAVE_OPENCV_VERSION >= 0x030411 && CV_MAJOR_VERSION < 4) || (VISP_HAVE_OPENCV_VERSION >= 0x040400)
303 #if defined(VISP_HAVE_OPENCV_NONFREE) || defined(VISP_HAVE_OPENCV_XFEATURES2D)
306 #if (VISP_HAVE_OPENCV_VERSION >= 0x030000)
309 #if defined(VISP_HAVE_OPENCV_XFEATURES2D)
314 #if (VISP_HAVE_OPENCV_VERSION >= 0x030200) && defined(VISP_HAVE_OPENCV_XFEATURES2D)
316 DESCRIPTOR_BoostDesc,
331 vpKeyPoint(
const vpFeatureDetectorType &detectorType,
const vpFeatureDescriptorType &descriptorType,
332 const std::string &matcherName,
const vpFilterMatchingType &filterType = ratioDistanceThreshold);
343 vpKeyPoint(
const std::string &detectorName =
"ORB",
const std::string &extractorName =
"ORB",
344 const std::string &matcherName =
"BruteForce-Hamming",
345 const vpFilterMatchingType &filterType = ratioDistanceThreshold);
356 vpKeyPoint(
const std::vector<std::string> &detectorNames,
const std::vector<std::string> &extractorNames,
357 const std::string &matcherName =
"BruteForce",
358 const vpFilterMatchingType &filterType = ratioDistanceThreshold);
401 std::vector<cv::Point3f> &points3f,
bool append =
false,
int class_id = -1);
417 const cv::Mat &trainDescriptors,
const std::vector<cv::Point3f> &points3f,
418 bool append =
false,
int class_id = -1);
461 std::vector<cv::Point3f> &points3f,
bool append =
false,
int class_id = -1);
476 const cv::Mat &trainDescriptors,
const std::vector<cv::Point3f> &points3f,
477 bool append =
false,
int class_id = -1);
494 static void compute3D(
const cv::KeyPoint &candidate,
const std::vector<vpPoint> &roi,
const vpCameraParameters &cam,
532 std::vector<cv::KeyPoint> &candidates,
533 const std::vector<vpPolygon> &polygons,
534 const std::vector<std::vector<vpPoint> > &roisPt,
535 std::vector<cv::Point3f> &points, cv::Mat *descriptors =
nullptr);
554 std::vector<vpImagePoint> &candidates,
555 const std::vector<vpPolygon> &polygons,
556 const std::vector<std::vector<vpPoint> > &roisPt,
557 std::vector<vpPoint> &points, cv::Mat *descriptors =
nullptr);
576 std::vector<cv::KeyPoint> &candidates,
const std::vector<vpCylinder> &cylinders,
577 const std::vector<std::vector<std::vector<vpImagePoint> > > &vectorOfCylinderRois,
578 std::vector<cv::Point3f> &points, cv::Mat *descriptors =
nullptr);
597 std::vector<vpImagePoint> &candidates,
const std::vector<vpCylinder> &cylinders,
598 const std::vector<std::vector<std::vector<vpImagePoint> > > &vectorOfCylinderRois,
599 std::vector<vpPoint> &points, cv::Mat *descriptors =
nullptr);
614 bool computePose(
const std::vector<cv::Point2f> &imagePoints,
const std::vector<cv::Point3f> &objectPoints,
630 bool computePose(
const std::vector<vpPoint> &objectVpPoints,
vpHomogeneousMatrix &cMo, std::vector<vpPoint> &inliers,
646 bool computePose(
const std::vector<vpPoint> &objectVpPoints,
vpHomogeneousMatrix &cMo, std::vector<vpPoint> &inliers,
647 std::vector<unsigned int> &inlierIndex,
double &elapsedTime,
719 void detect(
const cv::Mat &matImg, std::vector<cv::KeyPoint> &keyPoints,
const cv::Mat &mask = cv::Mat());
740 void detect(
const vpImage<vpRGBa> &I_color, std::vector<cv::KeyPoint> &keyPoints,
double &elapsedTime,
751 void detect(
const cv::Mat &matImg, std::vector<cv::KeyPoint> &keyPoints,
double &elapsedTime,
752 const cv::Mat &mask = cv::Mat());
768 void detectExtractAffine(
const vpImage<unsigned char> &I, std::vector<std::vector<cv::KeyPoint> > &listOfKeypoints,
769 std::vector<cv::Mat> &listOfDescriptors,
834 const std::vector<vpImagePoint> &ransacInliers = std::vector<vpImagePoint>(),
835 unsigned int crossSize = 3,
unsigned int lineThickness = 1);
877 const std::vector<vpImagePoint> &ransacInliers = std::vector<vpImagePoint>(),
878 unsigned int crossSize = 3,
unsigned int lineThickness = 1);
891 std::vector<cv::Point3f> *trainPoints =
nullptr);
903 void extract(
const vpImage<vpRGBa> &I_color, std::vector<cv::KeyPoint> &keyPoints, cv::Mat &descriptors,
904 std::vector<cv::Point3f> *trainPoints =
nullptr);
916 void extract(
const cv::Mat &matImg, std::vector<cv::KeyPoint> &keyPoints, cv::Mat &descriptors,
917 std::vector<cv::Point3f> *trainPoints =
nullptr);
931 double &elapsedTime, std::vector<cv::Point3f> *trainPoints =
nullptr);
944 void extract(
const vpImage<vpRGBa> &I_color, std::vector<cv::KeyPoint> &keyPoints, cv::Mat &descriptors,
945 double &elapsedTime, std::vector<cv::Point3f> *trainPoints =
nullptr);
958 void extract(
const cv::Mat &matImg, std::vector<cv::KeyPoint> &keyPoints, cv::Mat &descriptors,
double &elapsedTime,
959 std::vector<cv::Point3f> *trainPoints =
nullptr);
972 if (!m_computeCovariance) {
973 std::cout <<
"Warning : The covariance matrix has not been computed. "
974 "See setCovarianceComputation() to do it."
979 if (m_computeCovariance && !m_useRansacVVS) {
980 std::cout <<
"Warning : The covariance matrix can only be computed "
981 "with a Virtual Visual Servoing approach."
983 <<
"Use setUseRansacVVS(true) to choose to use a pose "
984 "estimation method based on a Virtual Visual Servoing "
990 return m_covarianceMatrix;
1009 std::map<vpFeatureDetectorType, std::string>::const_iterator it_name = m_mapOfDetectorNames.find(type);
1010 if (it_name == m_mapOfDetectorNames.end()) {
1011 std::cerr <<
"Internal problem with the feature type and the "
1012 "corresponding name!"
1016 std::map<std::string, cv::Ptr<cv::FeatureDetector> >::const_iterator findDetector =
1017 m_detectors.find(it_name->second);
1018 if (findDetector != m_detectors.end()) {
1019 return findDetector->second;
1022 std::cerr <<
"Cannot find: " << it_name->second << std::endl;
1023 return cv::Ptr<cv::FeatureDetector>();
1033 inline cv::Ptr<cv::FeatureDetector>
getDetector(
const std::string &name)
const
1035 std::map<std::string, cv::Ptr<cv::FeatureDetector> >::const_iterator findDetector = m_detectors.find(name);
1036 if (findDetector != m_detectors.end()) {
1037 return findDetector->second;
1040 std::cerr <<
"Cannot find: " << name << std::endl;
1041 return cv::Ptr<cv::FeatureDetector>();
1047 inline std::map<vpFeatureDetectorType, std::string>
getDetectorNames()
const {
return m_mapOfDetectorNames; }
1065 std::map<vpFeatureDescriptorType, std::string>::const_iterator it_name = m_mapOfDescriptorNames.find(type);
1066 if (it_name == m_mapOfDescriptorNames.end()) {
1067 std::cerr <<
"Internal problem with the feature type and the "
1068 "corresponding name!"
1072 std::map<std::string, cv::Ptr<cv::DescriptorExtractor> >::const_iterator findExtractor =
1073 m_extractors.find(it_name->second);
1074 if (findExtractor != m_extractors.end()) {
1075 return findExtractor->second;
1078 std::cerr <<
"Cannot find: " << it_name->second << std::endl;
1079 return cv::Ptr<cv::DescriptorExtractor>();
1089 inline cv::Ptr<cv::DescriptorExtractor>
getExtractor(
const std::string &name)
const
1091 std::map<std::string, cv::Ptr<cv::DescriptorExtractor> >::const_iterator findExtractor = m_extractors.find(name);
1092 if (findExtractor != m_extractors.end()) {
1093 return findExtractor->second;
1096 std::cerr <<
"Cannot find: " << name << std::endl;
1097 return cv::Ptr<cv::DescriptorExtractor>();
1103 inline std::map<vpFeatureDescriptorType, std::string>
getExtractorNames()
const {
return m_mapOfDescriptorNames; }
1124 inline cv::Ptr<cv::DescriptorMatcher>
getMatcher()
const {
return m_matcher; }
1132 inline std::vector<cv::DMatch>
getMatches()
const {
return m_filteredMatches; }
1143 std::vector<std::pair<cv::KeyPoint, cv::KeyPoint> > matchQueryToTrainKeyPoints(m_filteredMatches.size());
1144 for (
size_t i = 0; i < m_filteredMatches.size(); i++) {
1145 matchQueryToTrainKeyPoints.push_back(
1146 std::pair<cv::KeyPoint, cv::KeyPoint>(m_queryFilteredKeyPoints[(
size_t)m_filteredMatches[i].queryIdx],
1147 m_trainKeyPoints[(
size_t)m_filteredMatches[i].trainIdx]));
1149 return matchQueryToTrainKeyPoints;
1157 inline unsigned int getNbImages()
const {
return static_cast<unsigned int>(m_mapOfImages.size()); }
1166 void getObjectPoints(std::vector<cv::Point3f> &objectPoints)
const;
1175 void getObjectPoints(std::vector<vpPoint> &objectPoints)
const;
1200 void getQueryKeyPoints(std::vector<cv::KeyPoint> &keyPoints,
bool matches =
true)
const;
1210 void getQueryKeyPoints(std::vector<vpImagePoint> &keyPoints,
bool matches =
true)
const;
1239 void getTrainKeyPoints(std::vector<cv::KeyPoint> &keyPoints)
const;
1246 void getTrainKeyPoints(std::vector<vpImagePoint> &keyPoints)
const;
1254 void getTrainPoints(std::vector<cv::Point3f> &points)
const;
1262 void getTrainPoints(std::vector<vpPoint> &points)
const;
1269 void initMatcher(
const std::string &matcherName);
1315 void loadConfigFile(
const std::string &configFile);
1325 void loadLearningData(
const std::string &filename,
bool binaryMode =
false,
bool append =
false);
1335 void match(
const cv::Mat &trainDescriptors,
const cv::Mat &queryDescriptors, std::vector<cv::DMatch> &matches,
1336 double &elapsedTime);
1358 unsigned int width);
1378 unsigned int matchPoint(
const std::vector<cv::KeyPoint> &queryKeyPoints,
const cv::Mat &queryDescriptors);
1435 const bool isPlanarObject =
true, std::vector<vpImagePoint> *imPts1 =
nullptr,
1436 std::vector<vpImagePoint> *imPts2 =
nullptr,
double *meanDescriptorDistance =
nullptr,
1437 double *detectionScore =
nullptr,
const vpRect &rectangle =
vpRect());
1459 double &error,
double &elapsedTime,
vpRect &boundingBox,
vpImagePoint ¢erOfGravity,
1482 unsigned int width);
1541 void saveLearningData(
const std::string &filename,
bool binaryMode =
false,
bool saveTrainingImages =
true);
1551 m_computeCovariance = flag;
1552 if (!m_useRansacVVS) {
1553 std::cout <<
"Warning : The covariance matrix can only be computed "
1554 "with a Virtual Visual Servoing approach."
1556 <<
"Use setUseRansacVVS(true) to choose to use a pose "
1557 "estimation method based on a Virtual "
1558 "Visual Servoing approach."
1577 m_detectorNames.clear();
1578 m_detectorNames.push_back(m_mapOfDetectorNames[detectorType]);
1579 m_detectors.clear();
1580 initDetector(m_mapOfDetectorNames[detectorType]);
1590 m_detectorNames.clear();
1591 m_detectorNames.push_back(detectorName);
1592 m_detectors.clear();
1593 initDetector(detectorName);
1596 #if (VISP_HAVE_OPENCV_VERSION >= 0x020400 && VISP_HAVE_OPENCV_VERSION < 0x030000)
1605 template <
typename T1,
typename T2,
typename T3>
1606 inline void setDetectorParameter(
const T1 detectorName,
const T2 parameterName,
const T3 value)
1608 if (m_detectors.find(detectorName) != m_detectors.end()) {
1609 m_detectors[detectorName]->set(parameterName, value);
1622 m_detectorNames.clear();
1623 m_detectors.clear();
1624 m_detectorNames = detectorNames;
1625 initDetectors(m_detectorNames);
1635 m_extractorNames.clear();
1636 m_extractorNames.push_back(m_mapOfDescriptorNames[extractorType]);
1637 m_extractors.clear();
1638 initExtractor(m_mapOfDescriptorNames[extractorType]);
1649 m_extractorNames.clear();
1650 m_extractorNames.push_back(extractorName);
1651 m_extractors.clear();
1652 initExtractor(extractorName);
1655 #if (VISP_HAVE_OPENCV_VERSION >= 0x020400 && VISP_HAVE_OPENCV_VERSION < 0x030000)
1664 template <
typename T1,
typename T2,
typename T3>
1665 inline void setExtractorParameter(
const T1 extractorName,
const T2 parameterName,
const T3 value)
1667 if (m_extractors.find(extractorName) != m_extractors.end()) {
1668 m_extractors[extractorName]->set(parameterName, value);
1681 m_extractorNames.clear();
1682 m_extractorNames = extractorNames;
1683 m_extractors.clear();
1684 initExtractors(m_extractorNames);
1711 m_matcherName = matcherName;
1712 initMatcher(m_matcherName);
1739 m_filterType = filterType;
1743 if (filterType == ratioDistanceThreshold || filterType == stdAndRatioDistanceThreshold) {
1746 #if (VISP_HAVE_OPENCV_VERSION >= 0x020400 && VISP_HAVE_OPENCV_VERSION < 0x030000)
1747 if (m_matcher !=
nullptr && m_matcherName ==
"BruteForce") {
1750 m_matcher->set(
"crossCheck",
false);
1757 #if (VISP_HAVE_OPENCV_VERSION >= 0x020400 && VISP_HAVE_OPENCV_VERSION < 0x030000)
1758 if (m_matcher !=
nullptr && m_matcherName ==
"BruteForce") {
1761 m_matcher->set(
"crossCheck", m_useBruteForceCrossCheck);
1776 m_matchingFactorThreshold = factor;
1790 if (ratio > 0.0 && (ratio < 1.0 || std::fabs(ratio - 1.0) < std::numeric_limits<double>::epsilon())) {
1791 m_matchingRatioThreshold = ratio;
1806 if (percentage > 0.0 &&
1807 (percentage < 100.0 || std::fabs(percentage - 100.0) < std::numeric_limits<double>::epsilon())) {
1808 m_ransacConsensusPercentage = percentage;
1829 m_nbRansacIterations = nbIter;
1860 if (reprojectionError > 0.0) {
1861 m_ransacReprojectionError = reprojectionError;
1865 "threshold must be positive "
1866 "as we deal with distance.");
1878 m_nbRansacMinInlierCount = minCount;
1893 if (threshold > 0.0) {
1894 m_ransacThreshold = threshold;
1910 #if (VISP_HAVE_OPENCV_VERSION >= 0x020400 && VISP_HAVE_OPENCV_VERSION < 0x030000)
1917 inline void setUseBruteForceCrossCheck(
bool useCrossCheck)
1921 if (m_matcher !=
nullptr && !m_useKnn && m_matcherName ==
"BruteForce") {
1922 m_matcher->set(
"crossCheck", useCrossCheck);
1924 else if (m_matcher !=
nullptr && m_useKnn && m_matcherName ==
"BruteForce") {
1925 std::cout <<
"Warning, you try to set the crossCheck parameter with a "
1926 "BruteForce matcher but knn is enabled";
1927 std::cout <<
" (the filtering method uses a ratio constraint)" << std::endl;
1969 bool m_computeCovariance;
1973 int m_currentImageId;
1976 vpDetectionMethodType m_detectionMethod;
1978 double m_detectionScore;
1981 double m_detectionThreshold;
1983 double m_detectionTime;
1985 std::vector<std::string> m_detectorNames;
1989 std::map<std::string, cv::Ptr<cv::FeatureDetector> > m_detectors;
1991 double m_extractionTime;
1993 std::vector<std::string> m_extractorNames;
1997 std::map<std::string, cv::Ptr<cv::DescriptorExtractor> > m_extractors;
1999 std::vector<cv::DMatch> m_filteredMatches;
2001 vpFilterMatchingType m_filterType;
2003 vpImageFormatType m_imageFormat;
2006 std::vector<std::vector<cv::DMatch> > m_knnMatches;
2008 std::map<vpFeatureDescriptorType, std::string> m_mapOfDescriptorNames;
2010 std::map<vpFeatureDetectorType, std::string> m_mapOfDetectorNames;
2013 std::map<int, int> m_mapOfImageId;
2016 std::map<int, vpImage<unsigned char> > m_mapOfImages;
2019 cv::Ptr<cv::DescriptorMatcher> m_matcher;
2021 std::string m_matcherName;
2023 std::vector<cv::DMatch> m_matches;
2025 double m_matchingFactorThreshold;
2027 double m_matchingRatioThreshold;
2029 double m_matchingTime;
2031 std::vector<std::pair<cv::KeyPoint, cv::Point3f> > m_matchRansacKeyPointsToPoints;
2033 int m_nbRansacIterations;
2035 int m_nbRansacMinInlierCount;
2038 std::vector<cv::Point3f> m_objectFilteredPoints;
2043 cv::Mat m_queryDescriptors;
2045 std::vector<cv::KeyPoint> m_queryFilteredKeyPoints;
2047 std::vector<cv::KeyPoint> m_queryKeyPoints;
2050 double m_ransacConsensusPercentage;
2054 std::vector<vpImagePoint> m_ransacInliers;
2056 std::vector<vpImagePoint> m_ransacOutliers;
2058 bool m_ransacParallel;
2060 unsigned int m_ransacParallelNbThreads;
2063 double m_ransacReprojectionError;
2066 double m_ransacThreshold;
2070 cv::Mat m_trainDescriptors;
2072 std::vector<cv::KeyPoint> m_trainKeyPoints;
2075 std::vector<cv::Point3f> m_trainPoints;
2078 std::vector<vpPoint> m_trainVpPoints;
2081 bool m_useAffineDetection;
2082 #if (VISP_HAVE_OPENCV_VERSION >= 0x020400 && VISP_HAVE_OPENCV_VERSION < 0x030000)
2086 bool m_useBruteForceCrossCheck;
2090 bool m_useConsensusPercentage;
2097 bool m_useMatchTrainToQuery;
2099 bool m_useRansacVVS;
2102 bool m_useSingleMatchFilter;
2116 void affineSkew(
double tilt,
double phi, cv::Mat &img, cv::Mat &mask, cv::Mat &Ai);
2132 double computePoseEstimationError(
const std::vector<std::pair<cv::KeyPoint, cv::Point3f> > &matchKeyPoints,
2138 void filterMatches();
2151 void initDetector(
const std::string &detectorNames);
2159 void initDetectors(
const std::vector<std::string> &detectorNames);
2166 void initExtractor(
const std::string &extractorName);
2174 void initExtractors(
const std::vector<std::string> &extractorNames);
2179 void initFeatureNames();
2181 inline size_t myKeypointHash(
const cv::KeyPoint &kp)
2183 size_t _Val = 2166136261U, scale = 16777619U;
2186 _Val = (scale * _Val) ^ u.u;
2188 _Val = (scale * _Val) ^ u.u;
2190 _Val = (scale * _Val) ^ u.u;
2196 _Val = (scale * _Val) ^ u.u;
2197 _Val = (scale * _Val) ^ ((
size_t)kp.octave);
2198 _Val = (scale * _Val) ^ ((
size_t)kp.class_id);
2202 #if (VISP_HAVE_OPENCV_VERSION >= 0x030000)
2208 class PyramidAdaptedFeatureDetector :
public cv::FeatureDetector
2212 PyramidAdaptedFeatureDetector(
const cv::Ptr<cv::FeatureDetector> &detector,
int maxLevel = 2);
2215 virtual bool empty()
const;
2218 virtual void detect(cv::InputArray image, CV_OUT std::vector<cv::KeyPoint> &keypoints,
2219 cv::InputArray mask = cv::noArray());
2220 virtual void detectImpl(
const cv::Mat &image, std::vector<cv::KeyPoint> &keypoints,
2221 const cv::Mat &mask = cv::Mat())
const;
2223 cv::Ptr<cv::FeatureDetector> m_detector;
2233 class KeyPointsFilter
2236 KeyPointsFilter() { }
2241 static void runByImageBorder(std::vector<cv::KeyPoint> &keypoints, cv::Size imageSize,
int borderSize);
2245 static void runByKeypointSize(std::vector<cv::KeyPoint> &keypoints,
float minSize,
float maxSize = FLT_MAX);
2249 static void runByPixelsMask(std::vector<cv::KeyPoint> &keypoints,
const cv::Mat &mask);
2253 static void removeDuplicated(std::vector<cv::KeyPoint> &keypoints);
2259 static void retainBest(std::vector<cv::KeyPoint> &keypoints,
int npoints);
class that defines what is a keypoint. This class provides all the basic elements to implement classe...
virtual unsigned int buildReference(const vpImage< unsigned char > &I)=0
virtual unsigned int matchPoint(const vpImage< unsigned char > &I)=0
virtual void display(const vpImage< unsigned char > &Iref, const vpImage< unsigned char > &Icurrent, unsigned int size=3)=0
Generic class defining intrinsic camera parameters.
Class to define RGB colors available for display functionalities.
static const vpColor green
error that can be emitted by ViSP classes.
@ badValue
Used to indicate that a value is not in the allowed range.
Implementation of an homogeneous matrix and operations on such kind of matrices.
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Class that allows keypoints detection (and descriptors extraction) and matching thanks to OpenCV libr...
double getDetectionTime() const
std::vector< vpImagePoint > getRansacInliers() const
void setMatchingFactorThreshold(const double factor)
void setRansacConsensusPercentage(double percentage)
cv::Ptr< cv::DescriptorMatcher > getMatcher() const
void setRansacParallel(bool parallel)
void setRansacReprojectionError(double reprojectionError)
void setExtractor(const std::string &extractorName)
void setUseSingleMatchFilter(bool singleMatchFilter)
void setFilterMatchingType(const vpFilterMatchingType &filterType)
void setRansacParallelNbThreads(unsigned int nthreads)
double getExtractionTime() const
void setUseRansacVVS(bool ransacVVS)
void setDetectors(const std::vector< std::string > &detectorNames)
void setExtractors(const std::vector< std::string > &extractorNames)
cv::Mat getTrainDescriptors() const
@ DETECTOR_KAZE
KAZE detector.
@ DETECTOR_BRISK
BRISK detector.
@ DETECTOR_AKAZE
AKAZE detector.
@ DETECTOR_MSER
MSER detector.
@ DETECTOR_SURF
SURF detector.
@ DETECTOR_AGAST
AGAST detector.
@ DETECTOR_SIFT
SIFT detector.
@ DETECTOR_FAST
FAST detector.
@ DETECTOR_GFTT
GFTT detector.
@ DETECTOR_ORB
ORB detector.
@ DETECTOR_SimpleBlob
SimpleBlob detector.
void setExtractor(const vpFeatureDescriptorType &extractorType)
void setImageFormat(const vpImageFormatType &imageFormat)
void setRansacThreshold(double threshold)
void setRansacMinInlierCount(int minCount)
void setRansacFilterFlag(const vpPose::RANSAC_FILTER_FLAGS &flag)
double getPoseTime() const
std::map< vpFeatureDetectorType, std::string > getDetectorNames() const
unsigned int getNbImages() const
double getMatchingTime() const
std::vector< vpImagePoint > getRansacOutliers() const
@ DESCRIPTOR_AKAZE
AKAZE descriptor.
@ DESCRIPTOR_ORB
ORB descriptor.
@ DESCRIPTOR_KAZE
KAZE descriptor.
@ DESCRIPTOR_SURF
SUFT descriptor.
@ DESCRIPTOR_BRISK
BRISK descriptor.
@ DESCRIPTOR_SIFT
SIFT descriptor.
std::vector< cv::DMatch > getMatches() const
std::map< vpFeatureDescriptorType, std::string > getExtractorNames() const
void setMatcher(const std::string &matcherName)
vpImageFormatType getImageFormat() const
cv::Ptr< cv::DescriptorExtractor > getExtractor(const std::string &name) const
void setUseAffineDetection(bool useAffine)
void setUseRansacConsensusPercentage(bool usePercentage)
void setMatchingRatioThreshold(double ratio)
void setCovarianceComputation(const bool &flag)
void setDetector(const vpFeatureDetectorType &detectorType)
cv::Ptr< cv::DescriptorExtractor > getExtractor(const vpFeatureDescriptorType &type) const
void setUseMatchTrainToQuery(bool useMatchTrainToQuery)
vpMatrix getCovarianceMatrix() const
void setDetectionMethod(const vpDetectionMethodType &method)
cv::Ptr< cv::FeatureDetector > getDetector(const std::string &name) const
void setDetector(const std::string &detectorName)
void setMaxFeatures(int maxFeatures)
std::vector< std::pair< cv::KeyPoint, cv::KeyPoint > > getMatchQueryToTrainKeyPoints() const
cv::Ptr< cv::FeatureDetector > getDetector(const vpFeatureDetectorType &type) const
void setRansacIteration(int nbIter)
cv::Mat getQueryDescriptors() const
Implementation of a matrix and operations on matrices.
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
Defines a rectangle in the plane.