当前位置: 首页>>代码示例>>Python>>正文


Python ui.get_opensans_font_path函数代码示例

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


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

示例1: __init__

    def __init__(self, g_pool,fullscreen=True,marker_scale=1.0,sample_duration=40):
        super(Screen_Marker_Calibration, self).__init__(g_pool)
        self.active = False
        self.detected = False
        self.screen_marker_state = 0.
        self.sample_duration =  sample_duration # number of frames to sample per site
        self.lead_in = 25 #frames of marker shown before starting to sample
        self.lead_out = 5 #frames of markers shown after sampling is donw


        self.active_site = None
        self.sites = []
        self.display_pos = None
        self.on_position = False

        self.markers = []
        self.pos = None

        self.marker_scale = marker_scale

        self._window = None

        self.menu = None
        self.button = None

        self.fullscreen = fullscreen
        self.clicks_to_close = 5

        self.glfont = fontstash.Context()
        self.glfont.add_font('opensans',get_opensans_font_path())
        self.glfont.set_size(32)
        self.glfont.set_color_float((0.2,0.5,0.9,1.0))
        self.glfont.set_align_string(v_align='center')
开发者ID:NoahMilam,项目名称:pupil,代码行数:33,代码来源:screen_marker_calibration.py

示例2: draw_markers

def draw_markers(img_size,markers, roi=None):

    glfont = fontstash.Context()
    glfont.add_font('opensans',get_opensans_font_path())
    if roi != None:
        glfont.set_size((22 * roi[2]) / float(img_size[1]))
    else:
        glfont.set_size(22)
    glfont.set_color_float((0.2,0.5,0.9,1.0))

    for m in markers:
        #old method using opencv to draw doesn't show the result on screen
        """
        centroid = [m['verts'].sum(axis=0)/4.]
        origin = m['verts'][0]
        hat = np.array([[[0,0],[0,1],[.5,1.25],[1,1],[1,0]]],dtype=np.float32)
        hat = cv2.perspectiveTransform(hat,m_marker_to_screen(m))
        cv2.polylines(img,np.int0(hat),color = (0,0,255),isClosed=True)
        cv2.polylines(img,np.int0(centroid),color = (255,255,0),isClosed=True,thickness=2)
        cv2.putText(img,'id: '+str(m['id']),tuple(np.int0(origin)[0,:]),fontFace=cv2.FONT_HERSHEY_SIMPLEX, fontScale=0.5, color=(255,100,50))


        """
        hat = np.array([[[0,0],[0,1],[.5,1.3],[1,1],[1,0],[0,0]]],dtype=np.float32)
        hat = cv2.perspectiveTransform(hat,m_marker_to_screen(m))
        draw_polyline(hat.reshape((6,2)),1,RGBA(1.0,0,0,1.0))
        glfont.draw_text(m['verts'][0][0][0],m['verts'][0][0][1],'id: '+str(m['id']))
开发者ID:IroneP,项目名称:pupil,代码行数:27,代码来源:square_marker_detect.py

示例3: __init__

    def __init__(self,g_pool, menu_conf = {'collapsed':True},fullscreen = False):
        super(Camera_Intrinsics_Estimation, self).__init__(g_pool)
        self.collect_new = False
        self.calculated = False
        self.obj_grid = _gen_pattern_grid((4, 11))
        self.img_points = []
        self.obj_points = []
        self.count = 10
        self.img_shape = None

        self.display_grid = _make_grid()

        self._window = None

        self.menu = None
        self.menu_conf = menu_conf
        self.button = None
        self.clicks_to_close = 5
        self.window_should_close = False
        self.fullscreen = fullscreen
        self.monitor_idx = 0


        self.glfont = fontstash.Context()
        self.glfont.add_font('opensans',get_opensans_font_path())
        self.glfont.set_size(32)
        self.glfont.set_color_float((0.2,0.5,0.9,1.0))
        self.glfont.set_align_string(v_align='center')
开发者ID:DanielNoteboom,项目名称:Mobile_Capstone,代码行数:28,代码来源:camera_intrinsics_estimation.py

示例4: open_window

	def open_window(self):
		if not self._window:
			self.input = {'button':None, 'mouse':(0,0)}

			# get glfw started
			if self.run_independently:
				glfwInit()
			window = glfwGetCurrentContext()
			self._window = glfwCreateWindow(self.window_size[0], self.window_size[1], self.name, None, window)
			glfwMakeContextCurrent(self._window)

			if not self._window:
				exit()

			glfwSetWindowPos(self._window,0,0)
			# Register callbacks window
			glfwSetFramebufferSizeCallback(self._window,self.on_resize)
			glfwSetWindowIconifyCallback(self._window,self.on_iconify)
			glfwSetKeyCallback(self._window,self.on_key)
			glfwSetCharCallback(self._window,self.on_char)
			glfwSetMouseButtonCallback(self._window,self.on_button)
			glfwSetCursorPosCallback(self._window,self.on_pos)
			glfwSetScrollCallback(self._window,self.on_scroll)

			# get glfw started
			if self.run_independently:
				init()
			self.basic_gl_setup()

			self.glfont = fs.Context()
			self.glfont.add_font('opensans',get_opensans_font_path())
			self.glfont.set_size(22)
			self.glfont.set_color_float((0.2,0.5,0.9,1.0))
			self.on_resize(self._window,*glfwGetFramebufferSize(self._window))
			glfwMakeContextCurrent(window)
开发者ID:DuongHoangThuy,项目名称:pupil-1,代码行数:35,代码来源:visualizer_3d.py

示例5: __init__

    def __init__(self,name="unnamed",saved_definition=None):
        self.name = name
        self.markers = {}
        self.detected_markers = 0
        self.defined = False
        self.build_up_status = 0
        self.required_build_up = 90.
        self.detected = False
        self.m_to_screen = None
        self.m_from_screen = None
        self.camera_pose_3d = None
        self.crop_region = None

        self.uid = str(time())
        self.real_world_size = {'x':1.,'y':1.}

        ###window and gui vars
        self._window = None
        self.fullscreen = False
        self.window_should_open = False
        self.window_should_close = False

        self.gaze_on_srf = [] # points on surface for realtime feedback display

        self.glfont = fontstash.Context()
        self.glfont.add_font('opensans',get_opensans_font_path())
        self.glfont.set_size(22)
        self.glfont.set_color_float((0.2,0.5,0.9,1.0))


        if saved_definition is not None:
            self.load_from_dict(saved_definition)
开发者ID:elmadjian,项目名称:pupil,代码行数:32,代码来源:reference_surface.py

示例6: init_ui

 def init_ui(self):
     self.glfont = fs.Context()
     self.glfont.add_font("opensans", ui.get_opensans_font_path())
     self.glfont.set_font("opensans")
     self.fps_timeline = ui.Timeline(
         "Recorded FPS", self.draw_fps, self.draw_fps_legend
     )
     self.fps_timeline.content_height *= 2
     self.g_pool.user_timelines.append(self.fps_timeline)
开发者ID:pupil-labs,项目名称:pupil,代码行数:9,代码来源:system_timelines.py

示例7: init_ui

 def init_ui(self):
     super().init_ui()
     self.glfont = fs.Context()
     self.glfont.add_font("opensans", ui.get_opensans_font_path())
     self.glfont.set_font("opensans")
     self.timeline = ui.Timeline(
         "Blink Detection", self.draw_activation, self.draw_legend
     )
     self.timeline.content_height *= 2
     self.g_pool.user_timelines.append(self.timeline)
开发者ID:pupil-labs,项目名称:pupil,代码行数:10,代码来源:blink_detection.py

示例8: __init__

    def __init__(self,g_pool,fullscreen = False):
        super(Chessboard_Calibration, self).__init__(g_pool)

        self.menu = None
        self.button = None
        self.clicks_to_close = 5
        self.window_should_close = False
        self.fullscreen = fullscreen
        self.monitor_idx = 0
        self.nb_img = 10
        self.nb_cols = 10
        self.nb_rows = 7
        self.last_nb_img = self.nb_img
        self.last_nb_cols = self.nb_cols
        self.last_nb_rows = self.nb_rows


        self.collect_new = False
        self.calculated = False
        self.count = self.nb_img
        self.obj_grid = _gen_pattern_grid((self.nb_rows-1,self.nb_cols-1))
        self.img_points = []
        self.obj_points = []
        #self.display_grid = _make_grid()

        self._window = None

        # termination criteria
        self.criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001)

        self.glfont = fontstash.Context()
        self.glfont.add_font('opensans',get_opensans_font_path())
        self.glfont.set_size(32)
        self.glfont.set_color_float((0.2,0.5,0.9,1.0))
        self.glfont.set_align_string(v_align='center')



        self.undist_img = None
        self.calibrate_img = None
        self.nb_frame = 10
        self.show_undistortion = False
        self.show_undistortion_switch = None


        self.camera_calibration = load_camera_calibration(self.g_pool)
        if self.camera_calibration:
            logger.info('Loaded camera calibration. Click show undistortion to verify.')
            self.camera_intrinsics = self.camera_calibration['camera_matrix'],self.camera_calibration['dist_coefs'],self.camera_calibration['resolution'],self.camera_calibration['error']
        else:
            self.camera_intrinsics = None
开发者ID:IroneP,项目名称:pupil,代码行数:51,代码来源:chessboard_calibration.py

示例9: __init__

    def __init__(self,g_pool,fullscreen = False):
        super(Camera_Intrinsics_Estimation, self).__init__(g_pool)
        self.collect_new = False
        self.calculated = False
        self.obj_grid = _gen_pattern_grid((4, 11))
        self.img_points = []
        self.obj_points = []
        self.count = 10
        self.display_grid = _make_grid()

        self._window = None

        self.menu = None
        self.button = None
        self.clicks_to_close = 5
        self.window_should_close = False
        self.fullscreen = fullscreen
        self.monitor_idx = 0


        self.glfont = fontstash.Context()
        self.glfont.add_font('opensans',get_opensans_font_path())
        self.glfont.set_size(32)
        self.glfont.set_color_float((0.2,0.5,0.9,1.0))
        self.glfont.set_align_string(v_align='center')



        self.undist_img = None
        self.show_undistortion = False
        self.show_undistortion_switch = None


        try:
            camera_calibration = load_object(os.path.join(self.g_pool.user_dir,'camera_calibration'))
        except:
            self.camera_intrinsics = None
        else:
            logger.info('Loaded camera calibration. Click show undistortion to verify.')
            logger.info('Hint: Lines in the real world should be straigt in the image.')
            same_name = camera_calibration['camera_name'] == self.g_pool.capture.name
            same_resolution =  camera_calibration['resolution'] == self.g_pool.capture.frame_size
            if not (same_name and same_resolution):
                logger.warning('Loaded camera calibration but camera name and/or resolution has changed. Please re-calibrate.')

            K = camera_calibration['camera_matrix']
            dist_coefs = camera_calibration['dist_coefs']
            resolution = camera_calibration['resolution']
            self.camera_intrinsics = K,dist_coefs,resolution
开发者ID:toshikurauchi,项目名称:pupil,代码行数:49,代码来源:camera_intrinsics_estimation.py

示例10: init_gui

    def init_gui(self):

        self.glfont = fontstash.Context()
        self.glfont.add_font('opensans',get_opensans_font_path())
        self.glfont.set_size(32)
        self.glfont.set_color_float((0.2,0.5,0.9,1.0))
        self.glfont.set_align_string(v_align='center',h_align='middle')

        self.window_size = glfwGetFramebufferSize(glfwGetCurrentContext())
        self.tex = Render_Target(*self.window_size)

        self.log_handler = Log_to_Callback(self.on_log)
        logger = logging.getLogger()
        logger.addHandler(self.log_handler)
        self.log_handler.setLevel(logging.INFO)
开发者ID:NoahMilam,项目名称:pupil,代码行数:15,代码来源:log_display.py

示例11: open_window

    def open_window(self):
        if not self.window:
            self.input = {"button": None, "mouse": (0, 0)}

            # get glfw started
            if self.run_independently:
                glfwInit()
                self.window = glfwCreateWindow(
                    self.window_size[0], self.window_size[1], self.name, None
                )
            else:
                self.window = glfwCreateWindow(
                    self.window_size[0],
                    self.window_size[1],
                    self.name,
                    None,
                    share=glfwGetCurrentContext(),
                )

            self.other_window = glfwGetCurrentContext()

            glfwMakeContextCurrent(self.window)
            glfwSwapInterval(0)
            glfwSetWindowPos(
                self.window, window_position_default[0], window_position_default[1]
            )
            # Register callbacks window
            glfwSetFramebufferSizeCallback(self.window, self.on_resize)
            glfwSetWindowIconifyCallback(self.window, self.on_iconify)
            glfwSetKeyCallback(self.window, self.on_window_key)
            glfwSetCharCallback(self.window, self.on_window_char)
            glfwSetMouseButtonCallback(self.window, self.on_window_mouse_button)
            glfwSetCursorPosCallback(self.window, self.on_pos)
            glfwSetScrollCallback(self.window, self.on_scroll)

            # get glfw started
            if self.run_independently:
                glutils.init()
            self.basic_gl_setup()

            self.sphere = glutils.Sphere(20)

            self.glfont = fs.Context()
            self.glfont.add_font("opensans", get_opensans_font_path())
            self.glfont.set_size(18)
            self.glfont.set_color_float((0.2, 0.5, 0.9, 1.0))
            self.on_resize(self.window, *glfwGetFramebufferSize(self.window))
            glfwMakeContextCurrent(self.other_window)
开发者ID:pupil-labs,项目名称:pupil,代码行数:48,代码来源:visualizer.py

示例12: init_ui

    def init_ui(self):
        self.add_menu()
        self.menu.label = type(self).MENU_LABEL_TEXT

        for help_block in self.__doc__.split("\n\n"):
            help_str = help_block.replace("\n", " ").replace("  ", "").strip()
            self.menu.append(gl_ui.Info_Text(help_str))

        color_legend_text = ui.color_from_segment.__doc__
        color_legend_text = color_legend_text.strip()
        color_legend_text = color_legend_text.replace("  ", "")
        color_legend_text = color_legend_text.replace("\n-", "\n    -")
        self.menu.append(gl_ui.Info_Text(color_legend_text))

        self.glfont = fontstash.Context()
        self.glfont.add_font("opensans", gl_ui.get_opensans_font_path())
开发者ID:pupil-labs,项目名称:pupil,代码行数:16,代码来源:eye_movement_detector_real_time.py

示例13: __init__

    def __init__(self, g_pool,fullscreen=True,marker_scale=1.0,sample_duration=45):
        super().__init__(g_pool)
        self.detected = False
        self.screen_marker_state = 0.
        self.sample_duration =  sample_duration # number of frames to sample per site
        self.fixation_boost = sample_duration/2.
        self.lead_in = 25 #frames of marker shown before starting to sample
        self.lead_out = 5 #frames of markers shown after sampling is donw
        self.black_duration = 15
        self.session_settings = Persistent_Dict(os.path.join(g_pool.user_dir,'user_settings_screen_calibration') )

        self.active_site = None
        self.sites = []
        self.display_pos = None
        self.on_position = False


        self.screen_markers = [[],[],[],[],[],[], []]
        self.encode_markers()


        self.markers = []
        self.pos = None

        self.marker_scale = marker_scale

        self._window = None

        self.menu = None
        self.button = None

        self.fullscreen = fullscreen
        self.clicks_to_close = 5

        self.glfont = fontstash.Context()
        self.glfont.add_font('opensans',get_opensans_font_path())
        self.glfont.set_size(32)
        self.glfont.set_color_float((0.2,0.5,0.9,1.0))
        self.glfont.set_align_string(v_align='center')

        # UI Platform tweaks
        if system() == 'Linux':
            self.window_position_default = (0, 0)
        elif system() == 'Windows':
            self.window_position_default = (8, 31)
        else:
            self.window_position_default = (0, 0)
开发者ID:samtuhka,项目名称:pupil,代码行数:47,代码来源:screen_marker_calibration.py

示例14: __init__

    def __init__(
        self,
        g_pool,
        fullscreen=True,
        marker_scale=1.0,
        sample_duration=40,
        monitor_idx=0,
    ):
        super().__init__(g_pool)
        self.screen_marker_state = 0.0
        self.sample_duration = sample_duration  # number of frames to sample per site
        self.lead_in = 25  # frames of marker shown before starting to sample
        self.lead_out = 5  # frames of markers shown after sampling is donw

        self.active_site = None
        self.sites = []
        self.display_pos = -1.0, -1.0
        self.on_position = False
        self.pos = None

        self.marker_scale = marker_scale

        self._window = None

        self.menu = None

        self.monitor_idx = monitor_idx
        self.fullscreen = fullscreen
        self.clicks_to_close = 5

        self.glfont = fontstash.Context()
        self.glfont.add_font("opensans", get_opensans_font_path())
        self.glfont.set_size(32)
        self.glfont.set_color_float((0.2, 0.5, 0.9, 1.0))
        self.glfont.set_align_string(v_align="center")

        # UI Platform tweaks
        if system() == "Linux":
            self.window_position_default = (0, 0)
        elif system() == "Windows":
            self.window_position_default = (8, 90)
        else:
            self.window_position_default = (0, 0)

        self.circle_tracker = CircleTracker()
        self.markers = []
开发者ID:pupil-labs,项目名称:pupil,代码行数:46,代码来源:screen_marker_calibration.py

示例15: __init__

    def __init__(
        self,
        g_pool,
        marker_mode="Full screen",
        marker_scale=1.0,
        sample_duration=40,
        monitor_idx=0,
    ):
        super().__init__(g_pool)
        self.screen_marker_state = 0.0
        self.lead_in = 25  # frames of marker shown before starting to sample

        self.display_pos = (0.5, 0.5)
        self.on_position = False
        self.pos = None

        self.marker_scale = marker_scale

        self._window = None

        self.menu = None

        self.stop_marker_found = False
        self.auto_stop = 0
        self.auto_stop_max = 30

        self.monitor_idx = monitor_idx
        self.marker_mode = marker_mode
        self.clicks_to_close = 5

        self.glfont = fontstash.Context()
        self.glfont.add_font("opensans", get_opensans_font_path())
        self.glfont.set_size(32)
        self.glfont.set_color_float((0.2, 0.5, 0.9, 1.0))
        self.glfont.set_align_string(v_align="center")

        # UI Platform tweaks
        if system() == "Linux":
            self.window_position_default = (0, 0)
        elif system() == "Windows":
            self.window_position_default = (8, 90)
        else:
            self.window_position_default = (0, 0)

        self.circle_tracker = CircleTracker()
        self.markers = []
开发者ID:pupil-labs,项目名称:pupil,代码行数:46,代码来源:single_marker_calibration.py


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