1 #include <visp3/gui/vpDisplayOpenCV.h> 3 #include <visp3/io/vpImageIo.h> 4 #include <visp3/io/vpVideoReader.h> 6 #include <visp3/vision/vpKeyPoint.h> 12 #if (VISP_HAVE_OPENCV_VERSION >= 0x020101) && \ 13 (defined(VISP_HAVE_OPENCV_NONFREE) || defined(VISP_HAVE_OPENCV_XFEATURES2D) || \ 14 (VISP_HAVE_OPENCV_VERSION >= 0x030411 && CV_MAJOR_VERSION < 4) || (VISP_HAVE_OPENCV_VERSION >= 0x040400)) 23 const std::string detectorName =
"SIFT";
24 const std::string extractorName =
"SIFT";
27 const std::string matcherName =
"FlannBased";
29 vpKeyPoint keypoint(detectorName, extractorName, matcherName, filterType);
33 std::cout <<
"Reference keypoints=" << keypoint.buildReference(I) << std::endl;
43 vpDisplayOpenCV d(Idisp, 0, 0,
"Matching keypoints with SIFT keypoints");
48 while (!reader.
end()) {
63 unsigned int nbMatch = keypoint.matchPoint(I);
66 std::ostringstream oss;
67 oss <<
"Computation time: " << chrono.
getDurationMs() <<
" ms";
70 std::cout <<
"Matches=" << nbMatch << std::endl;
74 for (
unsigned int i = 0; i < nbMatch; i++) {
75 keypoint.getMatchedPoints(i, iPref, iPcur);
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
void resize(unsigned int h, unsigned int w)
resize the image : Image initialization
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
Class that enables to manipulate easily a video file or a sequence of images. As it inherits from the...
static const vpColor green
static void flush(const vpImage< unsigned char > &I)
void start(bool reset=true)
static void display(const vpImage< unsigned char > &I)
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
void acquire(vpImage< vpRGBa > &I)
void insert(const vpImage< Type > &src, const vpImagePoint &topLeft)
unsigned int getHeight() const
Class that allows keypoints detection (and descriptors extraction) and matching thanks to OpenCV libr...
void setFileName(const std::string &filename)
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
static const vpColor white
unsigned int getWidth() const
static void displayLine(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1, bool segment=true)