DepthAi Android Toolbox Application For OAK-D Devices
This Android application that utilizes the OAK-D camera and OpenCV library to perform YOLOv5 object detection and depth detection. The OAK-D camera provides high-quality images and videos with advanced depth sensing capabilities, while OpenCV is a widely-used computer vision library that provides various image processing and analysis tools.
With this application, users can take advantage of the OAK-D camera's advanced features to detect and track objects in real-time. The YOLOv5 model is used for object detection, which is a state-of-the-art deep learning model that can recognize a wide range of objects with high accuracy. The depth detection feature enables users to obtain information about the distance between objects in the scene, which can be useful for various applications such as robotics, autonomous driving, and augmented reality.
This project needs to OpenCV 4.7.0 (and other 4.x.y versions) for Android in Android Studio with Native Development Kit (NDK) support. Android NDK enables you to implement your OpenCV image processing pipeline in C++ and call that C++ code from Android Kotlin/Java code through JNI (Java Native Interface).
Make sure submodules are initialized and updated
git submodule update --init --recursive
-
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.
- In Android Studio, click on
-
Install OpenCV Android release :
-
Download OpenCV 4.7.0 Android release or download latest available Android release on OpenCV website.
-
Unzip downloaded file and put OpenCV-android-sdk directory next your project and rename folder
opencvsdk470
. If you want to place somewhere else please change path insettings.gradle
-
Optional(For linux) you can run setupOpenCV.sh for automatic download and setup gradle file for opencv
-
-
Open your opencv build.gradle and change your compileSdk,minSdkVersion,targetSdkVersion same as your main project. Due to gradle 8.0 you also gonna need to add namespace and enable aidl build config and set min JDK to 17.
namespace 'org.opencv'
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
buildFeatures {
aidl true
}
- Sync Gradle and run the application on your Android Device!
Kotlin, OpenCV 4, Android, Android Studio, Native, NDK, Native Development Kit, JNI, C++,