简体   繁体   English

什么是最快的Android相机图像格式?

[英]What is the fastest Android camera image format?

I'm grabbing images from an Android camera using onPreviewFrame() . 我正在使用onPreviewFrame()从Android相机抓取图像。 I only really need the grayscale portion of the image, which I'm passing as a byte array to some native code. 我只真正需要图像的灰度部分,我将其作为字节数组传递给某些本机代码。

On the newer OS versions that I'm supporting, both YV12 and NV21 preview formats are supported, with NV21 as the default. 在我支持的较新的OS版本上,同时支持YV12和NV21预览格式,默认为NV21。

Is one of these likely to be faster (ie, matching the hardware format and requiring no extra processing by the OS) on most devices? 其中的一种可能会在大多数设备上更快(例如,匹配硬件格式并且不需要操作系统进行额外处理)吗? Is it something entirely dependent on the device manufacturer? 是否完全取决于设备制造商?

The manufacturer might matter depending on camera type and hardware. 制造商可能会有所不同,具体取决于相机的类型和硬件。 The NV21 format is android default. NV21格式是android默认格式。 As far as speed, Im doubting you'll notice a difference regardless of format. 至于速度,我怀疑您会注意到与格式无关的差异。 Personally i would use NV21 YCrCb. 我个人将使用NV21 YCrCb。 Here is a link on different formats - Types of Android Image Formatting 这是不同格式的链接-Android图像格式的类型

I believe any processing will be orders of magnitude longer than hardware conversion of frame formats. 我相信任何处理都将比帧格式的硬件转换长几个数量级。 If it isn't, it will be completely device-dependent. 如果不是,它将完全取决于设备。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM