# opencv-mobile: a stripped OpenCV for Android, iOS and ARM Linux

> nihui/opencv-mobile ships prebuilt OpenCV binaries for Android, iOS, ARM Linux, Windows, Linux, MacOS, HarmonyOS, WebAssembly and the Apple watch/tv/vision platforms. The trade is clear: a much smaller library in exchange for a feature set you do not get to choose.

**nihui/opencv-mobile** — The minimal opencv for Android, iOS, ARM Linux, Windows, Linux, MacOS, HarmonyOS, WebAssembly, watchOS, tvOS, visionOS

- Repository: https://github.com/nihui/opencv-mobile
- Stars: 3,367 · Forks: 459
- Language: C++
- License: Apache-2.0
- Published: 2026-09-24 · Updated: 2026-09-24 · Language: en
- Canonical page: https://hysenlabs.com/projects/nihui-opencv-mobile

## What problem opencv-mobile solves, and for whom

The official OpenCV Android and iOS packages are large. The README's own size table puts the official opencv 5.0.0 Android package at 303 MB against 25 MB for opencv-mobile, the iOS package at 42.1 MB against 5.56 MB, and the source zip at 81.9 MB against 9.07 MB. If you are shipping an app to a store with download limits, or deploying to an embedded ARM board with limited flash, that difference decides whether OpenCV is usable at all.

The intended audience is app and embedded developers who need a known subset of OpenCV and would rather not carry the rest. The project describes itself as "the minimal build of opencv library" for Android, iOS and ARM Linux, with packages for Windows, Linux, MacOS, HarmonyOS and WebAssembly added later. It is not a wrapper, not a binding, and not a fork with new algorithms. It is the same OpenCV API, compiled with a reduced configuration and shipped as prebuilt archives.

The second problem it addresses is build effort. Cross-compiling OpenCV for arm64 Android, iOS device plus simulator, watchOS, tvOS and visionOS is a multi-hour exercise in toolchain configuration. opencv-mobile publishes the results, so a developer can download a zip and link it.

## How the minimal build is produced

The repository layout shows the mechanism. There are four CMake option files at the top level: opencv2_cmake_options.txt, opencv3_cmake_options.txt, opencv4_cmake_options.txt and opencv5_cmake_options.txt. Each one corresponds to a supported OpenCV major line, and each is the configuration passed to OpenCV's CMake build to turn modules off and shrink the result. Alongside them are a patches/ directory, a toolchains/ directory for cross-compilation, a highgui/ directory, and a fix-windows-sdk-26100-arm64-wchar.patch at the root.

That structure tells you what opencv-mobile actually is: a reproducible build recipe plus the artifacts it produces. The README states that all binaries are compiled from source on GitHub Actions. The toolchains directory holds the cross-compilation files for the target platforms, and the patches directory holds the changes applied to upstream OpenCV before building. If you want to know whether a given module survived the cut, the CMake options file for your OpenCV version is the authoritative answer, not the README.

The README also lists three additions that go beyond stock OpenCV behaviour: cv::putText supporting full-width CJK characters, cv::imshow supporting Linux framebuffer and Windows, and cv::VideoWriter supporting jpg streaming over http. These are the project's own patches, which is why they are called out as new features rather than upstream behaviour.

## Downloading a package and linking it into a first project

There is no package manager step here. The README points to the releases page for downloads, and every artifact is a zip named by OpenCV version and platform. The README gives the pattern opencv-mobile-<version>-<platform>.zip, with version strings 2.4.13.7, 3.4.20, 4.13.0 and 5.0.0, and platform suffixes including android, ios, ios-simulator, harmonyos, and the bare source zip with no suffix. The README's own download links have this shape:

```bash
https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-5.0.0-android.zip
```

After downloading and unpacking the archive for your platform, you get a directory containing the headers and the prebuilt libraries. Point your CMake build at it with a toolchain file and an OpenCV_DIR hint, then link the OpenCV modules you use. The exact module list is whatever the opencv5_cmake_options.txt configuration left enabled, so check the unpacked directory rather than assuming.

One constraint is stated plainly in the README: OpenCV 5.0.0 packages require a C++17-capable compiler, and Windows OpenCV 5.0.0 packages are provided for VS2019 and VS2022 only. If your toolchain predates C++17, you need a 4.x or 3.x package instead.

The iOS side needs both the device and simulator archives, since the README publishes opencv-mobile-5.0.0-ios.zip and opencv-mobile-5.0.0-ios-simulator.zip as separate downloads. The README also mentions a prebuilt package for Apple xcframework, which is the form that lets a single Xcode target cover device and simulator without manual archive selection.

## The feature set is fixed, and that is the real cost

The size reduction is not free. A minimal build is minimal because modules were disabled, and the README never enumerates which ones. It lists supported platforms and versions, points at the option files in the repository, and stops there. A developer who needs a module that the configuration dropped has two options: build OpenCV from source themselves, or find another distribution. Neither is a small detour.

