Skip to content

关于第13节的一些bug调正分享 #9

Open
@LINGoodfellow

Description

@LINGoodfellow

首先谢谢作者,分享如此干货
貌似OpenCV 3.X 之后findContours()就返回两个参数了,所以如果出bug,可以尝试改成
contours, hierarchy = cv2.findContours(
thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)

后面得改成for cnt in contours:
cv2.drawContours(img, [cnt], 0, (0, 0, 255), 2)
不然会出现,只识别了‘1’或者'3'单个数字轮廓的情况

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions