Skip to content

drawMatchesKnn

Features and matchingfunctionOpenCV 5.0.0
import { drawMatchesKnn } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSimg1, keypoints1, img2, keypoints2
FUNCTIONdrawMatchesKnn
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Draws the found matches of keypoints from two images.

drawMatchesKnn(img1: Mat, keypoints1: KeyPointVector, img2: Mat, keypoints2: KeyPointVector, matches1to2: DMatchVectorVector, outImg: Mat, matchColor: Scalar, singlePointColor: Scalar, matchesMask: CharVectorVector, flags: number): void;
5 available overloads
drawMatchesKnn(img1: Mat, keypoints1: KeyPointVector, img2: Mat, keypoints2: KeyPointVector, matches1to2: DMatchVectorVector, outImg: Mat): void;
drawMatchesKnn(img1: Mat, keypoints1: KeyPointVector, img2: Mat, keypoints2: KeyPointVector, matches1to2: DMatchVectorVector, outImg: Mat, matchColor: Scalar): void;
drawMatchesKnn(img1: Mat, keypoints1: KeyPointVector, img2: Mat, keypoints2: KeyPointVector, matches1to2: DMatchVectorVector, outImg: Mat, matchColor: Scalar, singlePointColor: Scalar): void;
drawMatchesKnn(img1: Mat, keypoints1: KeyPointVector, img2: Mat, keypoints2: KeyPointVector, matches1to2: DMatchVectorVector, outImg: Mat, matchColor: Scalar, singlePointColor: Scalar, matchesMask: CharVectorVector): void;
drawMatchesKnn(img1: Mat, keypoints1: KeyPointVector, img2: Mat, keypoints2: KeyPointVector, matches1to2: DMatchVectorVector, outImg: Mat, matchColor: Scalar, singlePointColor: Scalar, matchesMask: CharVectorVector, flags: number): void;
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

Input/output value, modified by the native operation. 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.

This function draws matches of keypoints from two images in the output image. Match is a line connecting two keypoints (circles). See cv::DrawMatchesFlags.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.