我是opencv的新手,而且正在开发中。我正在使用SIFT关键点匹配两个图像。为了做到这一点,我使用了以下代码。但是它提供了一些错误匹配。
我想如果我改变了关键点的大小。这将有助于获得更正确的关键点。当前大小的关键点是不够的。请帮助我改进size of the key points
。
Ptr<FeatureDetector> featureDetector = FeatureDetector::create("SIFT");
featureDetector->detect(input_right, keypoints_right);// is pointer so i used ->
featureDetector->detect(input_left, keypoints_left);
//-- Step 2: Calculate descriptors (feature vectors)
Ptr<DescriptorExtractor> featureExtractor = DescriptorExtractor::create("SIFT");
featureExtractor->compute(input_right, keypoints_right, descriptor_right);
// which is pointer so i used ->
featureExtractor->compute(input_left, keypoints_left, descriptor_left);
// show features
// check detected keypoints right
Mat outputImageright;
Scalar keypointColor = Scalar(255, 0, 0); // Blue keypoints.
drawKeypoints(input_right, keypoints_right, outputImageright, keypointColor, DrawMatchesFlags::DEFAULT);
namedWindow("Right View");
imshow("Right View", outputImageright);
Mat outputImageleft;
Scalar keypointColorred = Scalar(0, 0, 255); // Red keypoints.
drawKeypoints(input_left, keypoints_left, outputImageleft, keypointColorred, DrawMatchesFlags::DEFAULT);
namedWindow("Left View");
imshow("Left View", outputImageleft);