ocrolib_ext.py 文件源码

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

项目:deep_ocr 作者: JinpengLI 项目源码 文件源码
def estimate_skew_angle(image, angles, debug):
    estimates = []
    for a in angles:
        v = np.mean(interpolation.rotate(image, a, order=0, mode='constant'),
                    axis=1)
        v = np.var(v)
        estimates.append((v,a))
    if debug>0:
        plt.clf()
        plt.title("estimate_skew_angle")
        plt.plot([y for x,y in estimates],[x for x,y in estimates])
        raw_input("PRESS ANY KEY TO CONTINUE.")
    _, a = max(estimates)
    return a
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号