I just wanna begin by saying that I have no real knowledge of cameras, so this might be a stupid question. But how do smartphone cameras know they are in focus? I would assume that if you told a camera to focus on a point in space, that it would need to know how far away that point is from the camera. Is this true? And if so, how do smartphones focus? Do they use depth sensors? If im completely wrong in my assumption then what methods do smartphones use to focus?
-
\$\begingroup\$ Smartphones don't really do anything differently from other types of cameras... \$\endgroup\$– user29608Commented Oct 3, 2017 at 5:48
-
\$\begingroup\$ @fkraiem That's not entirely true. My SLR does something very different to my smartphone. \$\endgroup\$– Philip Kendall ♦Commented Oct 3, 2017 at 6:34
-
2\$\begingroup\$ Related. almost a duplicate: How does autofocus work?; the only other thing you need to know is that almost(?) every smartphone uses contrast detection rather than phase detection. \$\endgroup\$– Philip Kendall ♦Commented Oct 3, 2017 at 6:36
-
2\$\begingroup\$ Possible duplicate of How does autofocus work? \$\endgroup\$– mattdmCommented Oct 3, 2017 at 9:20
1 Answer
The vast majority of smartphones that can change the focus distance use contrast detection autofocus.
With contrast detection AF: The focus is moved and the camera compares the amount of contrast on the selected portions of the imaging sensor at the first position to the amount contrast at the second position. It continues to do this until it finds the point at which it moves past greatest contrast and the contrast begins to be reduced by further travel in the same direction. It then returns the focus position to the point of greatest contrast.
-
2\$\begingroup\$ It's not at all the majority, but Google's Pixel phones have both phase-detect pixels on the sensor and a "time-of-flight" laser which does measure subject distance. \$\endgroup\$– mattdmCommented Oct 3, 2017 at 9:24
-
\$\begingroup\$ What percentage of the phones being used in the world are Google Pixel phones? Not to mention that the opening sentence of the answer is true for such a phone. They can change the focus distance using CDAF, it's just that they can also change it using other methods as well. \$\endgroup\$ Commented Oct 3, 2017 at 19:19
-
\$\begingroup\$ A very, very small percentage. One might say "not at all the majority". :) \$\endgroup\$– mattdmCommented Oct 3, 2017 at 19:54
-
\$\begingroup\$ @mattdm I misread your first comment to be saying that smart phones that use CDAF were "not at all the majority." \$\endgroup\$ Commented Oct 3, 2017 at 20:15