deal_code.py 文件源码

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

项目:LoginSimulation 作者: Byshx 项目源码 文件源码
def _remove_line_(self, img):
        # ??????
        newimg = np.zeros(img.shape, np.uint8)
        newimg = cv2.resize(newimg, (img.shape[1], img.shape[0] - top - bottom), interpolation=cv2.INTER_CUBIC)
        for i in range(7, 20):
            for j in range(img.shape[1]):
                newimg[i - top, j] = img[i, j]
        # ???????
        line = []
        for i in range(newimg.shape[0]):
            hasline = False
            if newimg[i, 0] < 100:
                line.append(i)
                hasline = True
            for j in range(newimg.shape[1]):
                if hasline:
                    newimg[i, j] = 0
                else:
                    if newimg[i, j] < 100:
                        newimg[i, j] = 255
                    else:
                        newimg[i, j] = 0
        # top 7 left 7-10 bottom 10
        return newimg
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号