AttributeError: module 'cv2' has no attribute 'RETR_EXTERANL'
时间: 2023-09-28 17:12:35 浏览: 238
mdk_armcc_user_guide.pdf
AttributeError: module 'cv2' has no attribute 'RETR_EXTERNAL' 是因为在使用cv2模块时,调用了一个不存在的属性。根据引用中提到的,在python3中,cv2.createBackgroundSubtractorMOG()方法已经被改为cv2.createBackgroundSubtractorMOG2()。这意味着在Python3中,使用cv2模块时应该使用cv2.createBackgroundSubtractorMOG2()方法而不是cv2.createBackgroundSubtractorMOG()方法。所以,如果你遇到了AttributeError: module 'cv2' has no attribute 'RETR_EXTERANL'的错误,你可以考虑将cv2.createBackgroundSubtractorMOG()替换为cv2.createBackgroundSubtractorMOG2()来解决问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [Python3 AttributeError: module 'cv2' has no attribute 'createBackgroundSubtractorMOG'](https://blog.csdn.net/zhangpan929/article/details/86158611)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文