How to create Jetson Nano image with OpenCV installed

I used jetson-disk-image-creator.sh to create image data for Jetson Nano.
sudo ./jetson-disk-image-creator.sh -o test_image -b jetson-nano -r 300

OpenCV was not included in the image.

How can I create an image with OpenCV installed, like jetson-nano-jp461-sd-card-image?

Hi,

is there any reason you don’t want to use the pre-built SD card image?

For that case, you may try QEMU+chroot to install packages into the rootfs before flashing it to your device.
(Run all of the following commands with sudo privilege.)

Run these commands to prepare for the environment:

mount --bind /dev Linux_for_Tegra/rootfs/dev
mount --bind /dev/pts Linux_for_Tegra/rootfs/dev/pts
mount --bind /proc Linux_for_Tegra/rootfs/proc
mount --bind /sys Linux_for_Tegra/rootfs/sys
cp /etc/resolv.conf Linux_for_Tegra/rootfs/etc/resolv.conf
cp /usr/bin/qemu-aarch64-static Linux_for_Tegra/rootfs/usr/bin

Then chroot into Linux_for_Tegra/rootfs:

chroot Linux_for_Tegra/rootfs
apt update
apt install libopencv-dev
exit

Un-mount those folders and delete the QEMU binary from Linux_for_Tegra/rootfs/usr/bin, and generate the SD card image as you would do previously.
However, you should note that the pre-built OpenCV binaries do not come with CUDA support, and you would need to compile it yourself if you need CUDA acceleration.

Hi,

Thank you for your advice.

I was able to create the Jetson Nano image with OpenCV installed.

We are developing a driver for a custom MIPI-CSI camera module and wanted to create an image of it.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.