def paintEvent(self, event):
    painter = QPainter()
    painter.begin(self)
    painter.setRenderHint(QPainter.Antialiasing)
    painter.fillRect(event.rect(), Qt.white)
    if (self.ab_map is not None):
        ab_map = cv2.resize(self.ab_map, (self.win_size, self.win_size))
        qImg = QImage(ab_map.tostring(), self.win_size, self.win_size, QImage.Format_RGB888)
        painter.drawImage(0, 0, qImg)
    painter.setPen(QPen(Qt.gray, 3, Qt.DotLine, cap=Qt.RoundCap, join=Qt.RoundJoin))
    painter.drawLine((self.win_size / 2), 0, (self.win_size / 2), self.win_size)
    painter.drawLine(0, (self.win_size / 2), self.win_size, (self.win_size / 2))
    if (self.pos is not None):
        painter.setPen(QPen(Qt.black, 2, Qt.SolidLine, cap=Qt.RoundCap, join=Qt.RoundJoin))
        w = 5
        x = self.pos.x()
        y = self.pos.y()
        painter.drawLine((x - w), y, (x + w), y)
        painter.drawLine(x, (y - w), x, (y + w))
    painter.end()
def paintEvent(self, event):
    painter = QPainter()
    painter.begin(self)
    painter.setRenderHint(QPainter.Antialiasing)
    painter.fillRect(event.rect(), Qt.white)
    if (self.ab_map is not None):
        ab_map = cv2.resize(self.ab_map, (self.win_size, self.win_size))
        qImg = QImage(ab_map.tostring(), self.win_size, self.win_size, QImage.Format_RGB888)
        painter.drawImage(0, 0, qImg)
    painter.setPen(QPen(Qt.gray, 3, Qt.DotLine, cap=Qt.RoundCap, join=Qt.RoundJoin))
    painter.drawLine((self.win_size / 2), 0, (self.win_size / 2), self.win_size)
    painter.drawLine(0, (self.win_size / 2), self.win_size, (self.win_size / 2))
    if (self.pos is not None):
        painter.setPen(QPen(Qt.black, 2, Qt.SolidLine, cap=Qt.RoundCap, join=Qt.RoundJoin))
        w = 5
        x = self.pos.x()
        y = self.pos.y()
        painter.drawLine((x - w), y, (x + w), y)
        painter.drawLine(x, (y - w), x, (y + w))
    painter.end()