G
G
Gkamkin2021-06-26 12:48:44
Python
Gkamkin, 2021-06-26 12:48:44

The program does not work in raspberry autorun, what should I do?

In general, the problem of launching a program with video output. The beginning of the program is successful, that is, the script itself works, but when you try to output the video, an error occurs. Photos of logs and a test program are attached
60d6f6bc3e718916995297.png
Prog:

import cv2
import numpy as np
import cv2 as cv
print ("Hello World!")
cap = cv2.VideoCapture(0)
cap.set(cv.CAP_PROP_FRAME_WIDTH, 320) 
cap.set(cv.CAP_PROP_FRAME_HEIGHT, 240)
while True:
    flag, img = cap.read()
    cv2.imshow('img', img)
    ch = cv2.waitKey(5)

Interaction with raspberry happens through VNC Viewer

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question