Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

That's not because of your code.

When you match, say, image A to image B, you actually find the best correspondence in B for each feature in A.

And this is definitely not symmetric:

  • Your first image (corresponding to imgFeat1) has 1095 features. For each of those features, the algorithm gives you the closest feature in imgFeat2. It might happen that two features in imgFeat1 are matched to the same feature in imgFeat2.
  • Inversely, your second image has 1107 features that are matched to the features of the first image.

EDIT: I think that you are right. In the second part of the code (2->1), the new matches that are found are never added to the list of matches which is returned.

PREVIOUS VERSION OF MY ANSWER:

That's not because of your code.

When you match, say, image A to image B, you actually find the best correspondence in B for each feature in A.

And this is definitely not symmetric:

  • Your first image (corresponding to imgFeat1) has 1095 features. For each of those features, the algorithm gives you the closest feature in imgFeat2. It might happen that two features in imgFeat1 are matched to the same feature in imgFeat2.
  • Inversely, your second image has 1107 features that are matched to the features of the first image.

EDIT: My mistake: I think that you are right. In the second part of the code (2->1), the new matches that are found are never added to the list of matches which is returned.

Which means that in the end, this matcher is not matching in both ways, and my previous explanation applies:

PREVIOUS VERSION OF MY ANSWER:

That's not because of your code.

When you match, say, image A to image B, you actually find the best correspondence in B for each feature in A.

And this is definitely not symmetric:

  • Your first image (corresponding to imgFeat1) has 1095 features. For each of those features, the algorithm gives you the closest feature in imgFeat2. It might happen that two features in imgFeat1 are matched to the same feature in imgFeat2.
  • Inversely, your second image has 1107 features that are matched to the features of the first image.

EDIT: My mistake: I think that you are right. In the second part of the code (2->1), the new matches that are found are never added to the list of matches which is returned.

Which means that in the end, this matcher is not matching in both ways, and my previous explanation applies:

PREVIOUS VERSION OF MY ANSWER:

When you match, say, image A to image B, you actually find the best correspondence in B for each feature in A.

And this is definitely not symmetric:

  • Your first image (corresponding to imgFeat1) has 1095 features. For each of those features, the algorithm gives you the closest feature in imgFeat2. It might happen that two features in imgFeat1 are matched to the same feature in imgFeat2.
  • Inversely, your second image has 1107 features that are matched to the features of the first image.