Question

I'm grabbing images from an Android camera using onPreviewFrame(). 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.

Is one of these likely to be faster (i.e., matching the hardware format and requiring no extra processing by the OS) on most devices? Is it something entirely dependent on the device manufacturer?

Was it helpful?

Solution

The manufacturer might matter depending on camera type and hardware. The NV21 format is android default. As far as speed, Im doubting you'll notice a difference regardless of format. Personally i would use NV21 YCrCb. Here is a link on different formats - Types of Android Image Formatting

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top