From experience, implementing a reliable autofocus system in software—especially using edge detection or contrast-based metrics—is non-trivial. These metrics can be noisy or unreliable depending on lighting, texture, or motion, and tuning them to work well across different scenes adds significant complexity.
On top of that, integrating with motorized lenses is its own challenge. Many of these lenses lack standard interfaces, precise control, or even feedback on current focus position, making it hard to build a responsive, repeatable autofocus system.
If you're open to switching lenses, there’s an easier path: there is an adapter that allows you to mount Canon EF and EF-S lenses onto the Raspberry Pi HQ Camera, with native support for electronic focus and aperture control.
With this setup:
If you’re interested, here are more details: https://github.com/pinefeat/cef168
On top of that, integrating with motorized lenses is its own challenge. Many of these lenses lack standard interfaces, precise control, or even feedback on current focus position, making it hard to build a responsive, repeatable autofocus system.
If you're open to switching lenses, there’s an easier path: there is an adapter that allows you to mount Canon EF and EF-S lenses onto the Raspberry Pi HQ Camera, with native support for electronic focus and aperture control.
With this setup:
- Autofocus is handled through standard tools (rpicam-apps, libcamera, or V4L2)
No custom code needed, libcamera and its RPI implementation provides autofocus algorithm
Many Canon EF lenses (especially STM models) have quiet, accurate internal focus motors
If you’re interested, here are more details: https://github.com/pinefeat/cef168
Statistics: Posted by pinefeat — Tue May 27, 2025 9:22 pm