How to use Java with NDK Android?


Question

I am assuming that using the OpenCV code here: http://github.com/billmccord/OpenCV-Android#readme is the best way to use OpenCV on Android, with the NDK.

I am still stuck as to how I get from the C definitions of functions to the ones I declare in OpenCV.java in my Android project

cvFindContours( void*  img,  CvMemStorage*  storage, 
                CvSeq**  firstContour, int  cntHeaderSize, 
                int  mode, 
                int  method, CvPoint offset ) --> findContours(int[] 
data, int w, int h) ) 

Any help/pointers appreciated, even where to start to figure this out. I currently want to use cvHoughCircles, cvHoughCircles(CvArr* image, void* circle_storage, int method, double dp, double min_dist, double param1 = 100, double param2 = 300, int min_radius = 0, int max_radius = 0};

How do I write this in java with ndk for android?

1
6
5/8/2015 10:47:33 PM

Does your app require the C interface? OpenCV actually considers it deprecated / done with, the new API is C++. A port of this interface and sample calibration app are here: http://code.google.com/p/android-opencv/

It took me a while to get sold on the new C++, but I had to admit it was nice to not have to do cvReleaseMat() and go back and forth between IplImage and CvMat all the time. Opencv 2.1 doc: http://opencv.willowgarage.com/documentation/cpp/index.html

6
8/2/2010 12:32:11 AM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon