我正在尝试使用 Chaquopy 将计算机视觉应用程序移植到 android。当我尝试运行我的脚本时,以下行出现以下错误:
cv2.waitKey(100)
打印到嵌入式 python 控制台的错误是:
java.chaquopy.CQPEnv.check_exception
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:698: 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 'cvWaitKey'
我在构建 gradle 中安装了 openCV,如下所示:
pip {
install "opencv-python"
}
根据此处找到的 Chaquopy 文档: Chaquopy openCV 讨论