camera: image projection

605 views Asked by At

I'd like to project images on a wall using camera. Images, essentially, must scale regarding the distance between camera and the wall.

Firstly, I made distance calculations by using right triangle trigonometry(visionHeight * Math.tan(a)). It's not 100% exact but yet close to real values.

Secondly, knowing the distance we can try to figure out all panorama height by using isosceles triangle trigonometry formula: c = a * tan(A); A = mCamera.getParameters().getVerticalViewAngle(); The results are about 30% greater than the actual object height and it's kinda weird.

double panoramaHeight = (distance * Math.tan( mCamera.getParameters().getVerticalViewAngle() / 2 * 0.0174532925)) * 2;

I've also tried figuring out those angles using the same isosceles triangle's formula, but now knowing the distance and the height. I got 28 and 48 degrees angles.

Does it mean that android camera doesn't render everything it shoots ? And, what other solutions you can suggest ?

enter image description here

1

There are 1 answers

2
Alex Cohn On BEST ANSWER

Web search shows that the values returned by getVerticalViewAngle() cannot be blindly trusted on all devices; also note that you should take into account the zoom level and aspect ratio, see Determine angle of view of smartphone camera