如何设置相机以 .mpo 格式拍摄图像?
在我的应用程序中,我有一个 SurfaceView 显示相机预览,并且想要使用手机上的立体相机拍摄 3D 照片(出于好奇,该应用程序有一个新颖的取景器)。如果您切换到 3D 模式,手机上的相机应用程序会将它们保存为 .mpo 格式。
Camera 的可用 ImageFormat 值不包括 mpo。默认情况下,新实例化的 Camera 似乎设置为返回 jpg 数据。设置参数.setPictureFormat(ImageFormat.UNKNOWN);导致了 IllegalArgumentException。
有谁知道如何让 onPictureTaken() 回调接收 mpo 数据?
In my application, I have a SurfaceView showing a Camera preview, and want to use the stereoscopic camera on my phone to take 3D pictures (for the curious, the app has a novelty viewfinder). The Camera application that came on the phone saves them in .mpo format if you switch to 3D mode.
The available ImageFormat values for Camera don't include mpo. By default, it seems a newly instantiated Camera is set to return jpg data. Setting parameters.setPictureFormat(ImageFormat.UNKNOWN); caused an IllegalArgumentException.
Does anyone know how to get the onPictureTaken() callback to receive mpo data?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明:原生 Android 不提供立体摄像头,至少在撰写本文时发布的 ICS 版本中是这样。您需要的是 OEM sdk,以利用特定于设备的库来获取适当的回调。
HTC Evo 这里有一些东西: http://htcdev.com/devcenter/opensense-sdk
并且Sharp Aquos 手机在这里有东西: https://sh-dev.sharp.co.jp/android/modules/sdk/index.php?/sdk
我希望有一些跨设备的方法可以使用。 :( 为每种 3D 设备实现代码将会很费力,尽管目前还不是很多。
Turns out: stock Android doesn't provide for stereoscopic cameras, at least in the ICS release out at the time of writing. What you need are the OEM sdks to take advantage of device-specific libraries to get the appropriate callbacks.
The HTC Evo has stuff here: http://htcdev.com/devcenter/opensense-sdk
And the Sharp Aquos phone has stuff here: https://sh-dev.sharp.co.jp/android/modules/sdk/index.php?/sdk
I wish there were some cross-device methods to use. :( It's going to be laborious implementing code for each of the 3D devices out there, though there aren't many yet.