Method DrawMatches
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
DrawMatches(Mat, IEnumerable<KeyPoint>, Mat, IEnumerable<KeyPoint>, IEnumerable<DMatch>, Mat, Scalar?, Scalar?, IEnumerable<byte>?, DrawMatchesFlags)
Draws the found matches of keypoints from two images.
public static void DrawMatches(Mat img1, IEnumerable<KeyPoint> keypoints1, Mat img2, IEnumerable<KeyPoint> keypoints2, IEnumerable<DMatch> matches1To2, Mat outImg, Scalar? matchColor = null, Scalar? singlePointColor = null, IEnumerable<byte>? matchesMask = null, DrawMatchesFlags flags = DrawMatchesFlags.Default)
Parameters
img1MatFirst source image.
keypoints1IEnumerable<KeyPoint>Keypoints from the first source image.
img2MatSecond source image.
keypoints2IEnumerable<KeyPoint>Keypoints from the second source image.
matches1To2IEnumerable<DMatch>Matches from the first image to the second one, which means that keypoints1[i] has a corresponding point in keypoints2[matches[i]] .
outImgMatOutput image. Its content depends on the flags value defining what is drawn in the output image. See possible flags bit values below.
matchColorScalar?Color of matches (lines and connected keypoints). If matchColor==Scalar::all(-1), the color is generated randomly.
singlePointColorScalar?Color of single keypoints (circles), which means that keypoints do not have the matches. If singlePointColor==Scalar::all(-1) , the color is generated randomly.
matchesMaskIEnumerable<byte>Mask determining which matches are drawn. If the mask is empty, all matches are drawn.
flagsDrawMatchesFlagsFlags setting drawing features. Possible flags bit values are defined by DrawMatchesFlags.