def remove_interference_line(img):
    """
    去除干扰线
    :param img:
    :return:
    """
    pixdata = img.load()
    w,h = img.size
    for y in range(1,h-1):
        for x in range(1,w-1):
            count = 0
            if pixdata[x,y-1] > 245:
                count = count + 1
            if pixdata[x,y+1] > 245:
                count = count + 1
            if pixdata[x-1,y] > 245:
                count = count + 1
            if pixdata[x+1,y] > 245:
                count = count + 1
            if count > 2:
                pixdata[x,y] = 255
    return img
def remove_interference_line ( img ) : pixdata = img . load ( ) w , h = img . size for y in range ( 1 , h - 1 ) : for x in range ( 1 , w - 1 ) : count = 0 if pixdata [ x , y - 1 ] > 245 : count = count + 1 if pixdata [ x , y + 1 ] > 245 : count = count + 1 if pixdata [ x - 1 , y ] > 245 : count = count + 1 if pixdata [ x + 1 , y ] > 245 : count = count + 1 if count > 2 : pixdata [ x , y ] = 255 return img
去除干扰线
    :param img:
    :return: