• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python utils.draw_points_norm函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyglui.cygl.utils.draw_points_norm函数的典型用法代码示例。如果您正苦于以下问题:Python draw_points_norm函数的具体用法?Python draw_points_norm怎么用?Python draw_points_norm使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了draw_points_norm函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: gl_display_in_window

    def gl_display_in_window(self,world_tex_id):
        """
        here we map a selected surface onto a seperate window.
        """
        if self._window and self.detected:
            active_window = glfwGetCurrentContext()
            glfwMakeContextCurrent(self._window)
            clear_gl_screen()

            # cv uses 3x3 gl uses 4x4 tranformation matricies
            m = cvmat_to_glmat(self.m_from_screen)

            glMatrixMode(GL_PROJECTION)
            glPushMatrix()
            glLoadIdentity()
            glOrtho(0, 1, 0, 1,-1,1) # gl coord convention

            glMatrixMode(GL_MODELVIEW)
            glPushMatrix()
            #apply m  to our quad - this will stretch the quad such that the ref suface will span the window extends
            glLoadMatrixf(m)

            draw_named_texture(world_tex_id)
            glMatrixMode(GL_PROJECTION)
            glPopMatrix()
            glMatrixMode(GL_MODELVIEW)
            glPopMatrix()

            # now lets get recent pupil positions on this surface:
            draw_points_norm(self.gaze_on_srf,color=RGBA(0.,8.,.5,.8), size=80)

            glfwSwapBuffers(self._window)
            glfwMakeContextCurrent(active_window)
        if self.window_should_close:
            self.close_window()
开发者ID:elmadjian,项目名称:pupil,代码行数:35,代码来源:reference_surface.py


示例2: gl_draw_frame

    def gl_draw_frame(self,img_size):
        """
        draw surface and markers
        """
        if self.detected:
            frame = np.array([[[0,0],[1,0],[1,1],[0,1],[0,0]]],dtype=np.float32)
            hat = np.array([[[.3,.7],[.7,.7],[.5,.9],[.3,.7]]],dtype=np.float32)
            hat = cv2.perspectiveTransform(hat,self.m_to_screen)
            frame = cv2.perspectiveTransform(frame,self.m_to_screen)
            alpha = min(1,self.build_up_status/self.required_build_up)
            draw_polyline_norm(frame.reshape((5,2)),1,RGBA(1.0,0.2,0.6,alpha))
            draw_polyline_norm(hat.reshape((4,2)),1,RGBA(1.0,0.2,0.6,alpha))

            #grid = frame.reshape((5,2))
            # self.crop_region = np.array([
            #     [grid[0][0] * img_size[1], grid[0][1] * img_size[0]],
            #     [grid[1][0] * img_size[1], grid[1][1] * img_size[0]],
            #     [grid[2][0] * img_size[1], grid[2][1] * img_size[0]],
            #     [grid[3][0] * img_size[1], grid[3][1] * img_size[0]]],
            #     dtype=np.float32)

            draw_points_norm(frame.reshape((5,-1))[0:1])
            text_anchor = frame.reshape((5,-1))[2]
            text_anchor[1] = 1-text_anchor[1]
            text_anchor *=img_size[1],img_size[0]
            self.glfont.draw_text(text_anchor[0],text_anchor[1],self.marker_status())
开发者ID:elmadjian,项目名称:pupil,代码行数:26,代码来源:reference_surface.py


示例3: gl_display

    def gl_display(self):
        super(Accuracy_Test, self).gl_display()

        if not self.active and self.error_lines is not None:
            draw_polyline_norm(self.error_lines,color=RGBA(1.,0.5,0.,.5),line_type=gl.GL_LINES)
            draw_points_norm(self.error_lines[1::2],color=RGBA(.0,0.5,0.5,.5),size=3)
            draw_points_norm(self.error_lines[0::2],color=RGBA(.5,0.0,0.0,.5),size=3)
开发者ID:Reidzhang,项目名称:pupil,代码行数:7,代码来源:accuracy_test.py


