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

Camera board • Re: Issue of OV5647 camera in opencv

$
0
0
I tried to run this camera stucks when it is to pass frame for processing in virtual environment. If i execute same program outside Venv then it runs properly. Even i tried reinstalling again still this issue is there. I also tried to run this code

Code:

from picamera2 import Picamera2import cv2# Initialize the PiCamera2camera = Picamera2()# Configure the camera for previewpreview_config = camera.create_preview_configuration()camera.configure(preview_config)# Start the cameracamera.start()try:    while True:        # Capture the current frame        frame = camera.capture_array()        # Display the frame in an OpenCV window        #cv2.imshow("Camera Preview", frame)        print("done")        break        # Exit the preview if 'q' is pressed        if cv2.waitKey(1) & 0xFF == ord('q'):            breakfinally:    # Stop the camera and close OpenCV windows    camera.stop()    cv2.destroyAllWindows()
It runs outside of venv but inside it stucks at frame=camera.capture_array(). Help me.






Thanks in advance!!

Statistics: Posted by chopdeankur — Fri Jan 03, 2025 7:22 pm



Viewing all articles
Browse latest Browse all 4898

Trending Articles