Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
A tutorial for setting up OpenCV 4.12.0 (and other 4.x.y version) for Android in Android Studio with Native Development Kit (NDK) support for C++ development.
| Date | Stars |
|---|---|
| 2026-07-24 | 308 |
| 2026-07-25 | 308 |
| 2026-07-28 | 308 |
| 2026-07-30 | 308 |
| 2026-08-06 | 308 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
[](https://opensource.org/licenses/MIT)
# Native OpenCV for Android with Android NDK
A tutorial for setting up OpenCV 4.12.0 (and other 4.x.y versions) for Android in [Android Studio](https://developer.android.com/studio) with Native Development Kit (NDK) support.
[Android NDK](https://developer.android.com/ndk) enables you to implement your [OpenCV](https://opencv.org) image processing pipeline in C++ and call that C++ code from Android Kotlin/Java code through JNI ([Java Native Interface](https://en.wikipedia.org/wiki/Java_Native_Interface)).
This sample Android application displays a live camera feed with an OpenCV *adaptive threshold* filter applied on each frame. The OpenCV *adaptive threshold* call is performed in C++.
## Setup
| Tool | Version |
| --- | --- |
| [OpenCV](https://opencv.org) | 4.12.0
| [Android Studio](https://developer.android.com/studio) | 2024.2.1 (Ladybug)
| [Android Build Tool](https://developer.android.com/about) | 34.0
| [Android NDK](https://developer.android.com/ndk/guides) | 27.0
| [Kotlin](https://kotlinlang.org/docs/reference/) | 1.8.10
| [Gradle](https://gradle.org) | 8.13
| Target SDK | 34 (Android 14)
| Mac OS | 12.4
## Updates
### October 2, 2025
- **Claude Sonnet Assisted Update**: Project updated to OpenCV 4.12.0 and latest Android development tools
## How to use this repository
1. [Download and Install Android Studio](https://developer.android.com/studio)
2. [Install NDK and CMake](https://developer.android.com/studio/projects/install-ndk.md)
3. Clone this repository as an Android Studio project :
* In Android Studio, click on `File -> New -> Project from Version Control -> Git`
* Paste this repository *Github URL*, choose a *project directory* and click next.
4. Install *OpenCV Android release* :
* Download [OpenCV 4.12.0 Android release](https://github.com/opencv/opencv/releases/download/4.12.0/opencv-4.12.0-android-sdk.zip) or download latest available Android release on [OpenCV website](https://opencv.org/releases/).
* Unzip downloaded file and put **OpenCV-android-sdk** directory on a path of your choice.
5. Link your *Android Studio* project to the *OpenCV Android SDK* you just downloaded :
* Open [gradle.properties](gradle.properties) file and edit following line with your own *OpenCV Android SDK* directory path :
opencvsdk=/Users/Example/Downloads/OpenCV-android-sdk
6. Sync Gradle and run the application on your Android Device!
Note: MainActivity is written in Kotlin but you can comment out the [Kotlin](/app/src/main/kotlin/com/example/nativeopencvandroidtemplate/MainActivity.kt) file and uncomment the [Java](/app/src/main/java/com/example/nativeopencvandroidtemplate/MainActivity.java) file to use Java.
## Bootstrap a new Android project with Native OpenCV support
Here are the steps to follow to create a new Android Studio project with native OpenCV support :
1. [Download and Install Android Studio](https://developer.android.com/studio)
2. [Install NDK and CMake](https://developer.android.com/studio/projects/install-ndk.md)
3. Create a new *Native Android Studio project* :
* Select `File -> New -> New Project...` from the main menu.
* Click `Phone and Tablet tab`, select `Native C++` and click next.
* Choose an `Application Name`, select your favorite `language` (Kotlin or Java), choose `Minimum API level` (21 here) and select next.
* Choose `Toolchain default` as *C++ standard* and click Finish.
4. Install *OpenCV Android release* :
* Download [OpenCV 4.12.0 Android release](https://github.com/opencv/opencv/releases/download/4.12.0/opencv-4.12.0-android-sdk.zip) or download latest available Android release on [OpenCV website](https://opencv.org/releases/).
* Unzip downloaded file and put **OpenCV-android-sdk** directory on a path of your choice.
5. Add *OpenCV Android SDK* as a module into your project :
* Open Excerpt of 7,388 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:e84eeebd5003195e, topic:computer-vision, topic:opencv