Features2d
Objective-C
@interface Features2d : NSObject
Swift
class Features2d : NSObject
The Features2d module
Member classes: Feature2D
, SIFT
, BRISK
, ORB
, MSER
, FastFeatureDetector
, AgastFeatureDetector
, GFTTDetector
, SimpleBlobDetector
, SimpleBlobDetectorParams
, KAZE
, AKAZE
, DescriptorMatcher
, BFMatcher
, FlannBasedMatcher
, BOWTrainer
, BOWKMeansTrainer
, BOWImgDescriptorExtractor
Member enums: ScoreType
, FastDetectorType
, AgastDetectorType
, DiffusivityType
, DescriptorType
, MatcherType
, DrawMatchesFlags
-
Draws keypoints.
@note For Python API, flags are modified as cv.DRAW_MATCHES_FLAGS_DEFAULT, cv.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS, cv.DRAW_MATCHES_FLAGS_DRAW_OVER_OUTIMG, cv.DRAW_MATCHES_FLAGS_NOT_DRAW_SINGLE_POINTS
Declaration
Objective-C
+ (void)drawKeypoints:(nonnull Mat *)image keypoints:(nonnull NSArray<KeyPoint *> *)keypoints outImage:(nonnull Mat *)outImage color:(nonnull Scalar *)color flags:(DrawMatchesFlags)flags;
Swift
class func drawKeypoints(image: Mat, keypoints: [KeyPoint], outImage: Mat, color: Scalar, flags: DrawMatchesFlags)
Parameters
image
Source image.
keypoints
Keypoints from the source image.
outImage
Output image. Its content depends on the flags value defining what is drawn in the output image. See possible flags bit values below.
color
Color of keypoints.
flags
Flags setting drawing features. Possible flags bit values are defined by DrawMatchesFlags. See details above in drawMatches .
-
Draws keypoints.
@note For Python API, flags are modified as cv.DRAW_MATCHES_FLAGS_DEFAULT, cv.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS, cv.DRAW_MATCHES_FLAGS_DRAW_OVER_OUTIMG, cv.DRAW_MATCHES_FLAGS_NOT_DRAW_SINGLE_POINTS
Declaration
Parameters
image
Source image.
keypoints
Keypoints from the source image.
outImage
Output image. Its content depends on the flags value defining what is drawn in the output image. See possible flags bit values below.
color
Color of keypoints. DrawMatchesFlags. See details above in drawMatches .
-
Draws keypoints.
@note For Python API, flags are modified as cv.DRAW_MATCHES_FLAGS_DEFAULT, cv.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS, cv.DRAW_MATCHES_FLAGS_DRAW_OVER_OUTIMG, cv.DRAW_MATCHES_FLAGS_NOT_DRAW_SINGLE_POINTS
Declaration
Parameters
image
Source image.
keypoints
Keypoints from the source image.
outImage
Output image. Its content depends on the flags value defining what is drawn in the output image. See possible flags bit values below. DrawMatchesFlags. See details above in drawMatches .
-
+drawMatches:
keypoints1: img2: keypoints2: matches1to2: outImg: matchColor: singlePointColor: matchesMask: flags: Draws the found matches of keypoints from two images.
This function draws matches of keypoints from two images in the output image. Match is a line connecting two keypoints (circles). See cv::DrawMatchesFlags.
Declaration
Objective-C
+ (void)drawMatches:(nonnull Mat *)img1 keypoints1:(nonnull NSArray<KeyPoint *> *)keypoints1 img2:(nonnull Mat *)img2 keypoints2:(nonnull NSArray<KeyPoint *> *)keypoints2 matches1to2:(nonnull NSArray<DMatch *> *)matches1to2 outImg:(nonnull Mat *)outImg matchColor:(nonnull Scalar *)matchColor singlePointColor:(nonnull Scalar *)singlePointColor matchesMask:(nonnull ByteVector *)matchesMask flags:(DrawMatchesFlags)flags;
Swift
class func drawMatches(img1: Mat, keypoints1: [KeyPoint], img2: Mat, keypoints2: [KeyPoint], matches1to2: [DMatch], outImg: Mat, matchColor: Scalar, singlePointColor: Scalar, matchesMask: ByteVector, flags: DrawMatchesFlags)
Parameters
img1
First source image.
keypoints1
Keypoints from the first source image.
img2
Second source image.
keypoints2
Keypoints from the second source image.
matches1to2
Matches from the first image to the second one, which means that keypoints1[i] has a corresponding point in keypoints2[matches[i]] .
outImg
Output image. Its content depends on the flags value defining what is drawn in the output image. See possible flags bit values below.
matchColor
Color of matches (lines and connected keypoints). If matchColor==Scalar::all(-1) , the color is generated randomly.
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.
matchesMask
Mask determining which matches are drawn. If the mask is empty, all matches are drawn.
flags
Flags setting drawing features. Possible flags bit values are defined by DrawMatchesFlags.
-
Draws the found matches of keypoints from two images.
This function draws matches of keypoints from two images in the output image. Match is a line connecting two keypoints (circles). See cv::DrawMatchesFlags.
Declaration
Objective-C
+ (void)drawMatches:(nonnull Mat *)img1 keypoints1:(nonnull NSArray<KeyPoint *> *)keypoints1 img2:(nonnull Mat *)img2 keypoints2:(nonnull NSArray<KeyPoint *> *)keypoints2 matches1to2:(nonnull NSArray<DMatch *> *)matches1to2 outImg:(nonnull Mat *)outImg matchColor:(nonnull Scalar *)matchColor singlePointColor:(nonnull Scalar *)singlePointColor matchesMask:(nonnull ByteVector *)matchesMask;
Parameters
img1
First source image.
keypoints1
Keypoints from the first source image.
img2
Second source image.
keypoints2
Keypoints from the second source image.
matches1to2
Matches from the first image to the second one, which means that keypoints1[i] has a corresponding point in keypoints2[matches[i]] .
outImg
Output image. Its content depends on the flags value defining what is drawn in the output image. See possible flags bit values below.
matchColor
Color of matches (lines and connected keypoints). If matchColor==Scalar::all(-1) , the color is generated randomly.
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.
matchesMask
Mask determining which matches are drawn. If the mask is empty, all matches are drawn. DrawMatchesFlags.
-
Draws the found matches of keypoints from two images.
This function draws matches of keypoints from two images in the output image. Match is a line connecting two keypoints (circles). See cv::DrawMatchesFlags.
Declaration
Objective-C
+ (void)drawMatches:(nonnull Mat *)img1 keypoints1:(nonnull NSArray<KeyPoint *> *)keypoints1 img2:(nonnull Mat *)img2 keypoints2:(nonnull NSArray<KeyPoint *> *)keypoints2 matches1to2:(nonnull NSArray<DMatch *> *)matches1to2 outImg:(nonnull Mat *)outImg matchColor:(nonnull Scalar *)matchColor singlePointColor:(nonnull Scalar *)singlePointColor;
Parameters
img1
First source image.
keypoints1
Keypoints from the first source image.
img2
Second source image.
keypoints2
Keypoints from the second source image.
matches1to2
Matches from the first image to the second one, which means that keypoints1[i] has a corresponding point in keypoints2[matches[i]] .
outImg
Output image. Its content depends on the flags value defining what is drawn in the output image. See possible flags bit values below.
matchColor
Color of matches (lines and connected keypoints). If matchColor==Scalar::all(-1) , the color is generated randomly.
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. drawn. DrawMatchesFlags.
-
Draws the found matches of keypoints from two images.
This function draws matches of keypoints from two images in the output image. Match is a line connecting two keypoints (circles). See cv::DrawMatchesFlags.
Declaration
Objective-C
+ (void)drawMatches:(nonnull Mat *)img1 keypoints1:(nonnull NSArray<KeyPoint *> *)keypoints1 img2:(nonnull Mat *)img2 keypoints2:(nonnull NSArray<KeyPoint *> *)keypoints2 matches1to2:(nonnull NSArray<DMatch *> *)matches1to2 outImg:(nonnull Mat *)outImg matchColor:(nonnull Scalar *)matchColor;
Parameters
img1
First source image.
keypoints1
Keypoints from the first source image.
img2
Second source image.
keypoints2
Keypoints from the second source image.
matches1to2
Matches from the first image to the second one, which means that keypoints1[i] has a corresponding point in keypoints2[matches[i]] .
outImg
Output image. Its content depends on the flags value defining what is drawn in the output image. See possible flags bit values below.
matchColor
Color of matches (lines and connected keypoints). If matchColor==Scalar::all(-1) , the color is generated randomly. have the matches. If singlePointColor==Scalar::all(-1) , the color is generated randomly. drawn. DrawMatchesFlags.
-
Draws the found matches of keypoints from two images.
This function draws matches of keypoints from two images in the output image. Match is a line connecting two keypoints (circles). See cv::DrawMatchesFlags.
Declaration
Parameters
img1
First source image.
keypoints1
Keypoints from the first source image.
img2
Second source image.
keypoints2
Keypoints from the second source image.
matches1to2
Matches from the first image to the second one, which means that keypoints1[i] has a corresponding point in keypoints2[matches[i]] .
outImg
Output image. Its content depends on the flags value defining what is drawn in the output image. See possible flags bit values below. , the color is generated randomly. have the matches. If singlePointColor==Scalar::all(-1) , the color is generated randomly. drawn. DrawMatchesFlags.
-
+drawMatchesKnn:
keypoints1: img2: keypoints2: matches1to2: outImg: matchColor: singlePointColor: matchesMask: flags: Declaration
Objective-C
+ (void)drawMatchesKnn:(Mat*)img1 keypoints1:(NSArray<KeyPoint*>*)keypoints1 img2:(Mat*)img2 keypoints2:(NSArray<KeyPoint*>*)keypoints2 matches1to2:(NSArray<NSArray<DMatch*>*>*)matches1to2 outImg:(Mat*)outImg matchColor:(Scalar*)matchColor singlePointColor:(Scalar*)singlePointColor matchesMask:(NSArray<ByteVector*>*)matchesMask flags:(DrawMatchesFlags)flags NS_SWIFT_NAME(drawMatches(img1:keypoints1:img2:keypoints2:matches1to2:outImg:matchColor:singlePointColor:matchesMask:flags:));
Swift
class func drawMatches(img1: Mat, keypoints1: [KeyPoint], img2: Mat, keypoints2: [KeyPoint], matches1to2: [[DMatch]], outImg: Mat, matchColor: Scalar, singlePointColor: Scalar, matchesMask: [ByteVector], flags: DrawMatchesFlags)
-
+drawMatchesKnn:
keypoints1: img2: keypoints2: matches1to2: outImg: matchColor: singlePointColor: matchesMask: Declaration
Objective-C
+ (void)drawMatchesKnn:(Mat*)img1 keypoints1:(NSArray<KeyPoint*>*)keypoints1 img2:(Mat*)img2 keypoints2:(NSArray<KeyPoint*>*)keypoints2 matches1to2:(NSArray<NSArray<DMatch*>*>*)matches1to2 outImg:(Mat*)outImg matchColor:(Scalar*)matchColor singlePointColor:(Scalar*)singlePointColor matchesMask:(NSArray<ByteVector*>*)matchesMask NS_SWIFT_NAME(drawMatches(img1:keypoints1:img2:keypoints2:matches1to2:outImg:matchColor:singlePointColor:matchesMask:));
-
Declaration
Objective-C
+ (void)drawMatchesKnn:(Mat*)img1 keypoints1:(NSArray<KeyPoint*>*)keypoints1 img2:(Mat*)img2 keypoints2:(NSArray<KeyPoint*>*)keypoints2 matches1to2:(NSArray<NSArray<DMatch*>*>*)matches1to2 outImg:(Mat*)outImg matchColor:(Scalar*)matchColor singlePointColor:(Scalar*)singlePointColor NS_SWIFT_NAME(drawMatches(img1:keypoints1:img2:keypoints2:matches1to2:outImg:matchColor:singlePointColor:));
-
Declaration
Objective-C
+ (void)drawMatchesKnn:(Mat*)img1 keypoints1:(NSArray<KeyPoint*>*)keypoints1 img2:(Mat*)img2 keypoints2:(NSArray<KeyPoint*>*)keypoints2 matches1to2:(NSArray<NSArray<DMatch*>*>*)matches1to2 outImg:(Mat*)outImg matchColor:(Scalar*)matchColor NS_SWIFT_NAME(drawMatches(img1:keypoints1:img2:keypoints2:matches1to2:outImg:matchColor:));
-
Declaration
Objective-C
+ (void)drawMatchesKnn:(Mat*)img1 keypoints1:(NSArray<KeyPoint*>*)keypoints1 img2:(Mat*)img2 keypoints2:(NSArray<KeyPoint*>*)keypoints2 matches1to2:(NSArray<NSArray<DMatch*>*>*)matches1to2 outImg:(Mat*)outImg NS_SWIFT_NAME(drawMatches(img1:keypoints1:img2:keypoints2:matches1to2:outImg:));