The standard package is only for Python2, so prepare it yourself. There seems to be a problem with cmake's Python 3.4 detection process, and it didn't work very well, so I'll make a note of it as a reminder.
It was relatively easy to do in a windows environment, but I never thought it would be so hard on Ubuntu.
Referenced site Installer Opencv 3 sur Ubuntu 14.04 Trusty (It's not English, but I understand it as it is)
sudo apt install libopencv-dev build-essential checkinstall cmake pkg-config yasm libtiff4-dev libjpeg-dev libjasper-dev \
libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev \
libv4l-dev python3-dev python3-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev \
libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils python3.4-dev
I don't know if I need it
sudo cp /usr/include/python3.4m/pyconfig.h /usr/include/python3.4m/pyconfig.h_old
sudo cp /usr/include/i386-linux-gnu/python3.4m/pyconfig.h /usr/include/python3.4m/
I don't know that cmake has 3.4 in python version, so I'll tell you. FindPython{Interp,Libs}: Search for Python 3.4. The edit target is
git clone https://github.com/Itseez/opencv.git
cmake Set various options with cmake-gui In my environment, I got an error because the hash of the file is different, so I had to set WITH_IPP = OFF.
Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.6", minimum required is "2.7")
Could NOT find PythonLibs (missing: PYTHON_INCLUDE_DIRS) (found suitable exact version "2.7.6")
Found PythonInterp: /usr/bin/python3.4 (found suitable version "3.4", minimum required is "3.4")
Could NOT find PythonLibs (missing: PYTHON_LIBRARIES) (Required is exact version "3.4.0")
Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.6", minimum required is "2.7")
Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so (found suitable exact version "2.7.6")
Found PythonInterp: /usr/bin/python3.4 (found suitable version "3.4", minimum required is "3.4")
Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.4m.so (found suitable exact version "3.4.0")
make Once you have a Makefile, there should be no problem after that.
make -j4
sudo make install
Recommended Posts