Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


Sidebar

products:sbc:vim3:npu:opencv-dnn

This is an old revision of the document!


OpenCV DNN Usage

Just use for VIM3 only, not for VIM3L.

Install Dependencies

Before installing the OpenCV package, you need to install the dependencies.

sudo apt update
sudo apt install python3 python3-dev python3-numpy cmake libgtk2.0-dev

Install OpenCV

Get the OpenCV package and install it.

wget https://dl.khadas.com/development/opencv-4.7-2.deb
sudo dpkg -i opencv-4.7-2.deb

Run Test

Get Demo Source

Get the example repository from OpenCV_NPU_Demo.

cd ~
git clone https://github.com/khadas/OpenCV_NPU_Demo.git

Compile

Compile with cmake tool.

cd ~/OpenCV_NPU_Demo/cpp_demo
mkdir build && cd build
cmake ..
make

Run

After the operation is successful, you can see that the camera has captured the face.

cd ~/OpenCV_NPU_Demo/cpp_demo/build
./detect-camera 1 ../../model/yunet_int8.onnx # My cam is /dev/video1, so there is 1

opencv-c.jpeg

Last modified: 2023/05/10 00:26 by hyphop