Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7503

Camera board • Re: How to dynamically change focus during a live preview with libcamera?

$
0
0
Hi, the control of the lens is taken over by the camera stack (libcamera) now, which is why you can't control it externally. The rpicam-apps don't provide a way of taking any kind of user input, and responding to it with lens movements (though you could alter them to do so). If you just want to see the lens move, probably the easiest thing is to start a preview window using Python, for example

Code:

from picamera2 import Picamera2picam2 = Picamera2()picam2.start(show_preview=True)
then enter commands like

Code:

picam2.set_controls({'LensPosition': 0})
to move the lens. The unit is dioptres (1 / distance-in-metres).

Statistics: Posted by therealdavidp — Wed Feb 19, 2025 1:00 pm



Viewing all articles
Browse latest Browse all 7503

Trending Articles