gitanat / simple-ocr-opencv

A simple python OCR engine using opencv
GNU Affero General Public License v3.0
525 stars 175 forks source link

Make master compatible with both OpenCV 2 and 3 #20

Closed gitanat closed 7 years ago

gitanat commented 7 years ago

If possible, we should merge the opencv3 branch back into master in a way that makes it work for both versions. CI needs to be configured to test both.

@RedFantom 's comment:

Edit: using cv2.version, it is possible to retrieve a version number in str format, but the python-opencv package from the Ubuntu repositories provides $Rev 4227 as version number instead of 3.x.x or 2.x.x, so that complicates things.

I'm getting '2.4.9.1' on Debian stable (Jessie), so this might Ubuntu-specific. It's annoying, but I guess we can hardcode specific values for the Ubuntu versions we know for now.

RedFantom commented 7 years ago

Well, the one in the Ubuntu repositories is OpenCV 2, so instead of checking for OpenCV 2, we should check for OpenCV 3. I have changed this behaviour in my commits to versions-branch on my fork of the repository. It's ready for merging after #18.

gitanat commented 7 years ago

Well, the one in the Ubuntu repositories is OpenCV 2, so instead of checking for OpenCV 2, we should check for OpenCV 3. I have changed this behaviour in my commits to versions-branch on my fork of the repository. It's ready for merging after #18.

True, it's cv 2.4 even for Ubuntu 16.10. I've merged #18, feel free to rebase and submit a PR

RedFantom commented 7 years ago

This issue can be closed, right? We've got OpenCV 3 support and OpenCV 2 support at the same time :) .

gitanat commented 7 years ago

True - thanks!