GithubHelp home page GithubHelp logo

joaopedronardari / opencv-androidsamples Goto Github PK

View Code? Open in Web Editor NEW
323.0 323.0 152.0 97.12 MB

OpenCv samples for Android from OpenCV SDK using Android Studio and Gradle System

License: MIT License

Java 98.95% C++ 1.05%
android image-processing opencv samples

opencv-androidsamples's People

Contributors

joaopedronardari avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opencv-androidsamples's Issues

camera orientation problem

hello i have a problem with camera orientation . i saw your application , it looks you have the same problem in your app ;
i was wondering if there is a solution for that ??

Wrong path for the SDK

Hi,

Thank you for sharing the code.
There is one small issue in the code that may have caused errors for some people. It's nice if you mention it in the readme file so people know what to do. The issue is that in your gradle file:

cppFlags += "-I${file("C:/Users/jnardari/Desktop/OpenCV-android-sdk/sdk/native/jni/include")}".toString()

you have referred to the sdk on your own computer. People need to change that in order to make the code work.

build with Android Studio 3.0

I update libs for use with Android Studio 3.0 and I can't build with command line
./gradlew clean build
Do show I made this PR #10 and now I run into this

/Users/hannes/Development/android-ndk-r10b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: fatal error: --sysroot=: must take a non-empty argument
collect2: error: ld returned 1 exit status

build with command line

I can't build with command line ./gradlew clean build
I changed some minor paths and make ./gradew execute able for a Mac on this PR #12

but I see this and have no clue, what's wrong here, probably someone has a clue what's wrong here

:app:compileArm64-v8aDebugArmNdklibrarysampleSharedLibraryNdklibrarysampleMainCpp
/Users/hannes/git/openCV/OpenCV-AndroidSamples/app/src/main/jni/DetectionBasedTracker.cpp:1:17: fatal error: jni.h: No such file or directory
#include <jni.h>
^
compilation terminated.

/Users/hannes/git/openCV/OpenCV-AndroidSamples/app/src/main/jni/Tutorial2.cpp:1:17: fatal error: jni.h: No such file or directory
#include <jni.h>
^
compilation terminated.

:app:compileArm64-v8aDebugArmNdklibrarysampleSharedLibraryNdklibrarysampleMainCpp FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:compileArm64-v8aDebugArmNdklibrarysampleSharedLibraryNdklibrarysampleMainCpp'.

Multiple build operations failed.
C++ compiler failed while compiling Tutorial2.cpp.
C++ compiler failed while compiling DetectionBasedTracker.cpp.
See the complete log at: file:///Users/hannes/git/openCV/OpenCV-AndroidSamples/app/build/tmp/compileArm64-v8aDebugArmNdklibrarysampleSharedLibraryNdklibrarysampleMainCpp/output.txt

I'm not able to integrate OpenCV Sample by Gradle System

I'm not able to integrate OpenCV Gradle with com.android.model.application with my current project with Gradle com.android.application and andoid-apt system.

can not be OpenCV just a library? without modifying the project structure?

Cannot compile libndklibrarysample.so

Why I can't compile the module "ndklibrarysample" into the APK? I extracted the APK and could not find the required libndklibrarysample.so, making that Face Detection and Tutorial 2 failed to work. Is any parameter or setting that I'm missing here?

OK, managed to solve the problem by using these settings:

  1. Use Android Studio 2.1 (I use AS 2.1.1)
  2. Use JDK 7 (I use jdk1.7.0_71)
  3. Use android-ndk-r10e
  4. Use OpenCV 4 Android SDK version 3.0.0

Download zip file of this repository, unzip it somewhere. Then Open AS 2.1, Open Project by locating the directory which contains 'app' folder. Modify the jni include directory in the 'build.gradle (Module: app)' file to our OpenCV SDK folder, then Run this app into Android device/emulator. That's all. Phew! Took me many days to get this..

Where can I find the tutorial?

Hi, it looks like a great samples and exactly what I need. Unfortunately I can't find a link to the corresponding tutorial. Is there some step by step explanation to these files?

Missing Files Library

Hi, i got and error occured. did i missed something else ?

here the error information :

Information:Gradle tasks [clean, :app:generateArmDebugSources, :app:generateArmDebugAndroidTestSources, :app:compileArmDebugSources, :app:compileArmDebugAndroidTestSources, :libraries:opencv:generateDebugSources, :libraries:opencv:generateDebugAndroidTestSources, :libraries:opencv:compileDebugSources, :libraries:opencv:compileDebugAndroidTestSources]
C:\Users\Asus-Akueajim\Desktop\OpenCV-AndroidSamples-master\app\src\main\jni\Tutorial2.cpp
Error:(2, 33) opencv2/core/core.hpp: No such file or directory
C:\Users\Asus-Akueajim\Desktop\OpenCV-AndroidSamples-master\app\src\main\jni\DetectionBasedTracker.cpp
Error:Execution failed for task ':app:compileArmeabiDebugArmNdklibrarysampleSharedLibraryNdklibrarysampleMainCpp'.

Multiple build operations failed.
C++ compiler failed while compiling Tutorial2.cpp.
C++ compiler failed while compiling DetectionBasedTracker.cpp.
See the complete log at: file:///C:/Users/Asus-Akueajim/Desktop/OpenCV-AndroidSamples-master/app/build/tmp/compileArmeabiDebugArmNdklibrarysampleSharedLibraryNdklibrarysampleMainCpp/output.txt
Information:BUILD FAILED
Information:Total time: 25.095 secs
Information:3 errors
Information:0 warnings
Information:See complete output in console

for android studio help

I meet a problem about that for when I set the sample in my android studio and make a apk.
the android studio will meet a error.It tell me the function OpenCVLoader.initAsync() meet a error.
I don`t know why, could you help me?

Android Studio Open Issue

Hello,

I got the issue when I open this project in the Android Studio 2.2.2.

Gradle 'OpenCV-AndroidSamples-master' project refresh failed
Error:Cannot set readonly property: proguardFiles for class: com.android.build.gradle.managed.BuildType

I can't solve this issue.

Please help me.

Thank you.

Issue while building

Pls help me to fix below issue.

/Official/workspace/DermAsist/opencv_sample/app/src/main/jni/DetectionBasedTracker.cpp
Error:(4, 33) opencv2/objdetect.hpp: No such file or directory
compilation terminated.
/Official/workspace/DermAsist/opencv_sample/app/src/main/jni/Tutorial2.cpp: In function 'void Java_com_jnardari_opencv_1androidsamples_activities_Tutorial2Activity_FindFeatures(JNIEnv_, jobject, jlong, jlong)':
/Official/workspace/DermAsist/opencv_sample/app/src/main/jni/Tutorial2.cpp
Error:(19, 67) error: invalid user-defined conversion from 'int' to 'const string& {aka const std::basic_string&}' [-fpermissive]
Ptr detector = FastFeatureDetector::create(50);
^
/Users/apple/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/string
Information:(52) (Unknown) In file included
/Users/apple/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h
Information:(495, 7) candidate is: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const CharT, const _Alloc&) [with _CharT = char; Traits = std::char_traits; Alloc = std::allocator]
Information:(495, 7) no known conversion for argument 1 from 'int' to 'const char
'
/Official/workspace/DermAsist/opencv_sample/app/src/main/jni/Tutorial2.cpp:19:67: error: invalid conversion from 'int' to 'const char
' [-fpermissive]
Information:(495, 7) initializing argument 1 of 'std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]'
Error:Execution failed for task ':app:compileArmeabiDebugArmNdklibrarysampleSharedLibraryNdklibrarysampleMainCpp'.

Multiple build operations failed.
C++ compiler failed while compiling DetectionBasedTracker.cpp.
C++ compiler failed while compiling Tutorial2.cpp.
See the complete log at: file:///Official/workspace/DermAsist/opencv_sample/app/build/tmp/compileArmeabiDebugArmNdklibrarysampleSharedLibraryNdklibrarysampleMainCpp/output.txt
Information:BUILD FAILED
Information:Total time: 1.936 secs
Information:3 errors

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.