This is the failure mode to plan for. Code that compiles fine against a full OpenCV install can fail to link against opencv-mobile with an undefined symbol, and the error will name the OpenCV function rather than the missing module, which makes the cause non-obvious on first encounter.

The version matrix adds a second constraint. Four OpenCV lines are published, from 2.4.13.7 through 5.0.0. A project pinned to an OpenCV release outside those four, or to a specific patch release within a line, has no matching archive. The README does not document a rollback path, a compatibility guarantee between package versions, or how long older lines stay published.

There is also a trust dimension the README addresses directly rather than leaving implicit. It states that all binaries are compiled from source on GitHub Actions and that there is "no virus, no backdoor, no secret code". For teams that cannot accept a third-party binary in their build, the option files and toolchains in the repository are the way to reproduce the build yourself, which returns you to the compile time the project was meant to save.

## opencv-mobile against the official OpenCV packages

The honest comparison is not opencv-mobile versus some other library. It is opencv-mobile versus the official OpenCV distribution for the same platform, and the README's size table is the whole argument: 25 MB versus 303 MB on Android, 5.56 MB versus 42.1 MB on iOS.

The difference in approach is that the official packages aim to give you OpenCV as upstream defines it, with the module set and configuration that the OpenCV project ships. opencv-mobile takes the opposite position: one maintainer's judgement about which parts a mobile or embedded application actually needs, applied consistently across every platform and published as ready-to-link archives. That judgement is the product.

It follows that the official package is the right choice when you need the full module set, when you need to build OpenCV with your own flags, or when you need a platform or version opencv-mobile does not publish. opencv-mobile is the right choice when your module needs are narrow and your size budget is not. If you are unsure which side you are on, the answer is in the CMake option files: read them, compare the enabled modules against your include statements, and the decision becomes mechanical rather than a matter of preference.

## Maintenance, licensing and what a version bump costs

The repository is not archived. The most recent release listed is v36, published on 2026-07-12, and the last push to the default branch was on 2026-07-12 as well. The release cadence visible in the release list is roughly two per year: v34 on 2025-08-03, v35 on 2026-01-02, v36 on 2026-07-12. That is a slow, steady rhythm, not a fast-moving project, and it means a fix you need may wait months for the next release.

Upgrading means replacing the unpacked package directory and rebuilding against it. Because the OpenCV version is baked into the archive name, a jump from 4.13.0 to 5.0.0 is also a jump in C++ requirement, since the README states 5.0.0 packages need a C++17-capable compiler. On Windows it is narrower still: 5.0.0 packages exist for VS2019 and VS2022 only. A team on an older MSVC cannot take the 5.0.0 package at all.

The project is licensed Apache-2.0, per the LICENSE file at the repository root and the badge at the top of the README. OpenCV itself is also Apache-2.0 licensed, but note that the packages bundle compiled OpenCV code plus the project's own patches, so if you redistribute the binaries you are redistributing both. This is a description of what the repository states, not legal advice; have your own counsel review attribution and notice requirements before shipping.

## Conclusion

Adopt opencv-mobile if you ship a mobile or embedded app that needs core OpenCV image processing and you care about package size, and you can live inside the fixed feature set of the prebuilt archives. Do not adopt it if your pipeline depends on OpenCV modules the maintainer strips out, or if you need to build against a custom OpenCV configuration. Before committing, download the archive for your platform and OpenCV version from the releases page, inspect the headers and library list it actually contains, and confirm that every module your code calls is present.

## FAQ

### What exactly is opencv-mobile used for?

It provides a minimal prebuilt build of the OpenCV library so that Android, iOS, ARM Linux and other target applications can link OpenCV without carrying the full official package. The README frames it as the minimal build of opencv for those platforms.

### Do I have OpenCV installed if I download an opencv-mobile package?

Downloading an opencv-mobile zip gives you prebuilt headers and libraries for one platform and one OpenCV version, not a system-wide OpenCV installation. You still need to point your build at the unpacked directory and link the modules you use.

### Is OpenCV free to use, and what license does opencv-mobile carry?

The repository ships under Apache-2.0, shown by the LICENSE file at the root and the badge in the README. The packages bundle compiled OpenCV code and the project's own patches, so redistributing the binaries means redistributing both.

### Do people still use OpenCV, and is opencv-mobile a replacement for it?

opencv-mobile is not a replacement for OpenCV but a minimal prebuilt build of it, so it inherits OpenCV's API and its module set as configured by the project's CMake option files. Whether that subset covers your needs depends on which modules your code calls.

## Sources

- [Issues](https://github.com/nihui/opencv-mobile/issues)
- [License: Apache-2.0](https://github.com/nihui/opencv-mobile/blob/master/LICENSE)
- [nihui/opencv-mobile on GitHub](https://github.com/nihui/opencv-mobile)
- [README](https://github.com/nihui/opencv-mobile/blob/master/README.md)
- [Releases](https://github.com/nihui/opencv-mobile/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/nihui-opencv-mobile
