from PIL import Image def bw_judge(R, G, B): gray = 0.299 * R + 0.587 * G + 0.114 * B if __________: color = "黑色" else: color = "白色" return color def fill_judge(x, y, fill_width, fill_height): count = 0 for i in range(x, x + fill_width + 1): for j in range(y, y + fill_height + 1): R, G, B = pix[i, j] color = __________ if color == '黑色': __________ if count >= fill_width * fill_height * 0.64: return True else: return False #数据初始化 x_start, y_start = 13, 123 fill_width, fill_height = 32, 13 space_width, space_height = 22, 23 number = "" file=input() img = Image.open(file) pix = img.load() #确定信息点定位间距 total_width = __________ total_height = __________ #确定信息点定位进行遍历 for col in range(0,9): c=0 s1="" for row in range(0,10): x = __________ y = __________ #检测信息点,并返回值 if fill_judge(x, y, fill_width, fill_height)==True: c=c+1 s1 =s1 + str(row) if __________: number += "#" else: number+=s1 print(number)