Exploring OpenCV 4.3.0 & AI with camera(s) & C++ on the Jetson Nano B01. This serves as a documentation & reference for the various resources available for the Jetson Nano & Xavier NX development board.
The directory is split into 3 sections:
- AI_ML: AI & Machine Learning related project(s)
- cpp_proj: C++ related projects
- scripts: Installation & setup scripts
$ gst-launch-1.0 nvarguscamerasrc sensor_mode=0 ! 'video/x-raw(memory:NVMM),width=3820, height=2464, framerate=21/1, format=NV12' ! nvvidconv flip-method=0 ! 'video/x-raw,width=960, height=616' ! nvvidconv ! nvegltransform ! nveglglessink -e
- libargus/Argus (For image processing):
/usr/src/jetson_multimedia_api/argus/
- Multimedia API:
/usr/src/jetson_multimedia_api/
- VisionWorks:
/usr/share/visionworks/sources
Python & Shell Scripts are found in the
scripts
directory.
Update the script(s) permissions before running.
$ sudo chmod +x
Note: Ensure that the CUDA compiler (nvcc) is added to ~/.bashrc
$ echo '# Append CUDA tools path' >> ~/.bashrc
$ echo 'export PATH=/usr/local/cuda-10.2/bin${PATH:+:${PATH}}'>> ~/.bashrc
$ echo 'export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}'>> ~/.bashrc
$ echo 'export CUDA_INCLUDE_DIRS=/usr/local/cuda-10.2/include'>> ~/.bashrc
$ echo 'export CUDA_ROOT_ENV=/usr/local/cuda-10.2'>> ~/.bashrc
The CUDA samples have to be compiled, run makeCUDAsample.sh
to compile the samples.
The samples would be copied and compiled at ~/cuda_samples.
$ ./makeCUDAsample.sh
Only applicable if an external heatsink fan is attached to the Jetson Nano.
Run runFan.sh
to turn on the heatsink fan.
$ ./runFan.sh
Make the runCam.sh
script executable:
$ chmod + x runCam.sh
Test the camera connected via runCam.sh
:
$ runCam.sh
To test 2 cameras, a -d
flag would be added:
$ runCam.sh -d
Note: Compile the OpenCV source before installing ROS!
OpenCV 4.1.1 is installed in Jetson Nano by default, but without CUDA support. Run
installOpenCV.sh
to compile & install OpenCV 4.3.0 from source.
Install the source at
/usr/local
.
$ ./installOpenCV.sh
Run getROS_melodic.sh
to install ROS Melodic.
$ ./getROS_melodic.sh
Ensure that OpenCV is installed before installing openVSLAM. Run
getOpenVSLAM.sh
to install OpenVSLAM.
$ ./getOpenVSLAM.sh
More information could be found here.
Licensed under the MIT License.