Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created cameraTest.py to check camera feed externally to project #67

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions computer_code/cameraTest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from pseyepy import Camera
import cv2 as cv

# Initialize all connected cameras
c = Camera()

# Continuously capture and display frames
while True:
# Read from the cameras
frames, timestamp = c.read()

# Display each frame in a separate window
for i, frame in enumerate(frames):
window_name = f'Camera {i + 1} Frame'
cv.imshow(window_name, frame)

# Wait for a short period, check for key press
if cv.waitKey(1) & 0xFF == ord('q'):
break

# When finished, close the camera and destroy the windows
c.end()
cv.destroyAllWindows()