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

Function showImage

SRGAN/mainWindows.py:62–77  ·  view source on GitHub ↗

:param root: 主窗口 :return:

(frame)

Source from the content-addressed store, hash-verified

60 return [canvas0,canvas1]
61
62def showImage(frame):
63 """
64 :param root: 主窗口
65 :return:
66 """
67 # 摄像头翻转
68 # frame=cv2.flip(frame,1)
69 image = cv2.cvtColor(frame, cv2.COLOR_BGR2RGBA)
70 image = image.astype(np.uint8)
71 PILimage = Image.fromarray(image)
72 PILimage = PILimage.resize((img_width, img_height), Image.ANTIALIAS)
73 try:
74 tkImage = ImageTk.PhotoImage(image=PILimage)
75 except:
76 return 0
77 return tkImage
78
79
80#这里需要将tkImage设置为全局变量,不然显示不图片

Callers 3

set_BackGroundFunction · 0.70
selectFilenameFunction · 0.70
loadModelFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected