acdha / image-mining

Experiments mining image collections using OpenCV
Other
64 stars 21 forks source link

updated for new opencv #10

Closed jmhessel closed 9 years ago

jmhessel commented 9 years ago

opencv was changed, and with newer versions your scripts don't work anymore -- this small change fixes them. perhaps there's a smarter check that can be made to see what version is required, or you could just require opencv 3.X+ for your script.

acdha commented 9 years ago

Ah, thanks for the warning & extra thanks for the patch. If you have a second, does cv2.__version__ still exist on OpenCV 3? If so, I could do something like cv2.__version__.startswith('2.') to choose which version of that code to use.

jmhessel commented 9 years ago
>>> import cv2
>>> cv2.__version__
'3.0.0-alpha'

Yup!

Sorry I didn't put this in -- I wasn't sure which direction you wanted to go (higher openCV requirement or all version support)

Everything else works great.

acdha commented 9 years ago

I just merged a modified version of your patch in cfe842c42f122d676924b16f8af30c2431f9cd5c with a simple version check to pick the new code. I've tested this under OpenCV 2.4.11 but have not yet tried this on 3.x (which is still compiling).

acdha commented 9 years ago

That took a little longer than expected but I verified this works on OpenCV 3, too.

acdha commented 9 years ago

Thanks again for the patch!

jmhessel commented 9 years ago

No problem; thanks for writing this!