2011-02-22 21:43:26 +01:00
Drawing Function of Keypoints and Matches
=========================================
2011-06-30 00:06:42 +02:00
2011-02-22 21:43:26 +01:00
2011-02-28 22:26:43 +01:00
drawMatches
2011-02-22 21:43:26 +01:00
---------------
2011-06-30 00:06:42 +02:00
Draws the found matches of keypoints from two images.
2011-02-22 21:43:26 +01:00
2012-05-30 13:13:07 +02:00
.. ocv:function :: void drawMatches( const Mat& img1, const vector<KeyPoint>& keypoints1, const Mat& img2, const vector<KeyPoint>& keypoints2, const vector<DMatch>& matches1to2, Mat& outImg, const Scalar& matchColor=Scalar::all(-1), const Scalar& singlePointColor=Scalar::all(-1), const vector<char>& matchesMask=vector<char>(), int flags=DrawMatchesFlags::DEFAULT )
2011-02-22 21:43:26 +01:00
2012-05-30 13:13:07 +02:00
.. ocv:function :: void drawMatches( const Mat& img1, const vector<KeyPoint>& keypoints1, const Mat& img2, const vector<KeyPoint>& keypoints2, const vector<vector<DMatch> >& matches1to2, Mat& outImg, const Scalar& matchColor=Scalar::all(-1), const Scalar& singlePointColor=Scalar::all(-1), const vector<vector<char> >& matchesMask=vector<vector<char> >(), int flags=DrawMatchesFlags::DEFAULT )
2011-06-30 00:06:42 +02:00
2011-02-22 21:43:26 +01:00
2011-06-23 14:00:09 +02:00
:param img1: First source image.
2011-02-22 21:43:26 +01:00
2011-05-08 11:09:39 +02:00
:param keypoints1: Keypoints from the first source image.
2011-02-22 21:43:26 +01:00
2011-06-23 14:00:09 +02:00
:param img2: Second source image.
2011-02-22 21:43:26 +01:00
2011-05-08 11:09:39 +02:00
:param keypoints2: Keypoints from the second source image.
2011-02-26 12:05:10 +01:00
2012-03-29 08:50:05 +02:00
:param matches1to2: Matches from the first image to the second one, which means that ``keypoints1[i]`` has a corresponding point in ``keypoints2[matches[i]]`` .
2011-02-22 21:43:26 +01:00
2011-05-08 11:09:39 +02:00
:param outImg: Output image. Its content depends on the ``flags`` value defining what is drawn in the output image. See possible ``flags`` bit values below.
2011-02-22 21:43:26 +01:00
2011-05-08 11:09:39 +02:00
:param matchColor: Color of matches (lines and connected keypoints). If ``matchColor==Scalar::all(-1)`` , the color is generated randomly.
2011-02-22 21:43:26 +01:00
2011-05-08 11:09:39 +02:00
:param singlePointColor: Color of single keypoints (circles), which means that keypoints do not have the matches. If ``singlePointColor==Scalar::all(-1)`` , the color is generated randomly.
2011-02-22 21:43:26 +01:00
2011-05-08 11:09:39 +02:00
:param matchesMask: Mask determining which matches are drawn. If the mask is empty, all matches are drawn.
2011-02-26 12:05:10 +01:00
2011-05-08 11:09:39 +02:00
:param flags: Flags setting drawing features. Possible ``flags`` bit values are defined by ``DrawMatchesFlags``.
2012-05-30 13:13:07 +02:00
2011-05-08 17:30:00 +02:00
This function draws matches of keypoints from two images in the output image. Match is a line connecting two keypoints (circles). The structure `` DrawMatchesFlags `` is defined as follows:
2011-03-05 22:26:13 +01:00
.. code-block :: cpp
struct DrawMatchesFlags
{
enum
{
DEFAULT = 0, // Output image matrix will be created (Mat::create),
// i.e. existing memory of output image may be reused.
2011-05-08 11:09:39 +02:00
// Two source images, matches, and single keypoints
2011-03-05 22:26:13 +01:00
// will be drawn.
2011-05-08 11:09:39 +02:00
// For each keypoint, only the center point will be
// drawn (without a circle around the keypoint with the
2011-03-05 22:26:13 +01:00
// keypoint size and orientation).
DRAW_OVER_OUTIMG = 1, // Output image matrix will not be
// created (using Mat::create). Matches will be drawn
// on existing content of output image.
NOT_DRAW_SINGLE_POINTS = 2, // Single keypoints will not be drawn.
2011-05-08 11:09:39 +02:00
DRAW_RICH_KEYPOINTS = 4 // For each keypoint, the circle around
2011-03-05 22:26:13 +01:00
// keypoint with keypoint size and orientation will
// be drawn.
};
};
..
2011-02-22 21:43:26 +01:00
2011-06-30 00:06:42 +02:00
2011-02-22 21:43:26 +01:00
2011-02-28 22:26:43 +01:00
drawKeypoints
2011-02-22 21:43:26 +01:00
-----------------
2011-06-30 00:06:42 +02:00
Draws keypoints.
2011-02-22 21:43:26 +01:00
2012-05-30 13:13:07 +02:00
.. ocv:function :: void drawKeypoints( const Mat& image, const vector<KeyPoint>& keypoints, Mat& outImage, const Scalar& color=Scalar::all(-1), int flags=DrawMatchesFlags::DEFAULT )
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param image: Source image.
2011-05-08 11:09:39 +02:00
:param keypoints: Keypoints from the source image.
2011-02-26 12:05:10 +01:00
2012-05-30 13:13:07 +02:00
:param outImage: Output image. Its content depends on the ``flags`` value defining what is drawn in the output image. See possible ``flags`` bit values below.
2011-02-22 21:43:26 +01:00
2011-03-03 08:29:55 +01:00
:param color: Color of keypoints.
2011-02-22 21:43:26 +01:00
2011-06-23 14:00:09 +02:00
:param flags: Flags setting drawing features. Possible ``flags`` bit values are defined by ``DrawMatchesFlags``. See details above in :ocv:func:`drawMatches` .
2011-02-22 21:43:26 +01:00