proof of concept

This commit is contained in:
2025-08-29 06:45:55 +02:00
commit 7a46dfe9b8
6 changed files with 340 additions and 0 deletions

26
live_view.py Normal file
View File

@@ -0,0 +1,26 @@
import gphoto2 as gp
import cv2
import numpy as np
camera = gp.Camera()
camera.init()
def liveview():
while True:
# Pobierz klatkę z LiveView
file = camera.capture_preview()
data = file.get_data_and_size()
frame = np.frombuffer(data, dtype=np.uint8)
frame = cv2.imdecode(frame, cv2.IMREAD_COLOR)
if frame is not None:
cv2.imshow("LiveView", frame)
if cv2.waitKey(1) == 27: # ESC
break
cv2.destroyAllWindows()
camera.exit()
if __name__ == "__main__":
liveview()