I have issues with the use of OpenCV in the Nano target, I installed all with Nvidia SDK, then I. use Matlab to generate code to be compiled on the Nano. The first error that I have is the following:
/main.cu:10:10: fatal error: opencv2/opencv.hpp: No such file or directory
include “opencv2/opencv.hpp”
I fix this with the following command:
mv /usr/include/opencv4/opencv2 /usr/include/opencv2
Now the file can be located, nevertheless now I have new issues:
STDERR: /usr/bin/ld: cannot find -lopencv_contrib
/usr/bin/ld: cannot find -lopencv_gpu
/usr/bin/ld: cannot find -lopencv_legacy
/usr/bin/ld: cannot find -lopencv_superres
/usr/bin/ld: cannot find -lopencv_ts
/usr/bin/ld: cannot find -lopencv_videostab
/usr/bin/ld: cannot find -lopencv_facedetect
/usr/bin/ld: cannot find -lopencv_imuvstab
/usr/bin/ld: cannot find -lopencv_tegra
/usr/bin/ld: cannot find -lopencv_vstab
/usr/bin/ld: cannot find -lnppi
collect2: error: ld returned 1 exit status
I check on the opencv.cp file located on /usr/shared/visionworks/sources/ ans saw the following:
Package Information for pkg-config
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir_old=${prefix}/include/opencv
includedir_new=${prefix}/include
Name: OpenCV
Description: Open Source Computer Vision Library
Version: 2.4.9
Libs: -L${libdir} -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_ts -lopencv_video -lopencv_videostab -lopencv_facedetect -lopencv_imuvstab -lopencv_tegra -lopencv_vstab -lcufft -lnpps -lnppi -lnppc -lcudart -lstdc++ -lrt -lpthread -lm -ldl
Cflags: -I${prefix}/include -I${prefix}/include/opencv
Here the Cflags are incorrect (does not include opencv4) and the libraries names are incorrect, on the nano the so files are named libopencv_XXX but on the .cp file they are defined as lopencv_XXX, how can I configure the Nano to look for the correct files on the correct path?
Currently I have the following environment variables on the nano:
PKG_CONFIG_PATH=“/usr/share/visionworks/sources”
LD_LIBRARY_PATH=“/usr/local/cuda-10.0/lib64:/usr/lib/aarch64-linux-gnu”