Danko Dnevic
Danko Dnevic

Reputation: 1

Android camera2 focus distance step size

I'm developing an Android NDK camera2 app for astrophotography, for which I need the best possible focus. Considering that it is a photo in very low light conditions, with a standard smartphone device, without night mode, I am forced to focus in manual mode. It should also be noted that most devices on the market only have an approximate focus calibration, in diopters, and that the focus distance variable set to 0 rarely represents the actual focus at infinity (on some devices, this value is greater than 0.4). With the developed algorithm for focus estimation (the average of the normalized sums of x"+y" second derivative of the detected sources), I still have to programmatically go through the available values. For devices that support changing the focus distance, the Camera2 API defines only boundary values ​​and variable type (float). Nowhere is there any mention of the step of changing the focus distance. How can I find out the step, on any device, without trying incrementally and iteratively with very small values?

Currently I tried to parse one of target devices and values retrieved from onCaptureCompleted metadata looks like:

f = [ ...
0.007672125 ,...
0.044031527 ,...
0.080379389 ,...
0.116713353 ,...
0.15304561 ,...
0.18935807 ,...
0.225682676 ,...
0.261985868 ,...
0.298240393 ,...
0.334560037 ,...
0.370782346 ,...
0.407000393 ,...
0.443262398 ,...
0.479616284 ,...
0.515729725 ,...
0.551876366 ,...
0.588235259 ,...
0.624219716 ,...
0.660501957 ,...
0.696864128 ,...
0.733137846 ,...
0.769230783 ,...
0.805153012 ,...
0.841042876 ,...
0.877192974 ,...
0.913241982 ,...
0.949667633 ,...
0.98619324 ,...
1.02145052 ,...
1.058201075 ,...
1.094091892 ,...
1.12994349 ,...
1.165501237 ,...
1.201923013]

From these values, one could conclude that initial value is 0.007672125 and increments are about 0.03625, but what about other devices?

Upvotes: 0

Views: 33

Answers (0)

Related Questions