MCPcopy Create free account
hub / github.com/KeepTryingTo/Pytorch-GAN / showImage

Function showImage

fc-CGANCode/mainWindow.py:44–59  ·  view source on GitHub ↗

:param root: 主窗口 :return:

(frame)

Source from the content-addressed store, hash-verified

42 return canvas
43
44def showImage(frame):
45 """
46 :param root: 主窗口
47 :return:
48 """
49 # 摄像头翻转
50 # frame=cv2.flip(frame,1)
51 image = cv2.cvtColor(frame, cv2.COLOR_BGR2RGBA)
52 image = image.astype(np.uint8)
53 PILimage = Image.fromarray(image)
54 PILimage = PILimage.resize((img_width, img_height), Image.ANTIALIAS)
55 try:
56 tkImage = ImageTk.PhotoImage(image=PILimage)
57 except:
58 return 0
59 return tkImage
60
61
62#这里需要将tkImage设置为全局变量,不然显示不图片

Callers 2

set_BackGroundFunction · 0.70
loadModelFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected