Skip to content

Augmented Reality simple shape detector using OpenCV 4 for >= Android 5

License

Notifications You must be signed in to change notification settings

michaeltroger/shape-detection-android

Repository files navigation

Augmented Reality Simple Shape Detector using OpenCV 4 for Android

Android CI

Attention: This app was created in 2016. I was a beginner to Android development and Computer Vision back then. So don't expect a perfect code please. Over the years I updated the dependencies and converted it to Kotlin, while the business logic remained unchanged.

Note: Originally I targeted min SDK 15 (Android 4), more architectures ("mips", "mips64", "armeabi") and OpenCV 3 with this project. Nowadays the repo uses newer versions. If you need to support older devices, then you can look back in the repo's Git history (app version 1.2 / Git tag 3)

Augmented Reality shape detection

What is this repository for?

  • Uses the camera image to recognize triangles, rectangles and circles. It can also be configured to only detect a certain color (red). If a specific shape is detected the information can be shown on top of each shape as a label describing it (multiple shapes at the same time) or as an image respresenting the shape on top of the camera (only one shape is detected). Additionally also a sound depending on the detected shape can be played.
  • More computer vision projects at https://michaeltroger.com/computervision/

How do I get set up?

  • IDE: Android Studio (tested with 2023.3.1)
  • Android SDK
  • Images location: res/drawable | Sounds location: res/raw
  • Mode (label/image): Flag in MainActivity (default labels)
  • Mode (all colors / red only): Flag in MainActivity (default all colors)

Test images

Author

Michael Troger

Credits