예제 #1
0
class TimeseriesWindow(QtGui.QWidget):
    def __init__(self, player, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.ui = Ui_Timeseries()
        self.ui.setupUi(self)
        self.img = None

    def show_img(self,npimg):
        self.img = cv2.cvtColor(npimg,cv2.COLOR_BGR2BGRA)
        h, w ,c = self.img.shape
        
        # Qt expects 32bit BGRA data for color images:    
        self.qimg = QtGui.QImage(self.img.data, w, h, QtGui.QImage.Format_RGB32)
        self.qimg.ndarray = self.img
        
        scene = QtGui.QGraphicsScene()    
        scene.addPixmap(QtGui.QPixmap(self.qimg))
        self.ui.graphicsView.setScene(scene)
예제 #2
0
 def __init__(self, player, parent=None):
     QtGui.QWidget.__init__(self, parent)
     self.ui = Ui_Timeseries()
     self.ui.setupUi(self)
     self.img = None