2013-07-07 32 views
3

這裏真的很煩人的問題。在Linux Mint操作系統上。幾乎每隔一段時間,我會運行OpenCV的代碼時出現此錯誤:OpenCV不斷「卸載」自己(Linux)

HIGHGUI ERROR: V4L/V4L2: VIDIOC_S_CROP 
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 /home/ravi/Desktop/opencv/OpenCV-2.1.0/src/highgui/window.cpp, line 180 
terminate called after throwing an instance of 'cv::Exception' 
what(): /home/ravi/Desktop/opencv/OpenCV-2.1.0/src/highgui/window.cpp:180: 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 

解決這個問題的辦法,我發現,它做到以下幾點:

cd OpenCV/ 
cd build/ 
cmake .. 
make 
sudo make install 
sudo ldconfig 
<restart computer> 

然後我會回來,再次開始運行我的OpenCV代碼,它會沒事的。但是幾個小時之後,或者可能在開啓/關閉cpu之間,我會回到同樣的愚蠢錯誤!

有沒有人有任何想法這裏發生了什麼,我怎麼可以防止這種情況?這真是令人沮喪。

+2

現在地球上會發生什麼? o.O – 2013-07-07 05:51:06

+0

剛剛再次發生。運行我的OpenCV項目,工作。更改了一些.cpp代碼,在項目目錄中的'make',現在不能再工作了=( – JDS

+1

你的makefile對庫有什麼奇怪的做法嗎?例如'make clean'規則可能會執行'rm/usr/local/lib/ .so'? – maditya

回答

0

我相信問題是通過關注我的USB攝像頭實際位於/ dev /中的問題解決的。給視頻源功能提供錯誤的路徑會導致這種類型的錯誤;重新啓動我的電腦偶爾會轉移/ dev/video#我的設備連接到。

請做ls /dev/vid*以確定您是否使用了正確的視頻源!

1

這聽起來像程序代碼中的一般性嚴重錯誤。發生錯誤時是否有特定的任務?您可能希望使用strace來獲取程序運行時的輸出或爲正在運行該進程的用戶啓用應用程序內存轉儲。這將被傳遞給開發人員進行調試和檢查。