OpenCV-android | 【开发中】OpenCV Android 实现人脸识别、图片处理、图片相似度检测、物体识别功能。(基于OpenCV | Computer Vision library

 by   shenhuanet Java Version: Current License: Apache-2.0

kandi X-RAY | OpenCV-android Summary

kandi X-RAY | OpenCV-android Summary

OpenCV-android is a Java library typically used in Artificial Intelligence, Computer Vision, OpenCV applications. OpenCV-android has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub.

【开发中】OpenCV Android 实现人脸识别、图片处理、图片相似度检测、物体识别功能。(基于OpenCV Library v3.2.0)

            kandi-support Support

              OpenCV-android has a low active ecosystem.
              It has 32 star(s) with 9 fork(s). There are 2 watchers for this library.
              It had no major release in the last 6 months.
              There are 0 open issues and 1 have been closed. On average issues are closed in 57 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of OpenCV-android is current.

            kandi-Quality Quality

              OpenCV-android has 0 bugs and 0 code smells.

            kandi-Security Security

              OpenCV-android has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              OpenCV-android code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              OpenCV-android is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              OpenCV-android releases are not available. You will need to build from source code and install.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              It has 37997 lines of code, 3607 functions and 176 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed OpenCV-android and discovered the below as its top functions. This is intended to give you an instant insight into OpenCV-android implemented functionality, and help decide if they suit your requirements.
            • Delivers the camera frame
            • Measure the frame
            • Initialize the ticker
            • Converts an image into Android bitmap
            • Sets the camera preview size
            • Initialize camera preview
            • Calculate the size of the acc preview
            • Sets this matrix to the given values
            • Completes state
            • Opens camera
            • Calculate the values of a camera matrix
            • Called when the view is loaded
            • Rectify 3 matrices
            • Convert a vector to a Matcher
            • Convert a vector vector to a matrix
            • Initializes OpenCV libs
            • Creates a hash code
            • Compares two matrices
            • Decomposes homography matrices
            • Calculates the hash code
            • Set the camera preview size
            • Register a new package
            • Create cascade classifier
            • Opens a camera
            • Initializes the view
            • Convert a vector to a Matrix
            Get all kandi verified functions for this library.

            OpenCV-android Key Features

            No Key Features are available at this moment for OpenCV-android.

            OpenCV-android Examples and Code Snippets

            No Code Snippets are available at this moment for OpenCV-android.

            Community Discussions


            Issue using functions from opencv shared libraries cross compiled for android
            Asked 2022-Feb-17 at 12:30

            I was trying to build and execute a cpp code that links few opencv shared libraries that I had cross compiled for android but while trying to utilize the namespace cv or trying to use a function of opencv, it says undeclared identifier. I did try this documentation here: but was unable to get it working. Also I referred to another stackoverflow question for reference here: OpenCV with Android NDK Undefined References as well. Any guidance on how to link them and import opencv functions properly which I am probably missing out here would be really helpful.

            trial_onnx.cpp file



            Answered 2022-Feb-17 at 12:30

            I've fixed the issue myself, it was a linking issue along with modifying the file accordingly. For others who may encounter the issue: My Android.Mk file after the fix looks like



            Linking C++ OpenCV to an app in Android Studio
            Asked 2022-Jan-04 at 11:08

            I am integrating existing C++ code that uses OpenCV to an Android app, using Android studio. For this purpose, I have installed the package OpenCV-android-sdk and added it as a module to Android studio. I have also created a simple Kotlin app.

            So far I have managed to integrate my C++ code into the project. After adding the paths to the OpenCV includes by means of an include_directories statement, the code compiles successfully.

            My next step would be to link against the precompiled OpenCV library, to resolve the "undefined symbol" errors. I have no idea how to achieve this/where to specify it. I have tried to find resources on the web, but not two resources tell the same and the solutions seem overly complicated. I am lost in the jungle.



            Answered 2022-Jan-04 at 11:08

            I finally managed. Here comes the recipe (validated under Windows).

            Make sure to download the OpenCV Android SDK and copy it somewhere.

            The project must be created as a Native C++ app (Phone and tablet). A cpp folder is automatically created with a native-lib.cpp source file and a CMakeLists.txt.

            Add the following lines to the CMakeLists file, after the project line:



            OpenCV for Android via Visual Studio to Unity
            Asked 2021-Jun-10 at 16:27

            I tried to compile a .so library using Visual Studio 2019 along with OpenCV Android in order to use this library in Unity. There are some answers on how to configure Visual Studio to use OpenCV Android (here or here) but none of these work for me. Below you can see my configurations.

            Visual Studio 2019 (running on Windows 10)

            android-ndk-r21e // also tried with android-ndk-r15c android-ndk-r16b and android-ndk-r17c

            OpenCV Android 4.5.2 // also tried with OpenCV Android 4.0.0, 4.0.1 and 4.1.0

            My settings in Visual Studio 2019 look as follows:

            Configuration Properties

            - General

            • Platform Toolset Clang 5.0 (also tried Clang 3.8 or GCC 4.9)

            • Configuration Type Dynamic Library (.so)

            • Target API Level Nougat 7.0 (android-24) (also tried different versions)

            • Use STL LLVM libc++ static library (c++_static) (also tried "GNU STL static library (gnustl_static)")


            - General

            • Additional Include Directories "Path to OpenCV_4_5_2_Android\sdk\native\jni\include"

            • Code Generation Enable C++ Exceptions "Yes(-fexceptions)"

            • Language C++17(-std=c++1z)

            • Precompiled Headers Not using Precompiled Headers


            - General

            • Additional Library Directories Path to OpenCV_4_5_2_Android\sdk\native\libs\armeabi-v7a

            - Input

            • Additional Dependencies Path to OpenCV_4_5_2_Android\sdk\native\libs\armeabi-v7a\

            My Source.cpp I try to compile is just a single function for testing purposes



            Answered 2021-Jun-10 at 16:27

            I had the exact same issue as you (though I used c++ 11) with the exact same setup, and struggled for days. I believe the errors you're seeing (like me) are from arm_neon.h. Very oddly, I was able to just build (not run) the .so successfully, even with those errors (I say "errors" because if you look at arm_neon.h, others pop up), so try it. Maybe it's some kind of IntelliJ/Intellisense mistake more than anything else where it's catching false negatives from some other toolchain setup.

            At the same time, I'm not 100% sure I was always able to build with that issue, so try these steps as well if you can't:

            1. use OpenCV 4.0.1 with Android NDK 16rb. The NDK matters when it comes to OpenCV builds, and this is the only supposed match that I know of.
            2. follow this tutorial from scratch:
            3. if the downloaded OpenCV android SDK is still giving trouble, build OpenCV from the source using his other tutorial here: and then repeat step 2.

            MAJOR EDIT: OpenCV 4.5.2 needs to be treated differently because it no longer uses toolchains with gnu c++. -When you build OpenCV from CMake, build with Android NDK 21e, and do not use the toolchain in OpenCV 4.5.2. Use the one inside the Android NDK's build folder (android-ndk-r21e\build\cmake). -When you build your .so from Visual Studio 2019, do not use the GNU STL, use the LLVM. GNU c++ is no longer part of Android NDKs, and you need to cut it out of the process entirely. -In the Linker Input, put the names of your library files (or file, if it's just the world one) in the Library Dependencies field, not the Additional Dependencies field. -Everything else is the same as in those common tutorials.



            CMake build error: "More than one file was found with OS independent path 'lib/arm64-v8a/'"
            Asked 2021-Apr-20 at 23:27

            I'm trying to setup OpenCv 3.4.14 on Android Studio (4.0.0) project which has c++ support from the beginning, (Native project). I'm getting this error over and over again. I searched the web and didn't found any useful solution for that problem, please help.

            I followed this video for setting up OpenCv on Android Studio. It works well in the video, but for some reason it doesn't work for me.


            I've tried to setup OpenCv on projects that don't include c++, and it worked without any problem. What makes me think that the problem here is somewhere in the CMakeLists.txt file.

            So i will share here all what i have (after following the video above):

            Project structure:

            build.gradle (:app):



            Answered 2021-Apr-20 at 23:27

            To anyone who struggle configuring OpenCV in a native c++ Android projects, I've found this video useful, it is the best guide for setting up OpenCV on Android. All the work is done only by the CMake file. It worked for me.



            Take path from env var doesn't work properly in CMakeList.txt
            Asked 2020-Nov-01 at 11:50

            I am working with CMakeList.txt file and need to set a path to my lib. Currently I do it this way:



            Answered 2020-Nov-01 at 11:50

            What am I doing wrong?

            You are reading cmake variable and expecting it to expand to the value of the environment variable.

            how to convert env var value from key to actual value.

            Read the environment variable.



            How can we fork opencv-android repo and use it in own project?
            Asked 2020-Sep-26 at 13:07

            I had used openCV for android from this repo its worked and also camera was running. But there is a issue with camera orientation in this repo. So I just forked and published mine using without any changes (just to check if its working).




            Answered 2020-Sep-26 at 13:07

            I have forked from diff OpenCV repo and it worked. but not sure why it didn't work with this.



            Error : java.lang.UnsatisfiedLinkError with Charuco Camera Calibration (DetectorParameters)
            Asked 2020-Jul-23 at 15:07

            Good morning everyone. I am currently working on a project in which I have to detect object coordinates within an image with high precision. I have tried using a normal chessboard for camera calibration but the reprojection error was too high so I decided to use the Charuco calibration pattern. I am working with OpenCv 3.4 and Java (project constraint). Since the Aruco function are not included in OpenCv for Java I created a new package in my project which includes the necessary classes. The Aruco code is the one that you can find in the following link : Aruco Code Github

            The code that I'm executing is the following:



            Answered 2020-Jul-23 at 15:07

            The error indicates that you have opencv package without special module you're using;

            In order to fix that you'd need to either find a prebuilt opencv with module you need (in your exactly case it's lcoated in contrib library, so this probably helps.

            In case you want to build it from sources - you should enable the module you want in cmake properties. For contrib - you'd need to cmake contrib project first & then enable contrib in main opencv makefile. For building opencv & contirb - please follow official documentation.



            how can i track GREEN color in openCV? while red&blue worked
            Asked 2020-Jul-16 at 13:50

            red and blue works fine, what happened to GREEN. i've read the similar question and another one,still doesn't work. see my picture frame,mask,res



            Answered 2020-Jul-16 at 13:50

            In HSV color space, Hue represents the traditional colors which we perceive. Another main difference is that when RGB color space represented as a cube, HSV is a cylinder so the range of Hue is actually 0 to 360 degrees. Hue represents Green values between ~121 to ~180 degrees and when we rescale that to the input range of Opencv functions (0-255) the value of green should be between 85 to 128. If you are looking for a visual representation this page has a nice interactive model for both RGB and HSV color spaces.



            android app asks for OpencvManager installation even after including opencv sdk in project and adding dependency
            Asked 2020-May-07 at 23:14

            I have been trying to do this from past few days. Aim is to access android camera and stream frames on the screen using opencv library.



            Answered 2020-May-07 at 23:14

            I just have followed this with the latest(like you) version of everything. And it's working! Enjoy!

            I am giving my version of instructions thinking about if the link ever gets broken.

            1. Download opencv sdk for android at:
            2. Unzip opencv sdk and place it in the same root of sample project folder

              -> MyProjects


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install OpenCV-android

            You can download it from GitHub.
            You can use OpenCV-android like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the OpenCV-android component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer For Gradle installation, please refer .


            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone shenhuanet/OpenCV-android

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link