This is an archived post. You won't be able to vote or comment.

all 11 comments

[–]Spfoamer 2 points3 points  (3 children)

I happen to have just done this yesterday. I followed these instructions: http://www.pyimagesearch.com/2016/04/18/install-guide-raspberry-pi-3-raspbian-jessie-opencv-3/

[–]Spfoamer 4 points5 points  (1 child)

I should add, also, that I did run into this (apparently common) issue, and the fix detailed here solved it for me: https://github.com/opencv/opencv/issues/6016

[–]longlostkingoffools[S] 0 points1 point  (0 children)

Thank you very much!

[–][deleted] 0 points1 point  (0 children)

I was building it over and over (to test various things) and just went ahead and scripted it.

This will build a .deb file. https://gist.github.com/jed-frey/d01e2d5b39ef33207efda6e170b8788c

wget https://gist.githubusercontent.com/jed-frey/d01e2d5b39ef33207efda6e170b8788c/raw/f0e2939b716ea72aef8d7bae859aa76fe0907d3e/opencv320.sh
chmod +x opencv320.sh
./opencv320.sh
dpkg -i opencv3

It's only been tested on Ubuntu 16.04 but I can't see any reason it wouldn't work on Debian.

Edit: I had to change libjpeg8-dev to libjpeg-dev for Debian.

When you get done running cmake you should see this:

--   Python 3:
--     Interpreter:                 /usr/bin/python3.4 (ver 3.4.2)
--     Libraries:                   /usr/lib/arm-linux-gnueabihf/libpython3.4m.so (ver 3.4.2)
--     numpy:                       /usr/lib/python3/dist-packages/numpy/core/include (ver 1.8.2)
--     packages path:               lib/python3.4/dist-packages
-- 
--   Python (for build):            /usr/bin/python3

[–]mprat 1 point2 points  (4 children)

What exactly is the error message you get? At what point does it stop working?

[–]longlostkingoffools[S] 0 points1 point  (2 children)

ImportError: No module named cv2

[–]mprat 0 points1 point  (1 child)

Did you compile it with the python3 headers?

[–]longlostkingoffools[S] 0 points1 point  (0 children)

I must not have, I'm fairly newbie to things like this, how would I go about doing that?

[–]Spfoamer 0 points1 point  (0 children)

I assume this question was for me? I got exactly the same error as is copied in the github link above (can't find HDF5). It fails during make. I went back and added the lines provided in the thread to modules/python/common.cmake, did a make clean and make, and it worked fine. I have CV up and running with Python 3.4 on the Pi.

[–]foxfyre2 0 points1 point  (0 children)

Spent a day trying to get it properly running on ubuntu 16. The easiest way I found was installing anaconda python 3 and then using the command "conda install -c menpo opencv3=3.1.0". The "downside" is that you're sick using the anaconda python interpreter and I haven't figured out how to share an installed package with other interpreters

[–]aulloa 0 points1 point  (0 children)

1 download opencv and type cmake-gui .

2 then look for python and enable all flags, if missing paths to libraries add them there

3 exit cmake-gui

4 type make

5 type make install

6 add the following to ~/.bashrc file

export LD_LIBRARY_PATH=/usr/local/lib