8

Вопрос по c++ – Попытка сопоставить два изображения с помощью просеивания в OpenCv, но слишком много совпадений

Error: User Rate Limit Exceeded

#include <opencv2\opencv.hpp>
#include <iostream>

int main(int argc, const char* argv[]) {
   cv::Mat input1 = cv::imread("input.jpg", 1); //Load as grayscale
   //cv::cvtColor(input1,input1,CV_BGR2GRAY);
   //second input load as grayscale
   cv::Mat input2 = cv::imread("input2.jpg",1);
   cv::SiftFeatureDetector detector;
   //cv::SiftFeatureDetector
   detector(
      1, 1,
      cv::SIFT::CommonParams::DEFAULT_NOCTAVES,
      cv::SIFT::CommonParams::DEFAULT_NOCTAVE_LAYERS,
      cv::SIFT::CommonParams::DEFAULT_FIRST_OCTAVE,
      cv::SIFT::CommonParams::FIRST_ANGLE );
   std::vector<cv::KeyPoint> keypoints1;
   detector.detect(input1, keypoints1);
   // Add results to image and save.
   cv::Mat output1;
   cv::drawKeypoints(input1, keypoints1, output1);
   cv::imshow("Sift_result1.jpg", output1);
   cv::imwrite("Sift_result1.jpg",output1);
   //keypoints array for input 2
   std::vector<cv::KeyPoint> keypoints2;
   //output array for ouput 2
   cv::Mat output2;
   //Sift extractor of opencv
   cv::SiftDescriptorExtractor extractor;
   cv::Mat descriptors1,descriptors2;
   cv::BruteForceMatcher<cv::L2<float>> matcher;
   cv::vector<cv::DMatch> matches;
   cv::Mat img_matches;
   detector.detect(input2,keypoints2);
   cv::drawKeypoints(input2,keypoints2,output2);
   cv::imshow("Sift_result2.jpg",output2);
   cv::imwrite("Sift_result2.jpg",output2);
   extractor.compute(input1,keypoints1,descriptors1);
   extractor.compute(input2,keypoints2,descriptors2);
   matcher.match(descriptors1,descriptors2,matches);
   //show result
   cv::drawMatches(input1,keypoints1,input2,keypoints2,matches,img_matches);
   cv::imshow("matches",img_matches);
   cv::imwrite("matches.jpg",img_matches);
   cv::waitKey();
   return 0;
}

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

I should have remove the image.

Error: User Rate Limit Exceeded

  • Спасибо. Как вы сказали, проблема была в том, что нужно было провести все матчи, а не только хорошие. Теперь, когда я сортирую совпадения и выбираю 15% с минимальными расстояниями.

    от bahti
  • Error: User Rate Limit Exceeded

    от
  • New link

    от
  • 0

    Error: User Rate Limit Exceeded

    {
    Calculated best affine transform with least square method.
    
    Found out the transform for all keypoints in source image.
    
    Checked out MaxError and MinError.
    
    Points with Error near MaxError are removed from the matching list
    }
    

  • 6

    Error: User Rate Limit Exceeded