Skip to content

Commit 2a2b77e

Browse files
committed
Cam rotation and focus
1 parent 2e85b52 commit 2a2b77e

File tree

2 files changed

+5
-22
lines changed

2 files changed

+5
-22
lines changed

.github/ci/runner_camera.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

examples/pytest_helpers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,19 @@
66
def bsp_capture_image(image_path):
77
# Return video from the first webcam on your computer.
88
cap = cv2.VideoCapture(0)
9+
cap.set(cv2.CAP_PROP_AUTOFOCUS, 1)
10+
cap.set(cv2.CAP_PROP_EXPOSURE, 7.0)
911
# reads frames from a camera
1012
# ret checks return at each frame
1113
ret, frame = cap.read()
1214
if ret:
15+
# Image rotation
16+
frame_rotated = cv2.rotate(frame, cv2.ROTATE_180)
1317
# TODO: Change size image
1418
# TODO: Crop image
1519

1620
# Save image
17-
cv2.imwrite(image_path, frame)
21+
cv2.imwrite(image_path, frame_rotated)
1822
print(f"Image saved {image_path}")
1923
else:
2024
print("Cannot save image.")

0 commit comments

Comments
 (0)