Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5011

General discussion • Re: Picamera2 and opencv doesnt show a new window in pyenv 3.9

$
0
0

Code:

import cv2from picamera2 import Picamera2piCam=Picamera2()piCam.preview_configuration.main.size=(1280,720)piCam.preview_configuration.main.format="RGB888"piCam.preview_configuration.align()piCam.configure("preview")piCam.start()while True:    frame=piCam.capture_array()    cv2.imshow("piCam",frame)    if cv2.waitKey(1)==ord('q'):        breakcv2.destroyAllWindows()
If you're going to post code on the forum please used [code][/code] tags.

That makes the difference between

if code-tags == "used":
print ("python code is formatted")
else:
print ("python code is scrambled")

And

Code:

if code-tags == "used":  print ("python code is formatted")else:  print ("python code is scrambled")

Statistics: Posted by DougieLawson — Thu May 02, 2024 9:43 pm



Viewing all articles
Browse latest Browse all 5011

Trending Articles