0

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.

Vince
  • 70
  • 8

2 Answers2

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.

MrAlbean
  • 540
  • 1
  • 6
  • 18
1

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.

Brianorca
  • 216
  • 2
  • 3
  • Update Sep 2020 on my Samsung S20+ : still gives 640x480... I don't understand to chat correspond the values given by this API... – toto_tata Sep 16 '20 at 07:42
  • If you use `frame.acquireCameraImage()` and get width and depth of that image, it returns 640x480 in Galaxy Note8, too. – mcy Dec 10 '20 at 15:12