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

Function showImage

github/mainWindow.py:39–54  ·  view source on GitHub ↗

:param root: 主窗口 :return:

(frame)

Source from the content-addressed store, hash-verified

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

Callers 2

set_BackGroundFunction · 0.70
loadModelFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected