PhaseDetectionAutofocusing
Introduction
Autofocus methods are distinguished as active, passive, or hybrid types.
Active AF systems measure the distance to the subject independently of the optical system and subsequently adjust the optical system for correct focus. There are various ways to measure distance, including ultrasonic sound waves and infrared light.
Passive AF systems determine correct focus by performing passive analysis of the image that is entering the optical system. They generally do not direct any energy, such as ultrasonic sound or infrared light waves, toward the subject. Passive autofocusing can be achieved by phase detection or contrast measurement.
In this post, we are going to talk about Phase Detection Autofocus.
Triangulation
A main goal in autofocus is measuring the distance between the subject and the camera. So that the camera may adjust the internal parameters to focus on the subject according to distance.
An essential method of measuring distance is Triangulation. \[\frac{x}{y}=\frac{a}{b}\\
y=\frac{bx}{a}\]
As the same in a optical system:
A(Aperture),f(focus length) are known parameters of a camera. CoC(Circle
of Confusion) can be measured on the camera sensor.
we can get h by: \[h=\frac{f\cdot CoC}{A}\]
Phase Detection
Like light field camera, PD sensors are some optoelectronic sensors which only receive light from specific directions.
For example, the left photodiode only receive light from left, vice versa.
Let's take a point light source as an example. The following figures show the reception on the sensor.
- Normal pixel
- PD pixel
When the sensors are positioned on the both sides of the focus, the PD signals are opposite.
The space-invariant out-of-focus degradation model should be: \[ g(x,y)=h(x,y)*f(x,y)+\eta(x,y) \] where \(f\) is ideal on-focus image, \(h\) is PSF, \(\eta\) is additive noise, \(*\) is 2D convolution operator.
By matching two Phase image \(g_L\) and $g_R, we can get the difference \(d\) on x-axis, which will finally helps to calculate distance to move the lens and sensor.
Reference
- https://zhuanlan.zhihu.com/p/658852930?utm_id=0
- https://danieltechdiary.com/2022/12/14/high-pixel-focus/
- https://en.wikipedia.org/wiki/Autofocus