camera的问题mount angle,帮忙翻译一下

月光宝盒 2011-10-20 11:00:27
2.2上的camera移到2.3上,在camere的驱动中要设置两个值
朝向和mount angle,朝向就是前camera还是后camera,问题是这个mount angle
搞不清要如何设置,到底设置多少度,前camera预览是正常的,一拍照就镜像了,所以怀疑这个angle没设置对。
结果在上层找到了说明,却没有搞明白是什么意思,
说明如下

Framework/base/core/java/android/hardware/camera.java

**
* The orientation of the camera image. The value is the angle that the
* camera image needs to be rotated clockwise so it shows correctly on
* the display in its natural orientation. It should be 0, 90, 180, or 270.
*
* For example, suppose a device has a naturally tall screen. The
* back-facing camera sensor is mounted in landscape. You are looking at
* the screen. If the top side of the camera sensor is aligned with the
* right edge of the screen in natural orientation, the value should be
* 90. If the top side of a front-facing camera sensor is aligned with
* the right of the screen, the value should be 270.
*
大家帮忙解释一下,这个mount angle干嘛用的,如何设置?
尤其是红色部分,sensor的顶端和屏的右端对齐,什么意思?
前摄像头的顶端和和屏右端对齐又是什么意思?
natural orientation指什么,我们正常使用时手机的状态?
英语很烂,让大家见笑了


...全文
443 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
念茜 2011-10-25
  • 打赏
  • 举报
回复
mount angle就是倾斜的角度呀,不知道你哪里不明白呢
月光宝盒 2011-10-25
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 yiyaaixuexi 的回复:]

mount angle就是倾斜的角度呀,不知道你哪里不明白呢
[/Quote]
我是想知道这个值如何设置?
因为在上层看到会用这个值,前后camera处理不一样:
preview时:

public static void setCameraDisplayOrientation(Activity activity,
int cameraId, Camera camera) {
// See android.hardware.Camera.setCameraDisplayOrientation for
// documentation.
Camera.CameraInfo info = new Camera.CameraInfo();
Camera.getCameraInfo(cameraId, info);
int degrees = getDisplayRotation(activity);
int result;

if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
Log.e(TAG, "=yue===>setCameraDisplayOrientation FACING FRONT ");
result = (info.orientation + degrees) % 360;
result = (360 - result) % 360; // compensate the mirror
} else { // back-facing
Log.e(TAG, "====>setCameraDisplayOrientation FACING BACK ");
result = (info.orientation - degrees + 360) % 360;
}
// result=270;
Log.e(TAG, "====>setCameraDisplayOrientation: result= "+ result);

camera.setDisplayOrientation(result);
}


capture时:

private void capture() {
mCaptureOnlyData = null;

// See android.hardware.Camera.Parameters.setRotation for
// documentation.
int rotation = 0;

Log.e(TAG, "====>capture mOrientation ="+mOrientation);

if (mOrientation != OrientationEventListener.ORIENTATION_UNKNOWN) {
CameraInfo info = CameraHolder.instance().getCameraInfo()[mCameraId];
Log.e(TAG, "====>capture info.orientation ="+(info.orientation));

if (info.facing == CameraInfo.CAMERA_FACING_FRONT) {
rotation = (info.orientation - mOrientation + 360) % 360;

} else { // back-facing camera
rotation = (info.orientation + mOrientation) % 360;
}
}

mParameters.setRotation(rotation);
月光宝盒 2011-10-21
  • 打赏
  • 举报
回复
万能的坛子啊
Lighting & Optics Session 11 Objective Understand some of the details of Lighting and Optics Optics – Image Quality Types of lens Lighting – Usage Techniques Filters More thorough Webinars and Interactive Tutorials are available online www.cognex.com/online_training 11-2 Optics Four Reasons for Optics Locate Features See the part Keep in Focus Ability to see details Remove Perspective Distortion Avoid lens distortion when possible Maximize Contrast Details are more distinct 11-4 Five Parameters of Image Quality Resolution Ability to reproduce object detail Contrast Keeping or enhancing light/dark transition 11-5 Depth of Field Range over which image remains in focus. Critical in gauging applications. Directly related to aperture – the smaller the better. f/# = focal ratio, f-number, f-stop - larger the number, the more light required 11-6 Five Parameters of Image Quality Distortion Optical aberration by lens (center to corner) Perspective Error Size of item based on distance 11-7 Types of Lenses Telephoto Focal length higher than diagonal of sensor. e.g. 25 mm Shallow depth of field; enlarges distant objects. Wide Angle Focal length less than diagonal of sensor; for 1/3" CCD: e.g. 6 mm Wide depth of field, closer focusing distance. Zoom Lens with variable focal lengths. 35-70 mm Macro Lens optimized for high magnification applications Size of image = size of object (1:1) Telecentric No perspective distortion. Cannot be larger than the front aperture of lens 11-8 Lens Advisor http://www.cognex.com/ExploreLearn/UsefulTools 11-9 What do I do …? If you're focused on a part and need larger FOV Go to a smaller focal length lens 25mm -> 16mm If you're focused on a part and need to mount camera closer (WD) Go to a smaller focal length lens 25mm -> 16mm The smaller the focal length number, the closer the WD and larger FOV 12mm 16mm 25mm 11- 10 What do I do …? (cont.) Spacers – Allow larger than normal magnification The higher the amount of spacers, the greater the magnificat

80,351

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