示例4: gl_draw_corners

 def gl_draw_corners(self):
     """
     draw surface and markers
     """
     if self.detected:
         frame = cv2.perspectiveTransform(marker_corners_norm.reshape(-1,1,2),self.m_to_screen)
         draw_points_norm(frame.reshape((4,2)),20,RGBA(1.0,0.2,0.6,.5))
开发者ID:JihadOsakaUniversity,项目名称:pupil,代码行数:7,代码来源:reference_surface.py


示例5: gl_display

    def gl_display(self):
        """
        use gl calls to render
        at least:
            the published position of the reference
        better:
            show the detected postion even if not published
        """

        if self.active:
            draw_points_norm([self.smooth_pos],size=15,color=RGBA(1.,1.,0.,.5))

        if self.active and self.detected:
            for e in self.candidate_ellipses:
                pts = cv2.ellipse2Poly( (int(e[0][0]),int(e[0][1])),
                                    (int(e[1][0]/2),int(e[1][1]/2)),
                                    int(e[-1]),0,360,15)
                draw_polyline(pts,color=RGBA(0.,1.,0,1.))


            # lets draw an indicator on the autostop count
            e = self.candidate_ellipses[3]
            pts = cv2.ellipse2Poly( (int(e[0][0]),int(e[0][1])),
                                (int(e[1][0]/2),int(e[1][1]/2)),
                                int(e[-1]),0,360,360/self.auto_stop_max)
            indicator = [e[0]] + pts[self.auto_stop:].tolist() + [e[0]]
            draw_polyline(indicator,color=RGBA(8.,0.1,0.1,.8),line_type=GL_POLYGON)
        else:
            pass
开发者ID:AlienorV,项目名称:pupil,代码行数:29,代码来源:adjust_calibration.py


示例6: gl_draw_corners

 def gl_draw_corners(self):
     """
     draw surface and markers
     """
     if self.detected:
         frame = np.array([[[0,0],[1,0],[1,1],[0,1]]],dtype=np.float32)
         frame = cv2.perspectiveTransform(frame,self.m_to_screen)
         draw_points_norm(frame.reshape((4,2)),15,RGBA(1.0,0.2,0.6,.5))
开发者ID:elmadjian,项目名称:pupil,代码行数:8,代码来源:reference_surface.py


示例7: gl_display

    def gl_display(self):
        global emotion_col
        print emotion_key
        if (emotion_key=='115'):
            emotion_col=RGBA(0,0,255,.4)
        elif (emotion_key=='104'):
            emotion_col=RGBA(1,.5,.2,.4)
        elif (emotion_key=='97'):
            emotion_col=RGBA(1.,.1,.1,.4)
        elif (emotion_key=='110'):
            emotion_col=RGBA(255,255,255,0)
        else:
            emotion_col=RGBA(255,255,255,0)


        draw_points_norm(self.pupil_display_list,color=emotion_col)
开发者ID:dirtydevil,项目名称:pupil,代码行数:16,代码来源:display_recent_gaze.py


示例8: gl_display

 def gl_display(self):
     if self.vis_mapping_error and self.error_lines is not None:
         draw_polyline_norm(
             self.error_lines, color=RGBA(1.0, 0.5, 0.0, 0.5), line_type=gl.GL_LINES
         )
         draw_points_norm(
             self.error_lines[1::2], size=3, color=RGBA(0.0, 0.5, 0.5, 0.5)
         )
         draw_points_norm(
             self.error_lines[0::2], size=3, color=RGBA(0.5, 0.0, 0.0, 0.5)
         )
     if self.vis_calibration_area and self.calibration_area is not None:
         draw_polyline_norm(
             self.calibration_area,
             thickness=2.0,
             color=RGBA(0.663, 0.863, 0.463, 0.8),
             line_type=gl.GL_LINE_LOOP,
         )
开发者ID:pupil-labs,项目名称:pupil,代码行数:18,代码来源:accuracy_visualizer.py


