Ask Your Question

Revision history [back]

Code snippet from here: http://stackoverflow.com/a/12118760/835231 credits to original author.

Camera.Parameters p = camera.getParameters();
int zoom = p.getZoomRatios().get(p.getZoom()).intValue();
Camera.Size sz = p.getPreviewSize();
double aspect = (double) sz.width / (double) sz.height;
double thetaV = Math.toRadians(p.getVerticalViewAngle());
double thetaH = 2d * Math.atan(aspect * Math.tan(thetaV / 2));
thetaV = 2d * Math.atan(100d * Math.tan(thetaV / 2d) / zoom);
thetaH = 2d * Math.atan(100d * Math.tan(thetaH / 2d) / zoom);

Btw, what formula are you using to compute the focal pixel? Is it something like this:

focal pixel = (imageWidth/2) / tan(horizontalAngleInRadians/2)

Cheers!