【Ubuntu-Opencv】Ubuntu14.04 Opencv3.3.0 使用中出现OpenCV Error: Unspecified error
問題描述:
ubuntu@ubuntu:~/opencv-3.3.0/cpp_luckynote/opencv_lena$ ./DisplayImage ../lfw/Anna_Chicherova/Anna_Chicherova_0001.jpg OpenCV Error: 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 cvNamedWindow, file /opt/conda/conda-bld/opencv_1491943414359/work/opencv-3.1.0/modules/highgui/src/window.cpp, line 527 terminate called after throwing an instance of 'cv::Exception'what(): /opt/conda/conda-bld/opencv_1491943414359/work/opencv-3.1.0/modules/highgui/src/window.cpp:527: error: (-2) 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 cvNamedWindow已放棄 (核心已轉儲)
明明已經install libgtk2.0-dev and pkg-config 為什么還會報出上述錯誤,上述錯誤提醒和網上網友給出的解釋,可以認為,在安裝opencv之前必須先安裝libgtk2.0-dev and pkg-config,后安裝他們兩個或者忘記安裝都會報出上述錯誤。
可是筆者已經將opencv完整卸載并且重新cmake編譯安裝過之后,依然會報出上述問題,重新安裝,重啟系統,安裝不同版本等都試過了,還是報錯,怎么破。筆者就在這上面折騰了一整天,終于解決了。。
解決辦法如下:
a. 首先完整卸載opencv,并且刪除與opencv有關的全部文件,完整刪除opencv的方法參見【Ubuntu-Opencv】Ubuntu14.04 Opencv3.3.0 完整卸載方案;
b. 然后要記得把libgtk2.0-dev先卸載,卸載方案如下:
sudo apt-get autoremove gtk+-2.0
sudo apt-get install gnome-core-devel
sudo apt-get install libgtk2.0-dev 或者 sudo apt-get install libgtk2.0* (我是用的前面的安裝)
pkg-config –modversion gtk+-2.0 安裝好可以用這個命令查看gtk+-2.0安裝版本
c. 最后重新cmake安裝opencv,安裝方法參考【Ubuntu-Opencv】Ubuntu14.04 Opencv3.3.0 安裝配置及測試
按照上述abc,我已經完美解決上述問題
總結
以上是生活随笔為你收集整理的【Ubuntu-Opencv】Ubuntu14.04 Opencv3.3.0 使用中出现OpenCV Error: Unspecified error的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Marshall 新款 Middleto
- 下一篇: 岚图汽车进军以色列市场,推出首款车型岚图