opencv-mobile
Introduction
opencv-mobile is a lightweight version of the OpenCV library that minimizes the compilation of OpenCV by adjusting compilation parameters and removing certain portions of the OpenCV source code.
opencv-mobile provides commonly used functionalities of OpenCV, such as image processing, matrix operations, and more. It stays synchronized with the upstream version and has no third-party dependencies. In the majority of cases, it can seamlessly replace the official OpenCV with only 1/10th of the size, making it particularly suitable for mobile and embedded environments with specific size requirements.
Source code package size comparison:
OpenCV 4.9.0 | The Official OpenCV | opencv-mobile |
---|---|---|
source zip | 93 MB | 10.7 MB |
android | 242 MB | 18.1 MB |
ios | 202 MB | 10.0 MB |
ios+bitcode | missing :( | 34.5 MB |
Project link: https://github.com/nihui/opencv-mobile | Thanks to nihui
!
opencv-mobile already supports hardware-accelerated JPG decoding and VPSS (Video Processing Subsystem) hardware acceleration on Milk-V Duo/Duo256M/DuoS.
1. Quick start
We can directly download its release precompiled package to test basic functions or carry out application development.
A test example is provided in the project source code, demonstrates how to use opencv-mobile to load images, zoom, and save images.
Taking this test program as an example, we will introduce the compilation method of opencv-mobile in Linux environment and how to run it on Milk-V Duo.
Download pre-compiled package for Milk-V Duo
The release link of opencv-mobile: https://github.com/nihui/opencv-mobile/releases
Download the latest pre-compiled package of Milk-V Duo: opencv-mobile-4.9.0-milkv-duo.zip
Create a new test program directory
Create a new directory picture-resize
and enter it:
mkdir picture-resize
cd picture-resize
Extract the pre-compiled package downloaded to the current directory:
unzip ../opencv-mobile-4.9.0-milkv-duo.zip