Re-installing OpenCV on Jetson Nano

Hello there,

I recently run this script: 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: 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!

We have verified below steps on TX2:

Should also work if you run 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

The script also includes the package.