def minibox1(self,k,l):
top1= Toplevel()
subimg = cv2.imread("mAP.png")
h,w = subimg.shape[0],subimg.shape[1]
canvas1 = tk.Canvas(top1, width = w+5 ,height = h+5, bg = 'white')
Showimage(subimg,canvas1,layout="fill")
canvas1.pack()
如上所示,在设置button后就会自动弹出子窗口
self.button22=Button(root, text='Find Box', height = 2,width = 15, command = self.minibox1(0,0)).place(x=600, y=50)