def remove_light(): gray = function_modules.gray(src) dst = function_modules.removelight(gray, block=32) path4 = path + '_removelight.jpg' cv2.imwrite(path4, dst) img_ = Image.open(path4) global img_choose4 img_choose4 = ImageTk.PhotoImage(img_) enhanced_canvas.create_image(x_start, y_start, anchor='nw', image=img_choose4)
def gray_value(): # global gray gray = function_modules.gray(src) path1 = path + '_gray.jpg' cv2.imwrite(path1, gray) img_ = Image.open(path1) global img_choose1 img_choose1 = ImageTk.PhotoImage(img_) enhanced_canvas.create_image(x_start, y_start, anchor='nw', image=img_choose1)
def gamma_correction(): gray = function_modules.gray(src) gamma = function_modules.gamma(gray) path2 = path + '_gamma.jpg' cv2.imwrite(path2, gamma) img_ = Image.open(path2) global img_choose2 img_choose2 = ImageTk.PhotoImage(img_) enhanced_canvas.create_image(x_start, y_start, anchor='nw', image=img_choose2)
def fixed_threshold(): gray = function_modules.gray(src) bins = morph_module.fixed_threshold(gray) path17 = path + '_fixed_threshold.jpg' cv2.imwrite(path17, bins) img_ = Image.open(path17) global img_choose17 img_choose17 = ImageTk.PhotoImage(img_) enhanced_canvas.create_image(x_start, y_start, anchor='nw', image=img_choose17)
def ostu(): gray = function_modules.gray(src) bins = morph_module.ostu(gray) path18 = path + '_ostu.jpg' cv2.imwrite(path18, bins) img_ = Image.open(path18) global img_choose18 img_choose18 = ImageTk.PhotoImage(img_) enhanced_canvas.create_image(x_start, y_start, anchor='nw', image=img_choose18)
def binary_value(): gray = function_modules.gray(src) bins = morph_module.binary(gray) path15 = path + '_adaptive_threshold.jpg' cv2.imwrite(path15, bins) img_ = Image.open(path15) global img_choose15 img_choose15 = ImageTk.PhotoImage(img_) enhanced_canvas.create_image(x_start, y_start, anchor='nw', image=img_choose15)
def hole_filling(): gray = function_modules.gray(src) final_out = function_modules.hole_filling(gray) path8 = path + '_holefilling.jpg' cv2.imwrite(path8, final_out) img_ = Image.open(path8) global img_choose8 img_choose8 = ImageTk.PhotoImage(img_) enhanced_canvas.create_image(x_start, y_start, anchor='nw', image=img_choose8)
def bit_layer_split(): gray = function_modules.gray(src) reconstruct = function_modules.bit_layer_split(gray) path7 = path + '_bitlayerreconstruct.jpg' cv2.imwrite(path7, reconstruct) img_ = Image.open(path7) global img_choose7 img_choose7 = ImageTk.PhotoImage(img_) enhanced_canvas.create_image(x_start, y_start, anchor='nw', image=img_choose7)
def remove_lines(): gray = function_modules.gray(src) bins = morph_module.binary(gray) n_tab_lines = morph_module.removelines(bins) path9 = path + '_removelines.jpg' cv2.imwrite(path9, n_tab_lines) img_ = Image.open(path9) global img_choose9 img_choose9 = ImageTk.PhotoImage(img_) enhanced_canvas.create_image(x_start, y_start, anchor='nw', image=img_choose9)
def median_blur(): gray = function_modules.gray(src) bins = morph_module.binary(gray) dilation = morph_module.open(bins) medianblur1 = morph_module.medianblur(dilation) path10 = path + '_medianblur.jpg' cv2.imwrite(path10, medianblur1) img_ = Image.open(path10) global img_choose10 img_choose10 = ImageTk.PhotoImage(img_) enhanced_canvas.create_image(x_start, y_start, anchor='nw', image=img_choose10)