OpenCV didn't run everytime i use CTRL+Z

I tried to run arducam IMX477 to my Jetson Orin Nano with OpenCV Python.
My opencv-python already supported gstream and I can run my arducam smoothly.

For the reference, i used CSI-Camera/simple_camera.py at master · JetsonHacksNano/CSI-Camera · GitHub to run my arducam with VSCode.

And my problem is everytime i forcestop my program with CTRL-Z and i tried to run back my code, i get the following :

nvarguscamerasrc sensor-id=0 ! video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)60/1 ! nvvidconv flip-method=0 ! video/x-raw, width=(int)960, height=(int)540, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:762 Failed to create CaptureSession
[ WARN:0] global ../modules/videoio/src/cap_gstreamer.cpp (935) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
Traceback (most recent call last):
  File "/home/bandhayudha/CSI-Camera/simple_camera.py", line 83, in <module>
    show_camera()
  File "/home/bandhayudha/CSI-Camera/simple_camera.py", line 68, in show_camera
    cv2.imshow(window_title, frame)
cv2.error: OpenCV(4.2.0) ../modules/highgui/src/window.cpp:376: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'imshow'

But, than i restarted the nvargus-daemon.service with

$ sudo systemctl restart nvargus-daemon.service

on my terminal and everything went back to normal. If i run it back, the simple_camera.py run normally. But if i tried to to Forcestop it again with CTRL+Z, it wont run correctly and i got the output like the following above before.

It doesn’t happen like that if i tried to keyboard interrupt with CTRL+C, when i run it again, it still can run normally. And if i manually close the OpenCV videocapture windows (CSI-Camera), it still run normally too.

The problem is only happened if i use the CTRL+Z. Can anyone explain what happened or what is wrong?

1 Like

Hi,
Do you use latest Jetpack 5.1.3? If you are using previous version, would suggest upgrade to latest version and try.

I use Jetpack 5.1.1, because last time i used the lastest version the webcam is undetectable. Should i use the lastest version?

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