0

I am compiling OpenCV 3.4.1 in my Raspberry Pi 3b+. I have downloaded both opencv and opencv contrib. This is the build command I give : (ABSOLUTE NEWBIE in compiling using cmake and OpenCV)

cd ~/opencv-3.4.1/
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE \
      -D CMAKE_INSTALL_PREFIX=/usr/local \
      -D INSTALL_PYTHON_EXAMPLES=ON \
      -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.4.1/modules \
      -D ENABLE_PRECOMPILED_HEADERS=OFF \
      -D BUILD_EXAMPLES=ON ..

After the building process is over, the compilation process still uses python 2.7 interpreter. What other option should I add to compile it using python3. I looked on stackoverflow and found this :how to build opencv for python3 when both python2 and python3 are installed But since it does not have a correct answer I am a bit skeptical.

Followed this guide : https://www.deciphertechnic.com/install-opencv-python-on-raspberry-pi/

Using Python 3.5.3

Please ask for any further info that is required. Thanks.

Tanmay Bhatnagar
  • 2,330
  • 4
  • 30
  • 50
  • "But since it does not have a correct answer I am a bit skeptical." - But you have tried its [high voted answer](https://stackoverflow.com/a/39409570/3440745), haven't you? Does it helps? – Tsyvarev Feb 26 '19 at 12:50
  • Ya I tried the highest voted answer. It didn't help. Python 2 was used to build opencv – Tanmay Bhatnagar Feb 26 '19 at 12:51
  • 1
    It usually tells you after the cmake is done like a report and tells which version will be used. You can also use ccmake to change specific parameters a reconfigure it. look for the python params – api55 Feb 26 '19 at 12:59
  • I looked for the parameters that when I stumbled upon the mentioned question on stack overflow but the best voted answer didn't help. – Tanmay Bhatnagar Feb 26 '19 at 13:05
  • 1
    Possible duplicate of [I have 2 versions of python installed, but cmake is using older version. How do I force cmake to use the newer version?](https://stackoverflow.com/questions/15291500/i-have-2-versions-of-python-installed-but-cmake-is-using-older-version-how-do) – GPPK Feb 26 '19 at 13:18

0 Answers0