Hello,
1. PDAF happens mostly in the sensor. It seems to require good contrast for horizontal steps (vertical lines, but a fixed grating can confuse it). It works best with well-adjusted exposure that shows both the light and dark sides of those edges, and will be degraded at extreme exposure values.
2,3. It abandons PDAF and drops to CDAF if the "confidence" values from the sensor are below a threshold for a certain number of frames. The timeout is defined by a parameter ("rpi.af"."speed"."normal"."dropout_frames") in the camera tuning file, and defaults to 6. If you edit the tuning file and set it to a large number (say, 99999999) it should patiently wait for PDAF data (in Continuous mode, at least). There is currently no way to tell which it's using.
4. Always the raw image -- PDAF analysis happens in silicon attached to the sensor, before the image even reaches us.
5. The default AF window is the central 1/2 width of the central 1/3 height (i.e. 1/6 of the total area). In fact the sensor always returns {phase, confidence} pairs for a 16x12 grid covering the whole image before cropping. We use windows only for weighting. A smaller window doesn't make it any faster, and a very small window makes AF less reliable.
If you want to look around the code, the raw PDAF data is parsed here, and the algorithm is here. That code is the first thing that worked reasonably well, and no doubt has scope for improvement.
1. PDAF happens mostly in the sensor. It seems to require good contrast for horizontal steps (vertical lines, but a fixed grating can confuse it). It works best with well-adjusted exposure that shows both the light and dark sides of those edges, and will be degraded at extreme exposure values.
2,3. It abandons PDAF and drops to CDAF if the "confidence" values from the sensor are below a threshold for a certain number of frames. The timeout is defined by a parameter ("rpi.af"."speed"."normal"."dropout_frames") in the camera tuning file, and defaults to 6. If you edit the tuning file and set it to a large number (say, 99999999) it should patiently wait for PDAF data (in Continuous mode, at least). There is currently no way to tell which it's using.
4. Always the raw image -- PDAF analysis happens in silicon attached to the sensor, before the image even reaches us.
5. The default AF window is the central 1/2 width of the central 1/3 height (i.e. 1/6 of the total area). In fact the sensor always returns {phase, confidence} pairs for a 16x12 grid covering the whole image before cropping. We use windows only for weighting. A smaller window doesn't make it any faster, and a very small window makes AF less reliable.
If you want to look around the code, the raw PDAF data is parsed here, and the algorithm is here. That code is the first thing that worked reasonably well, and no doubt has scope for improvement.
Statistics: Posted by njh — Fri Apr 26, 2024 9:02 am