scan - 0160708.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:card-scanner 作者: RFVenter 项目源码 文件源码
def filter_image(image, canny1=5, canny2=5, show=False):
    # compute the ratio of the old height to the new height, and resize it
    image = imutils.resize(image, height=scale_factor, interpolation=cv2.INTER_NEAREST)

    # convert the image to grayscale, blur it, and find edges in the image
    gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
    blurred = cv2.GaussianBlur(gray, (5, 5), 0)
    edged = cv2.Canny(blurred, canny1, canny2)

    # show the image(s)
    if show:
        cv2.imshow("Edged", edged)
        cv2.waitKey(0)
        cv2.destroyAllWindows()

    return edged
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号