|
|
@@ -6,14 +6,16 @@ def main():
|
|
|
picam2.configure(picam2.create_preview_configuration(main={"format": "BGR888", "size": (640, 480)}))
|
|
|
picam2.start()
|
|
|
|
|
|
- x, y, w, h = [290, 260, 240, 170]
|
|
|
+
|
|
|
+ x, y, w, h = [290, 140, 240, 170]
|
|
|
|
|
|
print("Type 's' to save a still image. Type 'q' to quit.")
|
|
|
while True:
|
|
|
cmd = input("Command [s/q]: ").strip().lower()
|
|
|
if cmd == 's':
|
|
|
frame = picam2.capture_array()
|
|
|
- frame = frame[y:y+h, x:x+w]
|
|
|
+ # Draw a green rectangle on the image
|
|
|
+ cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 255, 0), 2)
|
|
|
cv2.imwrite("still_image.jpg", frame)
|
|
|
print("Saved still_image.jpg")
|
|
|
elif cmd == 'q':
|