Re-installing OpenCV on Jetson Nano

Hello there,

I recently run this script: https://github.com/AastaNV/JEP/blob/master/script/install_opencv4.0.0_Nano.sh to install opencv-4.0.0 when I realised it is already preinstalled on the Nano (another version but is still ok) and so I stopped the installation in the middle of the process. The script removed libopencv by following command:

sudo sudo apt-get purge *libopencv*

.
Now if I want to rum some scripts in jetson-inference (which use opencv), which worked perfect so far, this message comes:

./imagenet-camera: error while loading shared libraries: libopencv_calib3d.so.3.3: cannot open shared object file: No such file or directory

Is there any way to replace it? I tried

sudo apt-get install *libopencv*

to fix but didn’t work. So does somebody know how to efficiently install opencv, preferably the version that was preinstalled, on the Jetson Nano to get things to work?

Thanks for the help in advance!

Hi,
We have verified below steps on TX2:
https://devtalk.nvidia.com/default/topic/1057460/jetson-tx2/custom-built-opencv-3-4-0-following-nvidia-advice-not-working/post/5363355/#5363355

Should also work if you run install_opencv4.0.0_Nano.sh on Jetson Nano. Please check if you see correct OpenCV version. If the version is correct to be 4.0.0, it is possible that imagenet-camera has dependency to 3.3.1.

OpenCV 4 drops a lot of CUDA related functions. To be safe stay with opencv 3.X branch.

you can build your own opencv or use prebuilt version in JetPack.

the ubuntu apt opencv is not working. that is why some software letting you uninstall the opencv first place.

Thank sunxishan for the information.

CUDA related functions are moved to
https://github.com/opencv/opencv_contrib/archive/4.0.0.zip

The script install_opencv4.0.0_Nano.sh also includes the package.