cv2.imshow() 导致 Chaquopy 出现问题并使 android 应用程序崩溃

cv2.imshow() causes problem with Chaquopy and crashes the android app

我开发了一个使用 android、python 和 opencv 的实时相机应用程序。 由于这条指令 cv2.imshow("Frame", clone),应用程序崩溃了。 logcat 表明:

    com.chaquo.python.PyException: error: OpenCV(3.4.2) /home/smith/git/chaquo/python/server/pypi/packages/opencv-python/build/3.4.2.16/cp36-cp36m-android_15_armeabi_v7a/src/opencv/modules/highgui/src/window.cpp:632: error: (-2:Unspecified error) 
The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon 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'

当我将其替换为 plt.imshow(...,...) 然后 plt.show() 应用程序运行但未显示任何检测,因为 matplotlib.pyplot 不是旨在显示实时检测

有什么解决办法吗?

如前所述, OpenCV doesn't directly support any Android user interface features. The easiest solution is probably to do the reverse of ,并将图像作为字节数组传回Java。