Sunday, 28 May 2017

Installing OpenCV3 for Python 3 on Windows

I need to use python for face recognition as part of the server for a charity app I'm working on. The app is supposed to show charity logos, but in the case of smaller charities, sometimes the google custom search I use to search for the logos returns instead a picture with a person in it. I need to identify cases where this happens and use a placeholder image instead.

My first attempt to install opencv was through pip from anaconda:

pip install opencv-python

However this gave me the following error when I tried to import cv2:

ImportError: DLL load failed: The specified module could not be found.

I uninstalled the anaconda version and found a 64 bit wheel of opencv for python 3.6 at http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv. Downloading this and installing it with pip worked perfectly. I don't know why the original error occured, but it looks like python 3 support might not be great with opencv at the moment.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

Why won't my Angular app include cookies in a POST request?

 Recently while working on an Angular web app operating with CORS on localhost against a SpringBoot server I had an issue where my GET reque...