如何让全分辨率和放大器;与Android相机Uncom pressed图像数据吗? [英] How to Get Full Resolution & Uncompressed Image Data with Android Camera?

查看:176
本文介绍了如何让全分辨率和放大器;与Android相机Uncom pressed图像数据吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望得到全分辨率(而不是COM pressed)的图像数据,然后我可以做一些图像处理。

据我所知,Android的API takePicture(快门,原材料,JPG格式)可以做something.But我需要的是不是一个COM pressed JPEG数据,一个uncom pressed图像数据instead.Also我知道原料回调不按一些职位,我读不工作。

我也发现了previewFrame的API和larggest画面尺寸我从这次得到的是1280×720(使用set previewSize),而原来的图像,我从相机caputure是1952年的一项决议* 3264

此外,Intent.putExtra(MediaStore.EXTRA_OUTPUT,URI)可能会帮助,但它可能是URI的文件应该是一个JPEG文件是一个COM pressed格式。

不过,反正是有得到一个全尺寸(同捕获)和uncom pressed(不是JPEG)图像数据吗?


解决方案

有关takePicture()的文档清楚地说,原始数据可以提出要求,但回调是可选的。如今,大多数设备不支持原始回调。这不应该是一个惊喜:现代相机在硬件中执行的JPEG COM pression,相机和应用处理器之间的内存总线无法处理原始数据的24兆字节足够快(对于一个适度的800万像素的摄像头)

避免诱惑,使用preVIEW的回调,而不是takePicture():即使在相同的分辨率,静止图像的图像qualiity会更好。 preVIEW图像可能有IM precise自动对焦,防抖,曝光,甚至白平衡。

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?

解决方案

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.

这篇关于如何让全分辨率和放大器;与Android相机Uncom pressed图像数据吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