简体   繁体   English

使用Android相机的最有效方法是什么?

[英]What is the most efficient way to work with the Android camera?

I'm working on an AR app which does heavy image processing using NDK. 我正在开发一个使用NDK进行大量图像处理的AR应用程序。 The result is 10 frames at best. 结果最多为10帧。

I believe that part of the problem is the way I work with the camera in Android. 我认为部分问题是我在Android中使用相机的方式。

I wonder what is the most efficient way to get the frames from the camera on Android 4 and above. 我想知道从Android 4及更高版本的相机中获取帧的最有效方法是什么。

PS - I'm using the old 'setPreviewCallback' technique which I understand is very inefficient with memory (allocates memory for each frame and then GC must clean in). PS-我使用的是旧的'setPreviewCallback'技术,我知道它在内存方面效率很低(为每个帧分配内存,然后GC必须清除)。

Thanks! 谢谢!

Definitely, using setPreviewCallbackWithBuffer() is more efficient. 当然,使用setPreviewCallbackWithBuffer()会更有效。 Your mileage may vary, but the Samsung Note 10 is capable of serving 30 WVGA frames per second (and encoding). 您的里程可能会有所不同,但是Samsung Note 10每秒可以提供30个WVGA帧(和编码)。 You don't need 4.0 for that, this API is available since 2.2. 您不需要4.0,此API自2.2起可用。

PS Have you measured the time your heavy image processing takes? PS您是否测量了沉重的图像处理时间?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Android中显示表格的最有效方法是什么 - What is the most efficient way to display a table in Android 在Android用户界面中旋转和显示图像的最有效方法是什么? - What is the most efficient way to rotate and display an image in an Android UI? 在android中,比较两个文件以确定它们是否相同的最有效方法是什么? - In android, what is the most efficient way to compare two files to determine if they are identical? Android最有效的保存和加载图像的方法是什么? - Android what's the most efficient way to save and load images? 什么是最有效的(电池)重复动作在android中的方法? - what is the most efficient(battery) way to repeat an action in android? 在Android的SharedPreferences中存储数组的最有效方法是什么? - What is the most efficient way to store an array in SharedPreferences in Android? 在Android应用中流视频的最有效方法是什么 - what is the most efficient way to stream videos in android app 在Android中保存游戏状态的最有效方法是什么? - What is the most efficient way to save game status in Android? 在Android中运行Cursor的最有效方法是什么? - What's the most efficient way to run over a Cursor in Android? 在Android中重复写入XML文件的最有效方法是什么? - What is the most efficient way of repeatedly writing to an XML file in Android?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM