1 #include <visp/vpDisplayOpenCV.h>
3 #include <visp/vpVideoReader.h>
4 #include <visp/vpImageIo.h>
6 #include <visp/vpKeyPoint.h>
11 #if (VISP_HAVE_OPENCV_VERSION >= 0x020101) && (defined(VISP_HAVE_OPENCV_NONFREE) || defined(VISP_HAVE_OPENCV_XFEATURES2D))
20 const std::string detectorName =
"SIFT";
21 const std::string extractorName =
"SIFT";
23 const std::string matcherName =
"FlannBased";
25 vpKeyPoint keypoint(detectorName, extractorName, matcherName, filterType);
29 std::cout <<
"Reference keypoints=" << keypoint.buildReference(I) << std::endl;
39 vpDisplayOpenCV d(Idisp, 0, 0,
"Matching keypoints with SIFT keypoints") ;
44 while ( ! reader.
end() )
57 int nbMatch = keypoint.matchPoint(I);
60 std::cout <<
"Matches=" << nbMatch << std::endl;
64 for (
int i = 0; i < nbMatch; i++)
66 keypoint.getMatchedPoints(i, iPref, iPcur);
unsigned int getWidth() const
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)
static void display(const vpImage< unsigned char > &I)
The vpDisplayOpenCV allows to display image using the opencv library.
void acquire(vpImage< vpRGBa > &I)
void resize(const unsigned int h, const unsigned int w)
set the size of the image without initializing it.
void setFileName(const char *filename)
Class that allows keypoints detection (and descriptors extraction) and matching thanks to OpenCV libr...
void insert(const vpImage< Type > &src, const vpImagePoint topLeft)
unsigned int getHeight() const
virtual bool getClick(bool blocking=true)=0
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
virtual void displayLine(const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)=0
static const vpColor white