如何在 NDK Android 中使用 Java? [英] How to use Java with NDK Android?

查看:22
本文介绍了如何在 NDK Android 中使用 Java?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我假设在这里使用 OpenCV 代码:http://github.com/billmccord/OpenCV-Android#readme是在 Android 上通过 NDK 使用 OpenCV 的最佳方式.

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.

我仍然不知道如何从 C 函数定义中获得到我在 Android 项目中的 OpenCV.java 中声明的那些

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) ) 

任何帮助/指针表示赞赏,甚至从哪里开始解决这个问题.我目前想使用 cvHoughCircles, cvHoughCircles(CvArr* image,void* circle_storage, int 方法, double dp, double min_dist, double param1 = 100, double param2 = 300, int min_radius = 0, int max_radius = 0};

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};

如何使用 ndk for android 在 java 中编写此代码?

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

推荐答案

你的应用需要 C 接口吗?OpenCV 实际上认为它已弃用/完成,新的 API 是 C++.此接口和示例校准应用程序的端口在这里:http://code.google.com/p/android-opencv/

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/

我花了一段时间才获得了新的 C++ 的支持,但我不得不承认,不必一直执行 cvReleaseMat() 并在 IplImage 和 CvMat 之间来回切换,这很好.Opencv 2.1 文档:http://opencv.willowgarage.com/documentation/cpp/index.html

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

这篇关于如何在 NDK Android 中使用 Java?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