GithubHelp home page GithubHelp logo

uelordi01 / android-opencv-native-samples Goto Github PK

View Code? Open in Web Editor NEW
3.0 0.0 3.0 158 KB

OpenCV repository samples with cmake and lldb integration for latest android studio versions.

License: Apache License 2.0

CMake 4.11% Java 60.93% C++ 27.95% C 7.01%

android-opencv-native-samples's Introduction

Android-opencv-native-samples

OpenCV repository samples with cmake and lldb integration for latest android studio versions.

prequisites

How to install:

  • clone the repository
git clone https://github.com/uelordi01/Android-opencv-native-samples.git
  • file->open->project in android studio
  • Find local.properties file in the project and add the opencv sdk dir as this snippet (looks like this).
ndk.dir = /home/your_user/android-sdk/ndk-bundle
sdk.dir = /home/user/android-sdk

So add this line in local.properties:

opencv.dir = you_opencv_sdk_dir
  • Click on gradle sync button.

Features:

  • Opencv gradle compliant
  • CMake integration.
  • c++ support integration
  • lldb easy c++ debugging.

Gradle Configuration

  • buildToolsVersion 26.0.0
  • compileSdkVersion 25
  • gradle version 3.3

Prerequisites

  • Cmake support for android studio
  • LLDB support for android studio
  • C++ support for android studio

Samples:

  • FaceDetection: Opencv face detection sample comparing two methods java + c++ and only java.

FAQ:

Why my camera image is upside down or mirrored?

This code is not prepared to take into account the smartphone camera position, I mean, there are some mobile phones that they have the camera on the left or on the right. Depending on that you image could be rotated or flipped.

Why the camera shows me rotated image when I put in portrait mode?

Yeah, the code is not still prepared to this this kind of rotations, so for now we will work in portrait mode.

Why gradle says that there is an error with the app compat library?

This is a gradle compatibility issue, that could be figured out putting the latest sdk in the compiledVersion

compile 'com.android.support:appcompat-v7:25.3.1'

the 25.3.1 number has to coincide with your sdk compile version.

android {
    compileSdkVersion 25
    ......
  }

TIPS:

Would you like to change the camera from the front to back?

Just go to the res/layout folder and find the layout which corresponds to the activity. Later find this layout element:

    <org.opencv.android.JavaCameraView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        app:camera_id="front"
        app:show_fps="true"
        android:id="@+id/fd_activity_surface_view" />

and change the app:camera_id:

    app:camera_id="back"

Would you like to show the fps in the camera layout?

Just go to the res/layout folder and find the layout which corresponds to the activity. Later find this layout element:

    <org.opencv.android.JavaCameraView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        app:camera_id="front"
        app:show_fps="false"
        android:id="@+id/fd_activity_surface_view" />

and change the app:show_fps

    app:show_fps="true"

android-opencv-native-samples's People

Contributors

uelordi01 avatar

Stargazers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.