Opencv not working on TX2

asked 2019-02-26 02:28:37 -0600

Hey guys,

I'm trying to do some video processing on TX2 and when I try to display the output, I get the following:

File "img_test.py", line 142, in <module>
    cv2.imshow('frame',frame) cv2.error: OpenCV(4.0.1-dev) /home/nvidia/opencv/modules/highgui/src/window.cpp:627: 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 tried to see which Opencv version TX2 was using and it's using 4.0.1-dev. Upon searching for libopencv, I get the following:

/home/nvidia/OpenCV/libopencv-dev_3.3.1_t186_arm64.deb
/home/nvidia/OpenCV/libopencv-python_3.3.1_t186_arm64.deb
/home/nvidia/OpenCV/libopencv-samples_3.3.1_t186_arm64.deb
/home/nvidia/OpenCV/libopencv_3.3.1_t186_arm64.deb
/usr/lib/aarch64-linux-gnu/libopencv_core.so.2.4
/usr/lib/aarch64-linux-gnu/libopencv_core.so.2.4.9
/usr/lib/aarch64-linux-gnu/libopencv_imgproc.so.2.4
/usr/lib/aarch64-linux-gnu/libopencv_imgproc.so.2.4.9
/usr/lib/libopencv_calib3d.so
/usr/lib/libopencv_calib3d.so.3.3
/usr/lib/libopencv_calib3d.so.3.3.1
/usr/lib/libopencv_core.so
/usr/lib/libopencv_core.so.3.3
/usr/lib/libopencv_core.so.3.3.1
/usr/lib/libopencv_dnn.so
/usr/lib/libopencv_dnn.so.3.3
/usr/lib/libopencv_dnn.so.3.3.1
/usr/lib/libopencv_features2d.so
/usr/lib/libopencv_features2d.so.3.3
/usr/lib/libopencv_features2d.so.3.3.1
/usr/lib/libopencv_flann.so
/usr/lib/libopencv_flann.so.3.3
/usr/lib/libopencv_flann.so.3.3.1
/usr/lib/libopencv_highgui.so
/usr/lib/libopencv_highgui.so.3.3
/usr/lib/libopencv_highgui.so.3.3.1
/usr/lib/libopencv_imgcodecs.so
/usr/lib/libopencv_imgcodecs.so.3.3
/usr/lib/libopencv_imgcodecs.so.3.3.1
/usr/lib/libopencv_imgproc.so
/usr/lib/libopencv_imgproc.so.3.3
/usr/lib/libopencv_imgproc.so.3.3.1
/usr/lib/libopencv_ml.so
/usr/lib/libopencv_ml.so.3.3
/usr/lib/libopencv_ml.so.3.3.1
/usr/lib/libopencv_objdetect.so
/usr/lib/libopencv_objdetect.so.3.3
/usr/lib/libopencv_objdetect.so.3.3.1
/usr/lib/libopencv_photo.so
/usr/lib/libopencv_photo.so.3.3
/usr/lib/libopencv_photo.so.3.3.1
/usr/lib/libopencv_shape.so
/usr/lib/libopencv_shape.so.3.3
/usr/lib/libopencv_shape.so.3.3.1
/usr/lib/libopencv_stitching.so
/usr/lib/libopencv_stitching.so.3.3
/usr/lib/libopencv_stitching.so.3.3.1
/usr/lib/libopencv_superres.so
/usr/lib/libopencv_superres.so.3.3
/usr/lib/libopencv_superres.so.3.3.1
/usr/lib/libopencv_video.so
/usr/lib/libopencv_video.so.3.3
/usr/lib/libopencv_video.so.3.3.1
/usr/lib/libopencv_videoio.so
/usr/lib/libopencv_videoio.so.3.3
/usr/lib/libopencv_videoio.so.3.3.1
/usr/lib/libopencv_videostab.so
/usr/lib/libopencv_videostab.so.3.3
/usr/lib/libopencv_videostab.so.3.3.1
/usr/local/lib/libopencv_calib3d.so
/usr/local/lib/libopencv_calib3d.so.4.0
/usr/local/lib/libopencv_calib3d.so.4.0.1
/usr/local/lib/libopencv_core.so
/usr/local/lib/libopencv_core.so.4.0
/usr/local/lib/libopencv_core.so ...
(more)
edit retag flag offensive close merge delete

Comments

1

/home/nvidia/opencv/modules/highgui/src/window.cpp:627: error: (-2:Unspecified error) The function is not implemented.

that's unrelated to your tx2. the cv2 version you installed (from PIP ?) does not have any gui facilities builtin.

4.0.1-dev

well your libraries show a previous 3.3.1 install. however, libopencv-dev_xxx is not part of the usual opencv install (somedebian artefact ? you probably have to look at that to get rid of it) and cv2 should be built with ENABLE_SHARED_LIBS=OFF, and not use any opencv_xxx.so's at runtime.

berak gravatar imageberak ( 2019-02-27 02:55:23 -0600 )edit
1

all in all -- you f**cked up your install, there are probably 3 different versions of opencv on your box, each getting in the way of another.

berak gravatar imageberak ( 2019-02-27 03:01:35 -0600 )edit