logo
Loading...

請問執行webcam_mask.py時出現以下錯誤? - Cupoy

root@raspberrypi:/home/pi# python3 webcam_mask.pyT...

請問執行webcam_mask.py時出現以下錯誤?

2021/05/11 下午 03:06
支援口罩辨識的智慧門禁系統
OwenChiu
觀看數:37
回答數:4
收藏數:0

root@raspberrypi:/home/pi# python3 webcam_mask.py Traceback (most recent call last): File "webcam_mask.py", line 99, in webcam_detect() File "webcam_mask.py", line 93, in webcam_detect key = cv2.waitKey(1) cv2.error: OpenCV(4.5.1) /tmp/pip-install-q57gsu8u/opencv-contrib-python/opencv/modules/highgui/src/window.cpp:717: 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 'cvWaitKey'

回答列表

  • 2021/05/12 下午 05:59
    CUPOY
    贊同數:0
    不贊同數:0
    留言數:0

    同學 您好, 感謝您的提問,已經聯絡當日教材專家,並會盡快回覆您的問題。

  • 2021/05/13 下午 02:57
    張維元 (WeiYuan)
    贊同數:0
    不贊同數:0
    留言數:1

    嗨,你好
    這個應該是套件版本的問題,建議你先把套件刪掉再重裝對應的版本。

    嗨,你好,我是維元,持續在不同的平台發表對 #資料科學、 #網頁開發 或 #軟體職涯 相關的文章。如果對於內文有疑問都歡迎與我們進一步的交流,都可以追蹤 我的粉絲專頁 ヽ(●´∀`●)ノ

  • 2021/05/17 上午 05:47
    李盛安
    贊同數:0
    不贊同數:0
    留言數:4

    我有在 Linux raspberrypi 5.10.17-v7l+ #1403 的版本先自己安裝過一次OpenCV 4.5.2 (完全自己make有成功), 後來在跑python3 webcam_mask.py的時候, 有碰到一樣的錯誤訊息, 目前後來成功的解法是 就按照錯誤訊息本身, 去執行 apt install libgtk2.0-dev pkg-config, 安裝這兩個套件以後, 重新 make一次OpenCV 4.5.1之後(make需要一段時間), 編譯好OpenCV之後, 重新跑一次 python3 webcam_mask.py, 錯誤訊息就沒有再出現了. webcam_mask.py裡面有一行 cv2.imshow("Image", img), 如果是被註解掉的, 可以把那行註解拿掉試試看, 不過如果螢幕顯示影響了很大的效能, 就還是不要打開. 目前實做的環境用的是raspberry pi ![image](http://kwassistfile.cupoy.com/00000179771F7D94000000106375706F795F72656C65617365414E53/1620362554692/large) 這個版本是 32 位元的作業系統

  • 2021/05/19 上午 08:26
    OwenChiu
    贊同數:0
    不贊同數:0
    留言數:3

    目前執行 python3 webcam_mask.py,出現另一個錯誤,請問這個是什麼問題: AttributeError: 'NoneType' object has no attribute 'shape'