ARCore : Get Camera's resolution

给你一囗甜甜゛ 提交于 2019-12-11 16:57:57

问题


Is there any way to get camera's resolution ? (unless using Android from scratch) I did not found any getter, on a setter on session.setDisplayGeometry() that is not really what I expect.

My goal is to know the camera's picture ratio to cropp it on my display since the screen and the camera do not use the same size.

Thanks.


回答1:


There isn't a way to access the camera's resolution through the ARCore API in the developer preview. I asked about the resolution in comments of a separate question and it looks like the camera resolution in the developer preview will always be 1920x1080.




回答2:


There is a way to get the resolution of the camera:

Frame frame = session.update();
Camera camera = frame.getCamera();
int dim[] = camera.getImageIntrinsics().getImageDimensions();
Log.d("ARCORE","Camera Dimensions: "+dim[0]+" x "+dim[1]);

But it only gives me 640x480, and I don't think there's any way to change it right now, though it may use different values on different hardware. (ARCore 1.3)

I know it's an old question, but the answer seems to have changed since then.



来源:https://stackoverflow.com/questions/46667214/arcore-get-cameras-resolution

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!