Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5986799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:43:25+00:00 2026-05-22T22:43:25+00:00

I have modified the OpenCV demo application matching_to_many_images.cpp to query a image (left) to

  • 0

Matching with nothing in the top right corner

I have modified the OpenCV demo application “matching_to_many_images.cpp” to query a image (left) to a frames from the webcam (right). What have gone wrong with the top right corner of the first image?

We think this is related to another problem we have. We begin with an empty database and we only add unique (features that not match the features in our database) but after adding only three features, we get a match on all new features….

we are using:
SurfFeatureDetector surfFeatureDetector(400,3,4);
SurfDescriptorExtractor surfDescriptorExtractor;
FlannBasedMatcher flannDescriptorMatcher;

Complete code can be found at: http://www.copypastecode.com/71973/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T22:43:26+00:00Added an answer on May 22, 2026 at 10:43 pm

    I think this has to do with the border keypoints. The detector detects the keypoints, but for the SURF descriptor to return consistent values it needs pixel data in a block of pixels around it, which is not available in the border pixels. You can use the following snippet to remove border points after keypoints are detected but before descriptors are computed. I suggest using borderSize of 20 or more.

    removeBorderKeypoints( vector<cv::KeyPoint>& keypoints, const cv::Size imageSize, const boost::int32_t borderSize )
    {
        if( borderSize > 0)
        {
            keypoints.erase( remove_if(keypoints.begin(), keypoints.end(),
                                   RoiPredicatePic((float)borderSize, (float)borderSize,
                                                (float)(imageSize.width - borderSize),
                                                (float)(imageSize.height - borderSize))),
                         keypoints.end() );
        }
    }
    

    Where RoiPredicatePic is implemented as:

    struct RoiPredicatePic
    {
        RoiPredicatePic(float _minX, float _minY, float _maxX, float _maxY)
        : minX(_minX), minY(_minY), maxX(_maxX), maxY(_maxY)
        {}
    
        bool operator()( const cv::KeyPoint& keyPt) const
        {
            cv::Point2f pt = keyPt.pt;
            return (pt.x < minX) || (pt.x >= maxX) || (pt.y < minY) || (pt.y >= maxY);
        }
    
        float minX, minY, maxX, maxY;
    };
    

    Also, approximate nearest neighbor indexing is not the best way to match features between pairs of images. I would suggest you to try other simpler matchers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im using Xcode and c++ I have copied the HoughCircles code from the OpenCV
I have modified the Nerd Dinner application to allow editing of child records by
I have modified my MOSS 2007 configuration to query a given target AD successfully.
I have a web application that works fine in IIS 6.0. I have modified
I'm having trouble with the JQuery's droppable feature. I have modified JS from here:
I have modified this example from the SDK pages to grab all the Contact
I have a dataset that I have modified into an xml document and then
I have an XML object (loaded using XMLHTTPRequest 's responseXML ). I have modified
I have a vs.net project, and after some refactoring, have modified the name of
I want to commit a large amount of XML files which have been modified.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.