Page 1 of 1

Correct build and install for OpenCV and Pi4

Posted: Tue Sep 10, 2019 2:21 pm
by ChicagoBob123
Pi4 is 64 bit and is Arm8 is there a build process to get the best performance from OpenCV?
I tried compiling and building following these directions and it did not work.

1 wget https://github.com/opencv/opencv/archive/4.1.0.zip 2 unzip 4.1.0.zip
3 cd opencv-4.1.0 4 mkdir build && cd build
5 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/ -DPYTHON3_EXECUTABLE=/usr/lib/python3.7 –DPYTHON_INCLUDE_DIR=/usr/include/python3.7 –DPYTHON_INCLUDE_DIR2=/usr/include/arm-linux-gnueabihf/python3.7m –DPYTHON_LIBRARY=/usr/lib/arm-linux-gnueabihf/libpython3.7m.so ..
6 make && make install

export OpenCV_DIR=/usr/local/share/opencv4
The make && make install had an error
CMake Error at cmake_install.cmake:41(file):
file INSTLL cannot set permission on
"use/local/share/licences/opencv4/opencl-hearders-LICENSE.txt"
make: *** [Makfile:74: install] Error 1
Any step by step directions that work for installing OpenCV on the Pi4

Re: Correct build and install for OpenCV and Pi4

Posted: Tue Sep 10, 2019 2:25 pm
by RaTTuS
make install should be
sudo make install
as you need to make changes to system stuff
the make should not be sudo

Re: Correct build and install for OpenCV and Pi4

Posted: Wed Sep 11, 2019 1:35 pm
by ChicagoBob123
The OpenCV install and recompile has failed. There were errors. So far no sucess in building a proper OpenCV for Pi4 with a fresh OS installed. Never thought this part would be hard.