Skip to content

Commit

Permalink
Changed video capture to work with MIPI cameras
Browse files Browse the repository at this point in the history
  • Loading branch information
fernando79513 committed Oct 18, 2023
1 parent 19b8f1c commit f4c459c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion providers/base/bin/camera_quality_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@

def get_image_from_device(device: str):
# Set the video device
cam = cv2.VideoCapture("/dev/%s" % device)
index = int(device.replace("video", ""))
cam = cv2.VideoCapture(index)

if not cam.isOpened():
print("Cannot open the selected device", file=sys.stderr)
return None
Expand All @@ -46,6 +48,7 @@ def get_image_from_device(device: str):

# Get the image
result, image = cam.read()
cam.release()
if not result:
print("Cannot read from the selected device", file=sys.stderr)
return None
Expand Down

0 comments on commit f4c459c

Please sign in to comment.