1. 程式人生 > >影象處理——特徵檢測涉及到的資料結構和匹配方法

影象處理——特徵檢測涉及到的資料結構和匹配方法

複製程式碼
FeatureMatchTest::FeatureMatchTest(std::shared_ptr<Pattern> left, std::shared_ptr<Pattern> right, std::shared_ptr<cv::DescriptorMatcher> matcher) :
leftPattern(left), rightPattern(right), matcher(matcher) {

    //step1:Create detector
    int minHessian = 400;
    SurfFeatureDetector detector(minHessian);

    
//step2:Detecte keypoint detector.detect(leftPattern->image, leftPattern->keypoints); detector.detect(rightPattern->image, rightPattern->keypoints); //step3:Compute descriptor detector.compute(leftPattern->image, leftPattern->keypoints, leftPattern->descriptors); detector.compute(rightPattern
->image, rightPattern->keypoints, rightPattern->descriptors); }