Hi i am having trouble accessing camera it gives me green secreen
my camera is imx219-83 stereo camera and i trayd this solution How to slove opencv green screen? - Jetson & Embedded Systems / Jetson Nano - NVIDIA Developer Forums
it didnt work for me
when i run this code
import cv2
from ultralytics import YOLO
# Load the YOLOv8 model
model = YOLO('yolov8n.pt')
# Open the video file
`
video_path = “0”``
cap = cv2.VideoCapture(‘nvarguscamerasrc ! video/x-raw(memory:NVMM), width=1280, height=720, format=(string)RG10, framerate=(fraction)15/1 ! nvvidconv ! video/x-raw, format=(string)RGRG ! videoconvert ! video/x-raw, format=(string)BGR ! appsink’, cv2.CAP_GSTREAMER)
Loop through the video frames
while cap.isOpened():
Read a frame from the video``
success, frame = cap.read()
if success:
Run YOLOv8 inference on the frame
results = model(frame)
Visualize the results on the frame
annotated_frame = results[0].plot()
Display the annotated frame
cv2.imshow(“YOLOv8 Inference”,annotated_frame)
Break the loop if ‘q’ is pressed
if cv2.waitKey(1) & 0xFF == ord(“q”):``
break
else:
Break the loop if the end of the video is reached
break
Release the video capture object and close the display window
cap.release()``cv2.destroyAllWindows()
nothing happens , and i tried to use usb web cam it worked with me and i did some debugging it seems that opencv can’t read from the camera
can you help me with that thank you very much