什么格式是Android相机原始pictureCallback? [英] What format is for Android camera with raw pictureCallback?

查看:1321
本文介绍了什么格式是Android相机原始pictureCallback?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从Android画面使用的数据。我不喜欢JPEG格式,因为最终我将用灰度数据。 YUV格式,我无所谓,因为前半部分是灰阶。

I am trying to use data from Android picture. I do not like JPEG format, since eventually I will use gray scale data. YUV format is fine with me, since the first half part is gray-scale.

从Android开发教程,

from the Android development tutorial,

公众最终无效takePicture(Camera.ShutterCallback快门,
  Camera.PictureCallback生,Camera.PictureCallback后览,
  Camera.PictureCallback JPEG)

public final void takePicture (Camera.ShutterCallback shutter, Camera.PictureCallback raw, Camera.PictureCallback postview, Camera.PictureCallback jpeg)

在API级别5

触发异步图像采集。相机会服务
  启动一系列回调以应用为图像捕获
  进展。在拍摄图像后出现的回调快门。
  这可以用于触发一个声音,让用户知道图像
  已被抓获。当原始图像数据是发生的原始回调
  可用的(注:该数据将是无效的;如果不存在的原始图像
  可用的回调缓冲器或原始图像回调缓冲器不
  大到足以容纳原始图像)。发生在后览回调时
  缩放,完全处理后览图像可用(注意:不是所有的
  硬件支持)。该JPEG回调时出现COM pressed
  图像可用。如果该应用程序不需要特定
  回调,空可以传递的,而不是一个回调方法。

Triggers an asynchronous image capture. The camera service will initiate a series of callbacks to the application as the image capture progresses. The shutter callback occurs after the image is captured. This can be used to trigger a sound to let the user know that image has been captured. The raw callback occurs when the raw image data is available (NOTE: the data will be null if there is no raw image callback buffer available or the raw image callback buffer is not large enough to hold the raw image). The postview callback occurs when a scaled, fully processed postview image is available (NOTE: not all hardware supports this). The jpeg callback occurs when the compressed image is available. If the application does not need a particular callback, a null can be passed instead of a callback method.

它谈论的原始图像数据。不过,我觉得有关的原始图像数据的格式无处信息?
你有想过这事?

It talks about "the raw image data". However, I find nowhere information about the format for the raw image data? Do you have any idea about that?

我想通过照片拍摄的照片的灰度数据,并将数据都位于手机内存,所以它不会花费时间去写/从图像文件读取,或者不同的图像格式之间进行转换。或者,也许我必须牺牲一些得到它?

I want to get the gray-scale data of the picture taken by the photo, and the data are located in the phone memory, so it would not cost time to write/read from image files, or convert between different image formats. Or maybe I have to sacrifice some to get it??

推荐答案

一些搜索之后,我想我找到了答案:
从<一个href=\"http://developer.android.com/reference/android/hardware/Camera.html#takePicture%28android.hardware.Camera.ShutterCallback,%20android.hardware.Camera.PictureCallback,%20android.hardware.Camera.PictureCallback,%20android.hardware.Camera.PictureCallback%29\">Android教程:

After some search, I think I found the answer: From the Android tutorial:

的发生的原始回调:
  数据将是无效的;如果不存在原始图像回调缓冲
  可用或原始图像回调缓冲区不足够大以容纳
  原始图像)。

"The raw callback occurs when the raw image data is available (NOTE: the data will be null if there is no raw image callback buffer available or the raw image callback buffer is not large enough to hold the raw image)."

请参阅此链接(2011/05/10)
<一href=\"http://stackoverflow.com/questions/5946837/android-raw-image-callback-supported-devices\">Android: RAW图像回调支持设备
并非所有设备都支持原始pictureCallback。

See this link (2011/05/10) Android: Raw image callback supported devices Not all devices support raw pictureCallback.

<一个href=\"https://groups.google.com/forum/?fromgroups=#!topic/android-developers/ZRkeoCD2uyc\">https://groups.google.com/forum/?fromgroups=#!topic/android-developers/ZRkeoCD2uyc (2009年)
在谷歌员工戴夫·斯帕克斯说:

https://groups.google.com/forum/?fromgroups=#!topic/android-developers/ZRkeoCD2uyc (2009) The employee Dave Sparks at Google said:

的原意是要返回uncom pressed RGB565框架,但
  这被证明是不实际的。 我倾向于去precate该API
  完全与挂钩本地信号处理的替换它。

"The original intent was to return an uncompressed RGB565 frame, but this proved to be impractical. " "I am inclined to deprecate that API entirely and replace it with hooks for native signal processing. "

很多人都报告类似的问题。看到:
<一href=\"http://$c$c.google.com/p/android/issues/detail?id=10910\">http://$c$c.google.com/p/android/issues/detail?id=10910

Many people report the similar problem. See: http://code.google.com/p/android/issues/detail?id=10910

由于许多图像处理流程基于灰度图像,我期待在由Android的每个画面所产生的内存向前灰度的原始数据。

Since many image processing processes are based on gray scale images, I am looking forward gray scale raw data in the memory produced for each picture by the Android.

这篇关于什么格式是Android相机原始pictureCallback?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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