How to Get Full Resolution & Uncompressed Image Data with Android Camera?

落花浮王杯 提交于 2020-01-13 10:55:31

问题


I want to get a full resolution(and not compressed)image data, then i can do some image processing.

As far as i know, the android api takePicture (shutter, raw, jpg) can do something.But what i need is not a compressed JPEG data, a uncompressed image data instead.Also I knew the raw callback doesn't work according to some posts i have read.

I also found the api onPreviewFrame, and the larggest picture size i got from this is 1280*720(use setPreviewSize) while the original image i caputure from the camera is a resolution of 1952*3264.

Also, Intent.putExtra(MediaStore.EXTRA_OUTPUT, uri) may be help, but it likely that the file of the uri should be a jpeg file which is a compressed format.

But is there anyway to get a full size(the same as captured) and uncompressed(not a JPEG) image data?


回答1:


The documentation for takePicture() clearly says that raw data can be requested, but the callback is optional. Today, most of devices do not support raw callback. This should not be a surprise: modern cameras perform Jpeg compression in hardware, and the memory bus between the camera and the application processor cannot handle 24 Megabyte of raw data fast enough (for a modest 8 megapixel camera).

Avoid temptation to use preview callback instead of takePicture(): even at same resolution, image qualiity of a still picture will be better. Preview image may have imprecise autofocus, stabilization, exposure and even white balance.



来源:https://stackoverflow.com/questions/19478101/how-to-get-full-resolution-uncompressed-image-data-with-android-camera

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!