全局 cap_v4l.cpp:984 打开 VIDEOIO(V4L2): 找不到摄像头设备

问题描述 投票:0回答:1

我正在使用 OpenCV 进行人脸识别,但是在服务器 pythonanywhere 上传时遇到错误

global cap_v4l.cpp:984 open VIDEOIO(V4L2): can't find camera device

def live_face_match():
    cap = cv2.VideoCapture(0)

    while True:
        ret, frame = cap.read()
        cv2.imshow('Camera Feed', frame)

        if cv2.waitKey(1) & 0xFF == ord('q'):
            break

    cap.release()
    cv2.destroyAllWindows()
python opencv flask face-recognition pythonanywhere
1个回答
0
投票

PythonAnywhere 服务器上没有摄像头设备,如果有,它会向您显示服务器所在数据中心的视频。

© www.soinside.com 2019 - 2024. All rights reserved.