Ask Your Question
0

opencv not loading image on termux

asked 2019-08-27 08:45:12 -0600

ogah gravatar image

i successful, installed opecv4 in termux on my samsung tab s5e. wrote this little script to load and save an image: when i run it, i have this output. i install termux -x-packages and re-run cmake but no sucess

python load.py --image 20190629_080028.jpg Traceback (most recent call last): File "load.py", line 9, in <module> cv2.imshow("image", image) cv2.error: OpenCV(4.0.0) /data/data/com.termux/files/home/opencv/modules/highgui/src/window.cpp:625: 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'

edit retag flag offensive close merge delete

Comments

1

AFAIK Termux has no graphical interface (X server); so it can't display images. You can try UserLAnd app to have Linux with X server on Android.

kbarni gravatar imagekbarni ( 2019-08-27 09:12:43 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
1

answered 2019-08-27 15:12:39 -0600

berak gravatar image

updated 2019-08-27 15:13:12 -0600

The function is not implemented.

believe it. your cv2 was built without any gui functionality (dependancy problem, it would need to build gtk or qt for your phone to achieve that)

edit flag offensive delete link more
0

answered 2019-08-27 22:31:19 -0600

supra56 gravatar image

updated 2019-08-27 22:34:33 -0600

For python 3.x :

sudo apt-get install libgtk2.0-dev pkg-config

or

sudo pip3 install libgtk2.0-dev and pkg-config
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-08-27 08:45:12 -0600

Seen: 2,216 times

Last updated: Aug 27 '19