ฉันพบว่าสิ่งที่ฉันต้องทำคือตั้งค่าหน้าต่างหลักให้เต็มหน้าจอแล้วกลับมาเป็นปกติ ฉันไม่จำเป็นต้องเปิดหน้าต่างแยกต่างหาก ฉันไม่จำเป็นต้องแสดงภาพจำลอง ฉันไม่จำเป็นต้องโทรหา waitKey
#!/usr/bin/env python
import cv2
import numpy
WindowName="Main View"
view_window = cv2.namedWindow(WindowName,cv2.WINDOW_NORMAL)
# These two lines will force your "Main View" window to be on top with focus.
cv2.setWindowProperty(WindowName,cv2.WND_PROP_FULLSCREEN,cv2.WINDOW_FULLSCREEN)
cv2.setWindowProperty(WindowName,cv2.WND_PROP_FULLSCREEN,cv2.WINDOW_NORMAL)
# The rest of this does not matter. This would be the rest of your program.
# This just shows an image so that you can see that this example works.
img = numpy.zeros((400,400,3), numpy.uint8)
for x in range(0,401,100):
for y in range(0,401,100):
cv2.line(img,(x,0),(0,y),(128,128,254),1)
cv2.line(img,(x,399),(0,y),(254,128,128),1)
cv2.line(img,(399,y),(x,399),(128,254,128),1)
cv2.line(img,(399,y),(x,0),(254,254,254),1)
cv2.imshow(WindowName, img)
cv2.waitKey(0)
cv2.destroyWindow(WindowName)
person
Noah Spurrier
schedule
27.03.2019
QImage
หรือQPixmap
) จากนั้น Qt GUI จะให้การควบคุมทั้งหมดแก่คุณ - person msmith81886   schedule 21.03.2018