Issue while running OpenCV on Jetson Nano in Headless Mode

Hi,

I have installed Jetpack 4.6 on Jetson Nano (4 GB) and after setup I have installed OpenCV and MediaPipe libraries for implementing human body pose detection. Everything worked fine and I was able to run OpenCV and MediaPipe libraries successfully to display different body landmarks on a live video being displayed on the Screen directly interfaced to Jetson Nano.

After that I wanted to run the same program on Jetson Nano in Headless mode. After successfully login, in headless mode, whenever I execute the python script I find following error:

cv2.error: OpenCV(4.10.0) /io/opencv/modules/highgui/src/window.cpp:1301: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function ‘cvShowImage’

I have tried following steps to resolve the issue but in vain:
1. Uninstall the OpenCV library (opencv-python)
2. Install the OpenCV library for headless mode (opencv-headless-python)
3. install libgtk2.0-dev and pkg-config packages

I am new to Jetson Nano and Ubuntu OS, help to resolve this issue will be much appreciated.

Hi,

Since you don’t have a display, OpenCV cannot display an image.
Could you modify the app and disable the cvShowImage function?

Thanks.

1 Like

Thank you for your quick feedback.

Actually I want to display the video stream (having mediapipe landmarks) on my laptop to which Jetson Nano is attached in headless mode. Remember OpenCV is running on Jetson Nano.

Is there any way I can achieve this?
Do I still need to disable the cvShowImage function?

Waiting for your kind feedback.

Hi,

The error is triggered by OpenCV trying to open a Window.
If you want to write the data into video, are you able to use a video encoder instead of showing it on the window?

Thanks.

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