|
|
|
@ -6,7 +6,7 @@ from tkinter import filedialog
|
|
|
|
|
|
|
|
|
|
import read_image
|
|
|
|
|
|
|
|
|
|
model=3 # 默认使用模型三
|
|
|
|
|
model=3 # 默认使用模型三
|
|
|
|
|
# 此函数用于选择模型一
|
|
|
|
|
def model_1():
|
|
|
|
|
global model
|
|
|
|
@ -94,18 +94,18 @@ result_label = Label(root, textvariable=text, font=('', 25), height=2, fg='red')
|
|
|
|
|
result_label.grid(row=1, column=1) # 识别结果处于的位置
|
|
|
|
|
|
|
|
|
|
try_button = Button(root, text='模型1', width=7, height=2, command=model_1) # 调用模型一函数
|
|
|
|
|
try_button.grid(row=2, column=1,sticky=W) # 该按钮所处的位置
|
|
|
|
|
try_button.grid(row=2, column=1,sticky=W) # 定义模型一按钮所处的位置
|
|
|
|
|
try_button = Button(root, text='模型2', width=7, height=2, command=model_2) # 调用模型二函数
|
|
|
|
|
try_button.grid(row=2, column=1) # 该按钮所处的位置
|
|
|
|
|
try_button.grid(row=2, column=1) # 定义模型二所处的位置
|
|
|
|
|
try_button = Button(root, text='模型3', width=7, height=2, command=model_3) # 调用模型三函数
|
|
|
|
|
try_button.grid(row=2, column=1,sticky=E) # 该按钮所处的位置
|
|
|
|
|
try_button.grid(row=2, column=1,sticky=E) # 定义模型三按钮所处的位置
|
|
|
|
|
|
|
|
|
|
try_button = Button(root, text='开始识别', width=15, height=2, command=screenshot) # 调用识别数字函数
|
|
|
|
|
try_button.grid(row=3, column=1) # 该按钮所处的位置
|
|
|
|
|
try_button.grid(row=3, column=1) # 定义开始识别按钮所处的位置
|
|
|
|
|
clear_button = Button(root, text='清空画布', width=15, height=2, command=reset_canvas) # 调用清空画布函数
|
|
|
|
|
clear_button.grid(row=4, column=1) # 该按钮所处的位置
|
|
|
|
|
clear_button.grid(row=4, column=1) # 定义清空画布按钮所处的位置
|
|
|
|
|
load_image_button = Button(root, text='来自图片', width=15, height=2, command=open_image) # 调用打开本地图片函数
|
|
|
|
|
load_image_button.grid(row=5, column=1) # 该按钮所处的位置
|
|
|
|
|
load_image_button.grid(row=5, column=1) # 定义来自图片按钮所处的位置
|
|
|
|
|
|
|
|
|
|
w.bind("<B1-Motion>", paint) # 鼠标左键进行写数字
|
|
|
|
|
w.bind("<Button-3>", screenshot) # 鼠标右键进行截屏识别
|
|
|
|
|