OpenCV fails to install on Jetson Nano [closed]
I am attempting to install OpenCV on my Jetson Nano following the "Get Your Jestson Nano Working" instructions in the Donkey Car instructions and when I complete the Cmake Setup instructions:
# Create a build directory
cd projects/cv2/opencv
mkdir build
cd build
# Setup CMake
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D INSTALL_C_EXAMPLES=OFF \
-D OPENCV_ENABLE_NONFREE=ON \
# Contrib path
-D OPENCV_EXTRA_MODULES_PATH=~/projects/cv2/opencv_contrib/modules \
# Your virtual environment's Python executable
# You need to specify the result of echo $(which python)
-D PYTHON_EXECUTABLE=~/env/bin/python \
-D BUILD_EXAMPLES=ON ../opencv
I get a message saying "CMake Error: The source directory "/home/donkey/projects/cv2/opencv/opencv" does not exist.
Of course it does not exist because "projects/cv2/opencv/" is in the "home" directory and there is no "donkey" directory in the "home" directory. Can anyone tell me what in the Cmake Setup instructions are causing "donkey" directory and the additional "/opencv" to be inserted in the installation path? I suspect that the Cmake Setup "-D CMAKE_INSTALL_PREFIX=/usr/local \" might be causing the problem. Also "-D OPENCV_EXTRA_MODULES_PATH=~/projects/cv2/opencv_contrib/modules \" does not result in an error. Regards, TCIII
I find it easier to use
cmake-qt-gui
to generate the Makefile... It's easier to set the options and you'll be sure that the paths are set up correctly.I'm not an expert in command line cmake, but it seems that the specified source path (last parameter) should be
..
(or/home/[username]/projects/cv2/opencv
) instead of../opencv
.Hi Kbami, Your path correction solution is absolutely correct. A member on the Donkey Car Slack Forum proposed the same solution yesterday and I was able to build and compile my Jetson Nano OpenCV app. Thank you for your solution to my issue.