openCV4.2.0 module 'cv2' has no attribute 'FONT_HERSHEY_SUPLEX' error 錯誤

這個錯誤浪費我了一下午的時間,因爲代碼是從別的地方參考來的。
原因:它就是沒有這個字體啊
解決方法也很簡單, cv2.FONT_HERSHEY_SUPLEX修改爲cv2.FONT_HERSHEY_SIMPLEX就對了。

Just change cv2.FONT_HERSHEY_SUPLEX to cv2.FONT_HERSHEY_SIMPLEX will fix the issue. You might have this issue simply because you copy the code from somewhere and openCV 4.2.0 just doesn’t have FONT_HERSHEY_SUPLEX.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章