maciej.malek
maciej.malek

Reputation: 1

Accessing camera on Chromebook

Recently purchased a chromebook. I'm trying to use openCV in IDLE to access my camera however I am unable to get any video.

Cheese on linux cannot access my camera either.

The built in camera app on the chromebook works fine.

I used this code along with others of similar nature and none could access my camera

import cv2

cap = cv2.VideoCapture(0)

if not cap.isOpened():
    print("Error: Could not open video.")
    exit()

while True:
    # Capture frame-by-frame
    ret, frame = cap.read()

    if not ret:
        print("Error: Could not read frame.")
        break

    # Display the resulting frame
    cv2.imshow('Camera Feed', frame)

    # Press 'q' to exit the loop
    if cv2.waitKey(1) == ord('q'):
        break

cap.release()
cv2.destroyAllWindows()

Upvotes: 0

Views: 116

Answers (0)

Related Questions