Skip to main content

6-1 Installation of OpenCV

This chapter explains how to enable and install OpenCV across different platforms, including RZ/G2L, RZ/V2H, and Ubuntu Linux.


RZ/G2L Platform

By default, the official RZ/G2L BSP does not include OpenCV. To enable OpenCV support, you need to modify the Yocto build configuration.

Step 1: Update local.conf

Refer to the end of the following page:

GitHub - local.conf

You can also search for the keyword "opencv" in the file. Make sure the following lines are added to local.conf:

IMAGE_INSTALL_append = " opencv opencv-dev "
PACKAGECONFIG_append_pn-opencv = " gtk opencl python3"
PACKAGECONFIG_append_pn-nativesdk-opencv = " gtk"

Step 2: Add OpenCV Recipes

Ensure the following recipe is included in your Yocto layer:

OpenCV Yocto Recipe

These modifications will allow you to build OpenCV as part of your Yocto image for the RZ/G2L board.

RZ/V2H Platform

For the RZ/V2H platform, OpenCV is already included in the official BSP. You simply need to build the Yocto project as usual. Once the image is generated and flashed onto the device, you can immediately run OpenCV-based applications without any additional setup.

Ubuntu Linux

To accelerate development and testing, it's also useful to have OpenCV installed on your Ubuntu Linux host system. You may install it via package manager.

sudo apt install libopencv-dev
pip install opencv-python

libopencv-dev is the C/C++ development package.

opencv-python is the Python binding for OpenCV.

note

The version installed via APT is usually older.