示例9: gl_display

    def gl_display(self):
        """
        use gl calls to render
        at least:
            the published position of the reference
        better:
            show the detected postion even if not published
        """

        if self.active and self.detected:
            draw_points_norm([self.smooth_pos],size=15,color=RGBA(1.,1.,0.,.5))
            for e in self.candidate_ellipses:
                pts = cv2.ellipse2Poly( (int(e[0][0]),int(e[0][1])),
                                       (int(e[1][0]/2),int(e[1][1]/2)),
                                       int(e[-1]),0,360,15)
                draw_polyline(pts,color=RGBA(0.,1.,0,1.))

        else:
            pass
开发者ID:elmorg,项目名称:pupil,代码行数:19,代码来源:circle_detect.py


示例10: gl_display

    def gl_display(self):
        """
        use gl calls to render
        at least:
            the published position of the reference
        better:
            show the detected postion even if not published
        """

        if self.active:
            draw_points_norm([self.smooth_pos], size=15, color=RGBA(1.0, 1.0, 0.0, 0.5))

        if self.active and len(self.markers):
            # draw the largest ellipse of all detected markers
            for marker in self.markers:
                e = marker["ellipses"][-1]
                pts = cv2.ellipse2Poly(
                    (int(e[0][0]), int(e[0][1])),
                    (int(e[1][0] / 2), int(e[1][1] / 2)),
                    int(e[-1]),
                    0,
                    360,
                    15,
                )
                draw_polyline(pts, color=RGBA(0.0, 1.0, 0, 1.0))
                if len(self.markers) > 1:
                    draw_polyline(
                        pts, 1, RGBA(1.0, 0.0, 0.0, 0.5), line_type=GL_POLYGON
                    )

            # draw indicator on the first detected marker
            if self.counter and self.markers[0]["marker_type"] == "Ref":
                e = self.markers[0]["ellipses"][-1]
                pts = cv2.ellipse2Poly(
                    (int(e[0][0]), int(e[0][1])),
                    (int(e[1][0] / 2), int(e[1][1] / 2)),
                    int(e[-1]),
                    0,
                    360,
                    360 // self.counter_max,
                )
                indicator = [e[0]] + pts[self.counter :].tolist()[::-1] + [e[0]]
                draw_polyline(
                    indicator, color=RGBA(0.1, 0.5, 0.7, 0.8), line_type=GL_POLYGON
                )

            # draw indicator on the stop marker(s)
            if self.auto_stop:
                for marker in self.markers:
                    if marker["marker_type"] == "Stop":
                        e = marker["ellipses"][-1]
                        pts = cv2.ellipse2Poly(
                            (int(e[0][0]), int(e[0][1])),
                            (int(e[1][0] / 2), int(e[1][1] / 2)),
                            int(e[-1]),
                            0,
                            360,
                            360 // self.auto_stop_max,
                        )
                        indicator = [e[0]] + pts[self.auto_stop :].tolist() + [e[0]]
                        draw_polyline(
                            indicator,
                            color=RGBA(8.0, 0.1, 0.1, 0.8),
                            line_type=GL_POLYGON,
                        )
        else:
            pass
开发者ID:pupil-labs,项目名称:pupil,代码行数:67,代码来源:manual_marker_calibration.py


示例11: gl_display

 def gl_display(self):
     if self.detected:
         draw_points_norm([self.pos],size=self.r,color=RGBA(0.,1.,0.,.5))
开发者ID:lloves,项目名称:pupil,代码行数:3,代码来源:natural_features_calibration.py


示例12: gl_display

 def gl_display(self):
     for pt, a in self.pupil_display_list:
         # This could be faster if there would be a method to also add multiple colors per point
         draw_points_norm([pt], size=35, color=RGBA(1.0, 0.2, 0.4, a))
开发者ID:pupil-labs,项目名称:pupil,代码行数:4,代码来源:display_recent_gaze.py


示例13: gl_display

 def gl_display(self):
     draw_points_norm(self.pupil_display_list,
                     size=35,
                     color=RGBA(1.,.2,.4,.6))
开发者ID:cpicanco,项目名称:pupil,代码行数:4,代码来源:display_recent_gaze.py



注:本文中的pyglui.cygl.utils.draw_points_norm函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.draw_polyline函数代码示例发布时间:2022-05-25
下一篇:
Python utils.draw_points函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap