Green Screen OpenCv Pi camera

Hello everyone,
I have problem when i try to open pi camera v2 with jetson-nano and open cv.

my hardware configuration:
-PI camera V2.1

  • jetson nano
  • Power

my software configuration:
CV2 4.6.0 V
GStreamer Core Library version 1.14.5

import cv2
cap = cv2.VideoCapture('nvarguscamerasrc ! video/x-raw(memory:NVMM), width=3280, height=2464, format=(string)NV12, framerate=(fraction)20/1 ! nvvidconv ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink' , cv2.CAP_GSTREAMER)

while True:
    _,image = cap.read()
    cv2.imshow("live video" ,image)
    if cv2.waitKey(1) & 0xFF ==ord('q'):
        break
cap.release()
cv2.destroyAllWindows|()     

Any advice on this matter?
thanks

Hi,
Please try this gstreamer command and check if you can see camera preview:

gst-launch-1.0 nvarguscamerasrc ! video/x-raw(memory:NVMM), width=3280, height=2464, format=(string)NV12, framerate=(fraction)20/1 ! nvvidconv ! nvegltransform ! nveglglessink sync=0

And we suggest use latest Jetpak 4.6.2 or 4.6.3.

Hello ,
thanks for your prompt response,

i test the camera preview and it’s working fine.

gst-launch-1.0 \
    nvarguscamerasrc sensor-id=0 \
    ! 'video/x-raw(memory:NVMM), width=3280, height=2464, format=(string)NV12, framerate=(fraction)20/1' \
    ! nvoverlaysink

my Jetpack version 32.5.2-20210709090126
But still it’s not working

Thanks

Hi,
Could you try this sample:
OpenCV Video Capture with GStreamer doesn't work on ROS-melodic - #3 by DaneLLL

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.