Autofocus module!

Currently only has fast_autofocus, and there
may be some work to do on timing, but it works :)

Getting timestamps from the camera rather than
time.time() would be ideal, but it would take some thought to tie that up with
the encoder.

I'm using a low-res stream, as it seems impossible to
turn the bitrate control of the MJPEG stream off,
at least within the picamera2 API.
This commit is contained in:
Richard Bowman 2023-08-30 21:34:06 +01:00
parent 081654533f
commit 6e04618051
2 changed files with 167 additions and 4 deletions

View file

@ -4,12 +4,13 @@ from labthings_fastapi.thing_server import ThingServer
from labthings_sangaboard import SangaboardThing
from labthings_picamera2.thing import StreamingPiCamera2
from .things.autofocus import AutofocusThing
logging.basicConfig(level=logging.INFO)
thing_server = ThingServer()
camera = StreamingPiCamera2()
thing_server.add_thing(camera, "/camera")
stage = SangaboardThing()
thing_server.add_thing(stage, "/stage")
thing_server.add_thing(StreamingPiCamera2(), "/camera")
thing_server.add_thing(SangaboardThing(), "/stage")
thing_server.add_thing(AutofocusThing(), "/autofocus")
app = thing_server.app