4

I'm matching two images and in the 80% of the cases works but in some cases it crashes and show up this message:

... matches = matcher.match(d1, d2) error: ......\opencv-2.4.6\modules\features2d\src\matchers.cpp:365: error: (-215) trainDescCollection[iIdx].rows < IMGIDX_ONE

where d1 and d2 are the descriptors of the two images. I searh in Google but didn't found an answer. Maybe its a stupid error but I'm a noob in this field.

Furthermore I read in this website the following declaration :'it works perfectly just with SIFT and SURF descriptors(which are non free)'. Do you know if SIFT and SURF are protected by copyright?

Thanks all!

ndpu
  • 22,225
  • 6
  • 54
  • 69
user3075816
  • 169
  • 1
  • 11
  • You should consider cleaning up your question a little bit--you are asking two different things. I would focus more on the technical issue, and provide more details on what exactly you tried and what kinds of images you're trying to match. Provide more of your code. – Iguananaut Dec 06 '13 at 20:11

2 Answers2

6

This is an open bug in opencv. https://github.com/Itseez/opencv/issues/5700

Try using smaller images (for example, take a subset and/or down-sample). It looks as though the implementation involves a tricky (in the pejorative sense) optimisation which assumed that the number of features (in one of the images) is less than some magic power-of-two.

benjimin
  • 4,043
  • 29
  • 48
-2

You have right! I got a tip of the problem (I think). I take the two images where I get the problem and I run the same code in an another Computer. Well, in the other one I didn't get the error. In the one that crash I have these packages:

gdal 1.10.1
numpy 1.7.1
opencv-python 2.4.6
scipy 0.12.0

In the one that Works I have:

...
gdal 1.9.2
numpy 1.6.2
opencv-python 2.4.3
scipy 0.11.0
...
scikit-image 0.7.2
scikit-learn 0.13.1
scipy 0.11.0
scipy-stack 12.11.29
simplecv 1.3
...

And other more. Much more :D. Seems that I miss something but I don't know why it crash with the updated versions. Now I'm installing scipy-stack and scipy and scikit-image...Maybe the error is a missing of packages

georgeawg
  • 48,608
  • 13
  • 72
  • 95
user3075816
  • 169
  • 1
  • 11