我有一个程序可以同时打开海龟窗口和 opencv 视频窗口。我想一起调整 2 个窗口,或者将它们水平缝合。我怎样才能做到这一点?
class PrettyWidget(QtGui.QWidget):
def __init__(self):
super(PrettyWidget, self).__init__()
self.initUI()
def initUI(self):
self.setGeometry(500, 100, 500, 500)
self.setWindowTitle('')
btn = QtGui.QPushButton('Please select video', self)
btn.resize(btn.sizeHint())
btn.clicked.connect(self.SingleBrowse)
btn.move(150, 200)
self.show()
def SingleBrowse(self):
video_path = QtGui.QFileDialog.getOpenFileName(self,'Single File',"./")
video = cv2.VideoCapture(video_path)
preprocess = preprocessing(config,"Occupancy Grid Matrix") # this makes turtle window having ogm
while(True):
ret,frame = video.read()
if frame is None:
break
cv2.imshow("",frame)
cv2.waitKey(1)
我希望海龟窗口和 opencv 窗口一起显示在 1 个窗口中,而不是手动调整 2 个窗口以位于屏幕中心。