當前位置: 首頁>>代碼示例>>Python>>正文


Python opengl.GLGridItem方法代碼示例

本文整理匯總了Python中pyqtgraph.opengl.GLGridItem方法的典型用法代碼示例。如果您正苦於以下問題:Python opengl.GLGridItem方法的具體用法?Python opengl.GLGridItem怎麽用?Python opengl.GLGridItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pyqtgraph.opengl的用法示例。


在下文中一共展示了opengl.GLGridItem方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from pyqtgraph import opengl [as 別名]
# 或者: from pyqtgraph.opengl import GLGridItem [as 別名]
def __init__(self):
        """
        Initialize the graphics window and mesh surface
        """

        # setup the view window
        self.app = QtGui.QApplication(sys.argv)
        self.window = gl.GLViewWidget()
        self.window.setWindowTitle('Terrain')
        self.window.setGeometry(0, 110, 1920, 1080)
        self.window.setCameraPosition(distance=30, elevation=12)
        self.window.show()

        gx = gl.GLGridItem()
        gy = gl.GLGridItem()
        gz = gl.GLGridItem()
        gx.rotate(90, 0, 1, 0)
        gy.rotate(90, 1, 0, 0)
        gx.translate(-10, 0, 0)
        gy.translate(0, -10, 0)
        gz.translate(0, 0, -10)
        self.window.addItem(gx)
        self.window.addItem(gy)
        self.window.addItem(gz)

        model = 'mobilenet_thin_432x368'
        camera = 0
        w, h = model_wh(model)
        self.e = TfPoseEstimator(get_graph_path(model), target_size=(w, h))
        self.cam = cv2.VideoCapture("C:\\Users\\velpu\\Desktop\\tf-pose\dance.mp4")
        ret_val, image = self.cam.read()
        self.poseLifting = Prob3dPose('./src/lifting/models/prob_model_params.mat')
        keypoints = self.mesh(image)

        self.points = gl.GLScatterPlotItem(
            pos=keypoints,
            color=pg.glColor((0, 255, 0)),
            size=15
        )
        self.window.addItem(self.points) 
開發者ID:SrikanthVelpuri,項目名稱:tf-pose,代碼行數:42,代碼來源:webcam3d.py

示例2: _create_grid

# 需要導入模塊: from pyqtgraph import opengl [as 別名]
# 或者: from pyqtgraph.opengl import GLGridItem [as 別名]
def _create_grid(self):
        from pyqtgraph.opengl import GLGridItem
        gx = GLGridItem()
        gx.rotate(90, 0, 1, 0)
        gx.translate(-10, 0, 0)
        self.widget.addItem(gx)
        gy = GLGridItem()
        gy.rotate(90, 1, 0, 0)
        gy.translate(0, -10, 0)
        self.widget.addItem(gy)
        gz = GLGridItem()
        gz.translate(0, 0, -10)
        self.widget.addItem(gz) 
開發者ID:frmdstryr,項目名稱:enamlx,代碼行數:15,代碼來源:qt_plot_area.py

示例3: __init__

# 需要導入模塊: from pyqtgraph import opengl [as 別名]
# 或者: from pyqtgraph.opengl import GLGridItem [as 別名]
def __init__(self, input_video):
        self.traces = dict()
        self.app = QtGui.QApplication(sys.argv)
        self.w = gl.GLViewWidget()
        self.w.opts['distance'] = 45.0  ## distance of camera from center
        self.w.opts['fov'] = 60  ## horizontal field of view in degrees
        self.w.opts['elevation'] = 10  ## camera's angle of elevation in degrees 仰俯角
        self.w.opts['azimuth'] = 90  ## camera's azimuthal angle in degrees 方位角
        self.w.setWindowTitle('pyqtgraph example: GLLinePlotItem')
        self.w.setGeometry(450, 700, 980, 700)  # 原點在左上角
        self.w.show()

        # create the background grids
        gx = gl.GLGridItem()
        gx.rotate(90, 0, 1, 0)
        gx.translate(-10, 0, 0)
        self.w.addItem(gx)
        gy = gl.GLGridItem()
        gy.rotate(90, 1, 0, 0)
        gy.translate(0, -10, 0)
        self.w.addItem(gy)
        gz = gl.GLGridItem()
        gz.translate(0, 0, -10)
        self.w.addItem(gz)

        # special setting
        self.cap = cv2.VideoCapture(input_video)
        self.video_name = input_video.split('/')[-1].split('.')[0]
        self.kpt2Ds = []
        pos = pos_init

        for j, j_parent in enumerate(common.skeleton_parents):
            if j_parent == -1:
                continue

            x = np.array([pos[j, 0], pos[j_parent, 0]]) * 10
            y = np.array([pos[j, 1], pos[j_parent, 1]]) * 10
            z = np.array([pos[j, 2], pos[j_parent, 2]]) * 10 - 10
            pos_total = np.vstack([x, y, z]).transpose()
            self.traces[j] = gl.GLLinePlotItem(pos=pos_total, color=pg.glColor((j, 10)), width=6, antialias=True)
            self.w.addItem(self.traces[j]) 
開發者ID:zh-plus,項目名稱:video-to-pose3D,代碼行數:43,代碼來源:amination.py

示例4: __init__

# 需要導入模塊: from pyqtgraph import opengl [as 別名]
# 或者: from pyqtgraph.opengl import GLGridItem [as 別名]
def __init__(self, skeletons_3d):
        self.traces = dict()
        self.app = QtGui.QApplication(sys.argv)
        self.w = gl.GLViewWidget()
        self.w.opts['distance'] = 45.0  ## distance of camera from center
        self.w.opts['fov'] = 60  ## horizontal field of view in degrees
        self.w.opts['elevation'] = 10  ## camera's angle of elevation in degrees 仰俯角
        self.w.opts['azimuth'] = 90  ## camera's azimuthal angle in degrees 方位角
        self.w.setWindowTitle('pyqtgraph example: GLLinePlotItem')
        self.w.setGeometry(450, 700, 980, 700)  # 原點在左上角
        self.w.show()

        # create the background grids
        gx = gl.GLGridItem()
        gx.rotate(90, 0, 1, 0)
        gx.translate(-10, 0, 0)
        self.w.addItem(gx)
        gy = gl.GLGridItem()
        gy.rotate(90, 1, 0, 0)
        gy.translate(0, -10, 0)
        self.w.addItem(gy)
        gz = gl.GLGridItem()
        gz.translate(0, 0, -10)
        self.w.addItem(gz)

        # special setting
        pos = pos_init
        self.skeleton_parents = common.skeleton_parents
        self.skeletons_3d = skeletons_3d

        for j, j_parent in enumerate(self.skeleton_parents):
            if j_parent == -1:
                continue
            x = np.array([pos[j, 0], pos[j_parent, 0]]) * 10
            y = np.array([pos[j, 1], pos[j_parent, 1]]) * 10
            z = np.array([pos[j, 2], pos[j_parent, 2]]) * 10 - 10
            pos_total = np.vstack([x, y, z]).transpose()
            self.traces[j] = gl.GLLinePlotItem(pos=pos_total, color=pg.glColor((j, 10)), width=6, antialias=True)
            self.w.addItem(self.traces[j]) 
開發者ID:zh-plus,項目名稱:video-to-pose3D,代碼行數:41,代碼來源:videoThenAmination.py


注:本文中的pyqtgraph.opengl.GLGridItem方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。