openCV 3 extra modules in android

asked 2015-09-17 09:13:18 -0600

lamthao gravatar image

hi,

currently I am using the openCV 3 sdk for android. I am using the native files and with jni files. it is working so far.

now the problem: I want to implement FLANN (http://docs.opencv.org/3.0-beta/doc/t...). But I get an error. It says that it cannot find "opencv2/xfeatures2d.hpp". I found out that xfeatures2d is not included in the sdk (some other extra modules are also not included in the sdk). Those extra modules I found here https://github.com/Itseez/opencv_contrib and downloaded it. Now I can see the module xfeatures2d with all its source files (.cpp) and header files (.hpp). I know that the opencv_contrib is coming from the nonfree part of openCV and has legal issues and can not work with the openCV manager for android. But this is not important right now.

So, can I somehow include xfeatures2d in my project that the FLANN example will work?

If yes, how? Unfortunately I am not familiar with cmake and the cmake process. (Right now I just include the "OpenCV.mk" file from the sdk/native/jni folder within my Android.mk file and it works. Can I modify the OpenCV.mk file to tell him to include the .cpp and .hpp files needed by xfeatures2d?)

Any help would be great! Thank you!

edit retag flag offensive close merge delete

Comments

  • the FlannBasedMatcher is available in android w/o contrib repo
  • SURF/SIFT were moved to the contrib repo in opencv3, but unfortunately, even if you add it to your (local) android install, you won't be able to use any of them (that's a bug, the whole wrap-feature2d-to-java concept needs a major revamp, imho)

  • try to use something like KAZE instead of SURF/SIFT

berak gravatar imageberak ( 2015-09-17 09:24:10 -0600 )edit

thanks for the quick answer and the useful information! i will try kaze then, am I correct to try this http://docs.opencv.org/3.0-beta/doc/t...

lamthao gravatar imagelamthao ( 2015-09-17 09:55:25 -0600 )edit

let me try to clear this up further: BfMatcher with HAMMING should be used for the binary(CV_8U) descriptors, like BRIEF,BRISK,ORB, the FlannBasedMatcher for float descriptors.

again, unfortunately, we do not have so many of those in the free section ...

berak gravatar imageberak ( 2015-09-17 10:04:10 -0600 )edit

I just started with openCV a few days ago and I am not used to the vocabulary so far. But I can explain my task and maybe somebody can tell me what can be done and what cannot be done. So, I have to develope an android app which reads a picture from the galery, takes the picture, do some operations with openCV and show the result. To do that, it should use native OpenCV 3 files. As I mentioned I used the native files from openCV 3 sdk from android.

What works already is painting the picture grey an show that (a very simple operation).

What should work (this is taken from my paper, I do not know if this makes sense) : - Detectors & Descriptors: BRIEF, Dense; FAST, GoodFeaturesToTrack, MSER, ORB, SIFT, STAR, SURF, FREAK and BRISK - Feature Point Algorithms: FLANN, BruteForce

Any ideas?

lamthao gravatar imagelamthao ( 2015-09-17 11:23:01 -0600 )edit

does that make any sense? right now, I tried to detect feature points with AKAZE and match them with FLANN (FlannBaseMatcher). This did not work with the error "Unsupported format or combination of formats". Which algorithms can I combine for FLANN and BruteForce?

lamthao gravatar imagelamthao ( 2015-09-17 11:28:02 -0600 )edit

AKAZE is another binary one, so BFMatcher(and HAMMING).

imho, we need a little table here, what works with which (work for tomorrow...)

berak gravatar imageberak ( 2015-09-17 17:34:09 -0600 )edit

how do i extract features using AKAZE and store in a file in android ?

Pallavi gravatar imagePallavi ( 2015-09-30 02:16:32 -0600 )edit