Opencv 4.5.1 install in Jetpack 4.6.1
One of the best way to install Opencv with Cuda is to follow this link from Qengineering
Step 1 : clone the repo
git clone https://github.com/Qengineering/Install-OpenCV-Jetson-Nano.git
Step 2 : check if you have enough swap memory available for opencv installation for choosen version of opencv
OpenCV 4.6.0 -> 8.5 GB
OpenCV 4.5.5 -> 8.5 GB
OpenCV 4.5.4 -> 8.5 GB
OpenCV 4.5.3 -> 8.5 GB
OpenCV 4.5.2 -> 8.5 GB
OpenCV 4.5.1 -> 6.5 GB
OpenCV 4.5.0 -> 6.5 GB
To check the swap memory
jetson@Pratheeban:~$ free -m
total used free shared buff/cache available
Mem: 3964 524 2786 28 653 3259
Swap: 10174 0 10174
Step 3 : Make the sh file executable and Run the installation script
sudo chmod 755 ./OpenCV-4-5-1.sh
./OpenCV-4-5-1.sh
Check the Opencv is installed with CUDA
```commandline
jetson@Pratheeban:~$ python3
Python 3.6.9 (default, Jun 29 2022, 11:45:57)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__version__
'4.5.1'
>>> print(cv2.cuda.getCudaEnabledDeviceCount())
1
>>>