Beispiel #1
0
def start():
    filename = filedialog.askopenfilename()
    img = cv2.imread(filename)
    img = ImageProcessing.gray(img)
    img = ImageProcessing.get_text_crop(img)
    img = numpy.asarray(img)

    img = ImageProcessing.blur(img)
    img = ImageProcessing.adaptive_thresholding(img)
    PIL.Image.fromarray(img).save("images\\3_.jpg")
    img_thr = ImageProcessing.global_thresholding(img)
    PIL.Image.fromarray(img_thr).save('images\\2_.jpg')
    img_thr = PIL.Image.fromarray(img_thr)
    ImageProcessing.print_text(img_thr)