使用NDK在Android的实时图像处理图像处理、实时、NDK、Android

2023-09-06 06:42:29 作者:嘴上没毛办事不牢@

使用Android(2.3.3)的电话,我可以用相机来检索preVIEW与在previewFrame(byte []的数据,摄像头摄像头)方法得到的YUV图像。

Using an Android (2.3.3) phone, I can use the camera to retrieve a preview with the onPreviewFrame(byte[] data, Camera camera) method to get the YUV image.

对于一些图像处理,我需要这个数据转换为RGB图像,并显示在设备上。使用基本的Java / Android的方法,这将运行在不到5 fps的可怕速度...

For some image processing, I need to convert this data to an RGB image and show it on the device. Using the basic java / android method, this runs at a horrible rate of less then 5 fps...

现在,使用NDK,我要加快速度。现在的问题是:如何将YUV数组转换为RGB阵列在C中?而且是有办法(使用OpenGL吧?)在本地code来显示呢?实时应该是可能的(高通公司AR演示向我们展示了这一点)。

Now, using the NDK, I want to speed things up. The problem is: How do I convert the YUV array to an RGB array in C? And is there a way to display it (using OpenGL perhaps?) in the native code? Real-time should be possible (the Qualcomm AR demos showed us that).

我不能使用 setTargetDisplay ,并把覆盖就可以了!

I cannot use the setTargetDisplay and put an overlay on it!

我知道Java的,最近开始了Android SDK,并有C语言零经验

I know Java, recently started with the Android SDK and have zero experience in C

推荐答案

你有没有考虑使用的OpenCV的Andr​​oid端口?它可以做很多事情不仅仅是色彩转换,这是相当快的。

Have you considered using OpenCV's Android port? It can do a lot more than just color conversion, and it's quite fast.