我想用原始图像进行图像处理,而不在屏幕上显示,这显然会降低性能。
根据此话题的答案在没有预览的情况下从相机拍摄照片这在Android 1.5中是不可能的,但有人知道这在Android 4(API 15级)中是否可能吗?
我想用原始图像进行图像处理,而不在屏幕上显示,这显然会降低性能。
根据此话题的答案在没有预览的情况下从相机拍摄照片这在Android 1.5中是不可能的,但有人知道这在Android 4(API 15级)中是否可能吗?
在Android 4中,接收原始图像数据而不在屏幕上显示的最简单方法是使用Camera.setPreviewTexture()调用将预览帧路由到GPU。
您可以通过两种方式使用它:
因为我不允许发表评论。关于Eddy的回答。您需要在NDK中使用它,因为使用Java接口会抵消任何性能优势。从性能的角度来看,必须使用PixelBuffer是绝对疯狂的。从RGBA888到YUV的转换也需要在C中完成。
不要尝试使用TextureView,否则会更糟。在转换为YUV之前,您必须将像素复制到位图中,然后从位图复制到数组中。这本身就占据了全新Nexus 7 2013上近30%的cpu利用率。
最有效的方法是直接与Camera.h对话,绕过所有Android API。您可以创建自己的缓冲区,并在YUV数据传输到其他任何地方之前拦截它。
在屏幕上显示预览不会对性能产生影响。在我遇到的所有设备上,相机输出都“连接”到表面或纹理,不涉及CPU,所有颜色转换和缩放都由专用硬件处理。
“隐藏”预览可能还有其他原因,但请记住,出于隐私和安全原因,API最初的目的是确保最终用户看到从相机到应用程序的任何内容。
I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...
I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...
I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...
I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...
To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?
When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...
I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...
I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...