Android摄像头API - 古怪的变焦效果变焦、古怪、摄像头、效果

2023-09-08 10:04:50 作者:狗很狂 ??

我使用的一个项目,我的工作就目前Android相机API和我碰到一个比较奇怪的现象。当我改变preVIEW大小去一个更高的分辨率,我确实得到了更好的质量preVIEW但也有出现这恼人的变焦效果: 说我抱着我的设备5厘米处从对象1024×512,我可以完全看到它。但是,如果我更改为1920×1080,这就像我已经放大到对象,我需要去渐远完全捕捉到它。现在这是一个有点令人失望,因为我希望有一个更高的分辨率,以获得我的目标的更多细节,但如果我必须去远离它,然后传感器是不够理智地得到这些信息。 是不是有什么误会我用相机API可能?

I am using the android camera API for a project I am working on at the moment and I came across a rather strange behavior. When I change the preview size to go to a higher resolution, I indeed get a much better quality preview but there is also this annoying zoom effect that occurs: Say I am holding my device at 5 cm from a object in 1024x512, I can see it entirely. But if I change to 1920x1080, It's like I've zoomed into the object and I need to go further away to capture it entirely. Now that's a bit disappointing as I want a higher resolution to get more details of my object but if I have to go further away from it then the sensor is not sensible enough to get those details. Is there something I misunderstood with the Camera API maybe?

推荐答案

这可能是你的设备上的摄像头在你身边的一个错误,或者一个错误(或功能,如果你喜欢)。要检查,注册preVIEW回调( setOneShot previewCallback()),节省您在同一位置获得针对不同分辨率的缓冲区,并对比图像。

This could be a bug on your side, or a bug (or a feature, if you like) of the camera on your device. To check, register for preview callback (setOneShotPreviewCallback()), save the buffers that you receive in same position for different resolutions, and compare the images.

从我个人的经验,从4打算:3到16:9的分辨率通常会减少视场。但在你的例子,这两个设置保持相同的纵横比。

From my personal experience, going from 4:3 to 16:9 resolution often reduces the field of view. But in your example, both settings keep same aspect ratio.