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 6214095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:48:58+00:00 2026-05-24T06:48:58+00:00

I need to know if this algorithm is a known one: void getMatches(IpVec &ipts1,

  • 0

I need to know if this algorithm is a known one:

void getMatches(IpVec &ipts1, IpVec &ipts2, IpPairVec &matches, float ratio) {
    float dist, d1, d2;
    Ipoint *match;

    matches.clear();

    for (unsigned int i = 0; i < ipts1.size(); i++) {
        d1 = d2 = FLT_MAX;

        for (unsigned int j = 0; j < ipts2.size(); j++) {
            dist = ipts1[i] - ipts2[j];

            if (dist < d1) // if this feature matches better than current best
            {
                d2 = d1;
                d1 = dist;
                match = &ipts2[j];
            } else if (dist < d2) // this feature matches better than second best
            {
                d2 = dist;
            }
        }

        // If match has a d1:d2 ratio < 0.65 ipoints are a match
        if (d1 / d2 < ratio) {
            // Store the change in position
            ipts1[i].dx = match->x - ipts1[i].x;
            ipts1[i].dy = match->y - ipts1[i].y;
            matches.push_back(std::make_pair(ipts1[i], *match));
        }
    }
}

class Ipoint {
public:

    //! Destructor

    ~Ipoint() {
    };

    //! Constructor

    Ipoint() : orientation(0) {
    };

    //! Gets the distance in descriptor space between Ipoints

    float operator-(const Ipoint &rhs) {
        float sum = 0.f;
        for (int i = 0; i < 64; ++i) {
            //std::cout << i << "\n";
            try {
                sum += (this->descriptor[i] - rhs.descriptor[i])*(this->descriptor[i] - rhs.descriptor[i]);
            } catch (char *str) {
                std::cout << "Caught some other exception: " << str << "\n";
            }

        }
        return sqrt(sum);
    };

    //! Coordinates of the detected interest point
    float x, y;

    //! Detected scale
    float scale;

    //! Orientation measured anti-clockwise from +ve x-axis
    float orientation;

    //! Sign of laplacian for fast matching purposes
    int laplacian;

    //! Vector of descriptor components
    float descriptor[64];

    //! Placeholds for point motion (can be used for frame to frame motion analysis)
    float dx, dy;

    //! Used to store cluster index
    int clusterIndex;
};

This compares the results of SURF algorithm.

  1. This is a nearest neighbor algorithm? That looks like the func is searching the nearest point of every point.
  2. Can I do the same using Quadtree or kd-tree?
  3. There is a better algorithm to compare to images points and know if them are the same or similar?
  4. Preferable I want to store them into mysql and build a kd-tree to compare 1 image through all images, that’s possible?
  5. RANSAC is useful for anything in this task?
  6. There is any method to catch false positives?
  • 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-24T06:48:58+00:00Added an answer on May 24, 2026 at 6:48 am

    You’ve asked a lot of questions and I don’t think I can answer all of them, but here are answers to as much of your question as I can.

    1. This is most certainly a nearest-neighbor algorithm where the goal is to find the two closest points to each point in the first vector and then check whether the ratio of their distances is less than some cutoff value.

    2. You could do this with a quadtree or kd-tree, but because your points are all one-dimensional values you could do much better using a balanced binary search tree. Given such a tree, if you thread a linked list through the nodes, you can find the k nearest neighbors to some test point p by looking up the closest element p in the binary search tree, then traversing (k + 1) steps in each direction and taking the k closest points of what you find. This runs in time O(lg n + k), where n is the number of points and k is as above. This is substantially more efficient than what you have now, which takes O(n) time per lookup.

      If the dimensionality of your feature vector is more than 1, but less than 20, then using kd-trees would be a very effective measure.

      For higher dimensionalities, you might want to either reduce the number of dimensions with PCA before applying a kd-tree or use a more scalable ANN structure, such as locality-sensitive hashing.

    3. SURF is best for scene and object detection. If you need to find out if two images are the same, you would do better with global descriptor algorithms, such as GIST. The advantage of using a global descriptor is that you get a single vector for the whole image and image comparison is performed with simple Eucledian distance.

    4. You could definitely do this using MySQL because you don’t need a kd-tree. A simple balanced binary tree should be sufficient.

    5. RANSAC is a method of estimating model parameters that is robust against outliers. It is useful for using SURF features for combining multiple photographs into a 3D scene.

    6. Checking for false positives is definitely a machine learning exercise and I’m not well-trained in that area. You could probably do this using a supervised learning algorithm (such as an SVM, boosted decision tree, or neural network), but I don’t know enough to advise you on this.

    Hope this helps!

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

Sidebar

Related Questions

This is the well know select algorithm. see http://en.wikipedia.org/wiki/Selection_algorithm . I need it to
Need to know this so that i could send DTMF and that is going
I need to know this since this is a pre-req for .NET 3.5 and
I know this is a very broadly scoped question, but what do I need
Seems so basic, I can't believe I don't know this! I just need a
I need to know when I click on an element if this element has
I don't know if this is a right question, but i need to understand
I have solved this problem, I just need to know what to do. I
Now this may seem like a silly question, but I need to know how
My knowledge of matlab is merely on a need to know basis, so this

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.