Use drawMatches to draw lines connecting corresponding keypoints from two different images in a single output image.
Parameters:
img1: The first source image.keypoints1: Keypoints from the first source image.img2: The second source image.keypoints2: Keypoints from the second source image.matches1to2: The matches where keypoints1[i] corresponds to keypoints2[matches[i]].outImg: The output image (InputOutputArray).matchColor (optional): Color of the match lines and connected keypoints. If set to Scalar::all(-1), colors are generated randomly.singlePointColor (optional): Color of keypoints that do not have a match. If set to Scalar::all(-1), colors are generated randomly.matchesMask (optional): A mask determining which matches are drawn. If empty, all matches are drawn.flags (optional): Drawing feature settings defined by DrawMatchesFlags.
import { drawMatches } from '@techstark/opencv-js';
// Example usage:
// drawMatches(img1, kp1, img2, kp2, matches, outImg, matchColor, singlePointColor, mask, flags);