龙空技术网

解决OpenCV程序报错:The function is not implemented.

笨蛋的程序员 68

前言:

眼前你们对“java调用opencv 报错”都比较关注,咱们都想要了解一些“java调用opencv 报错”的相关文章。那么小编同时在网络上搜集了一些对于“java调用opencv 报错””的相关知识,希望各位老铁们能喜欢,小伙伴们一起来了解一下吧!

在ubuntun中按默认方式编译安装OpenCV后,运行基于OpenCV的程序时抛出了如下的错误

terminate called after throwing an instance of 'cv::Exception'  what():  OpenCV(4.6.0) /home/shy/opencv/modules/highgui/src/window.cpp:1250: 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 'cvNamedWindow'Aborted (core dumped) 

解决问题的步骤如下:

首先执行如下两条指令

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

然后切到OpenCV的build目录。添加WITH_GTK_2_X选项来执行cmake指令。由于我的build目录是在opencv目录之下,所以我的path-to-source是../

cmake -DWITH_GTK_2_X=ON  ../

接着敲如下指令编译

make -j4

输入如下指令安装

sudo make install

标签: #java调用opencv 报错