Skip to content

This simple app shows how to include OpenCV 4.5 native code to perform image digital processing in C++. The app presents a simple binarization process in HSV color space for this example.

Notifications You must be signed in to change notification settings

vlarobbyk/opencv4.2-android-studio-simple-app

Repository files navigation

A simple app to use OpenCV 4.5 in Android Studio Bumblebee

This repository has only educational and teaching purposes.

Description

This repository contains an example of an Android Studio app (for Android) showing how to use OpenCV 4.5 to perform a simple binarization in HSV Color Space.

Getting Started

Dependencies

Installing

Executing program

  • Update references to OpenCV 4.5. for Android libraries, according to your local paths
  • Import the project into Android Studio and Run
  • Add your own function according to your needs, following this format:
extern "C" JNIEXPORT void JNICALL
Java_giiata_vision_opencvhelade_MainActivity_filters(
        JNIEnv* env,
        jobject /* this */,
        jobject bitmapIn,
        jobject bitmapOut,
        jint hMin,
        jint sMin,
        jint vMin,
        jint hMax,
        jint sMax,
        jint vMax) {


    cv::Mat src;
    bitmapToMat(env, bitmapIn, src, false);
    //cv::flip(src, src, 0);
    cv::Mat tmp;
    cv::cvtColor(src, tmp, cv::COLOR_BGR2HSV);
    cv::inRange(tmp, cv::Scalar(hMin, sMin, vMin), cv::Scalar(hMax, sMax, vMax), tmp);

    matToBitmap(env, tmp, bitmapOut, false);
}

Sample video

Video-Sample-OpenCV-4.2-Android-Studio-Bumblebee.webm

Authors

Contributors names and contact info

Vladimir Robles-Bykbaev @vlarobbyk

Version History

  • 0.1
    • Initial Release

License

This project is licensed under The GNU General Public License v3.0 License - see the LICENSE.md file for details

Acknowledgments

Inspiration:

About

This simple app shows how to include OpenCV 4.5 native code to perform image digital processing in C++. The app presents a simple binarization process in HSV color space for this example.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published