user3075816
user3075816

Reputation: 169

Error -215 trainDescCollection[iIdx] Python OpenCV

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!

Upvotes: 4

Views: 3332

Answers (2)

user3075816
user3075816

Reputation: 169

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

Upvotes: -2

benjimin
benjimin

Reputation: 4890

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.

Upvotes: 6

Related Questions