Android摄像头图像的结果应该被捕获后旋转? [英] Android camera resulted image should be rotated after the capture?

查看:497
本文介绍了Android摄像头图像的结果应该被捕获后旋转?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在写一个使用摄像头的Andr​​oid应用程序。 我设置摄像头的显示方向以90,我的活动是一个纵向:

I'm writing an Android application that uses the camera. I'm setting camera display orientation to 90, my activity is in a portrait orientation:

camera.setDisplayOrientation(90);

我得到一个良好导向preVIEW的画面,但由此产生的图像旋转到-90度(逆时针)以及

I'm getting a well oriented preview picture, but the resulting image is rotated to -90 degrees (counter clockwise) and

exif.getAttribute(ExifInterface.TAG_ORIENTATION)

收益ORIENTATION_NORMAL
它是预期的行为?如果捕获之后我旋转造成影像?

returns ORIENTATION_NORMAL
Is it expected behavior? Should I rotate resulted image after the capture?

设备 - 的Nexus S,API - 10

Device - Nexus S, API - 10

推荐答案

问题是相机的方向是一个完整的灾难(如拍摄图像),因为原始设备制造商不遵守标准。 HTC手机做事情的一种方式,三星手机做不同的方式,Nexus的线似乎坚持不管是哪个供应商,基于CM7 ROM中,我认为按照标准无论哪个硬件,但你的想法。那种你必须决定如何根据手机/ ROM上。见这里的讨论:<一href="http://stackoverflow.com/questions/3852154/android-camera-unexplainable-rotation-on-capture-for-some-devices-not-in-exif">Android对于某些设备上的相机拍摄无法解释的旋转(而不是在EXIF)

Problem is the camera orientation is a complete disaster (as is capturing an image) because OEMs do not adhere to the standard. HTC phones do things one way, Samsung phones do it a different way, the Nexus line seems to adhere no matter which vendor, CM7 based ROMs I think follow the standard no matter which hardware, but you get the idea. You sort of have to determine what to do based on the phone/ROM. See discussion here: Android camera unexplainable rotation on capture for some devices (not in EXIF)

这篇关于Android摄像头图像的结果应该被捕获后旋转?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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