Skip to content

Commit

Permalink
Various UI tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkassner committed Jan 23, 2016
1 parent 557cbf4 commit 251a9dc
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 31 deletions.
2 changes: 1 addition & 1 deletion pupil_src/capture/eye.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ def set_detector(new_detector):
general_settings = ui.Growing_Menu('General')
general_settings.append(ui.Slider('scale',g_pool.gui, setter=set_scale,step = .05,min=1.,max=2.5,label='Interface Size'))
general_settings.append(ui.Button('Reset window size',lambda: glfw.glfwSetWindowSize(main_window,frame.width,frame.height)) )
general_settings.append(ui.Selector('display_mode',g_pool,setter=set_display_mode_info,selection=['camera_image','roi','algorithm'], labels=['Camera Image', 'ROI', 'Algorithm'], label="Mode") )
general_settings.append(ui.Switch('flip',g_pool,label='Flip image display'))
general_settings.append(ui.Selector('display_mode',g_pool,setter=set_display_mode_info,selection=['camera_image','roi','algorithm'], labels=['Camera Image', 'ROI', 'Algorithm'], label="Mode") )
g_pool.display_mode_info = ui.Info_Text(g_pool.display_mode_info_text[g_pool.display_mode])
general_settings.append(g_pool.display_mode_info)
g_pool.sidebar.append(general_settings)
Expand Down
11 changes: 5 additions & 6 deletions pupil_src/capture/pupil_detectors/canny_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,16 +518,15 @@ def init_gui(self,sidebar):
+"Adjust the pupil intensity range so that the pupil is fully overlaid with blue. "\
+"Adjust the pupil min and pupil max ranges (red circles) so that the detected pupil size (green circle) is within the bounds.")
self.menu.append(self.info)
self.menu.append(ui.Switch('coarse_detection',self,label='Use coarse detection'))
self.menu.append(ui.Slider('intensity_range',self,label='Pupil intensity range',min=0,max=60,step=1))
self.menu.append(ui.Slider('pupil_min',self,label='Pupil min',min=1,max=250,step=1))
self.menu.append(ui.Slider('pupil_max',self,label='Pupil max',min=50,max=400,step=1))
self.menu.append(ui.Button('Open debug window',self.toggle_window))

self.advanced_controls_menu = ui.Growing_Menu('Advanced Controls')
self.advanced_controls_menu.append(ui.Switch('coarse_detection',self,label='Use coarse detection'))
self.advanced_controls_menu.append(ui.Slider('min_contour_size',self,label='Contour min length',min=1,max=200,step=1))

self.advanced_controls_menu.append(ui.Button('Open debug window',self.toggle_window))
self.menu.append(self.advanced_controls_menu)
# self.advanced_controls_menu = ui.Growing_Menu('Advanced Controls')
# self.advanced_controls_menu.append(ui.Slider('min_contour_size',self,label='Contour min length',min=1,max=200,step=1))
# self.menu.append(self.advanced_controls_menu)
sidebar.append(self.menu)


Expand Down
12 changes: 5 additions & 7 deletions pupil_src/capture/pupil_detectors/detector_2d.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,15 @@ cdef class Detector_2D:
+"Adjust the pupil intensity range so that the pupil is fully overlaid with blue. "\
+"Adjust the pupil min and pupil max ranges (red circles) so that the detected pupil size (green circle) is within the bounds.")
self.menu.append(info)
self.menu.append(ui.Switch('coarse_detection',self.detectProperties,label='Use coarse detection'))
self.menu.append(ui.Slider('intensity_range',self.detectProperties,label='Pupil intensity range',min=0,max=60,step=1))
self.menu.append(ui.Slider('pupil_size_min',self.detectProperties,label='Pupil min',min=1,max=250,step=1))
self.menu.append(ui.Slider('pupil_size_max',self.detectProperties,label='Pupil max',min=50,max=400,step=1))

advanced_controls_menu = ui.Growing_Menu('Advanced Controls')
advanced_controls_menu.append(ui.Switch('coarse_detection',self.detectProperties,label='Use coarse detection'))
self.menu.append(ui.Button('Open debug window',self.toggle_window))
#advanced_controls_menu = ui.Growing_Menu('Advanced Controls')
#advanced_controls_menu.append(ui.Slider('contour_size_min',self.detectProperties,label='Contour min length',min=1,max=200,step=1))
advanced_controls_menu.append(ui.Slider('ellipse_true_support_min_dist',self.detectProperties,label='ellipse_true_support_min_dist',min=0.1,max=7,step=0.1))

advanced_controls_menu.append(ui.Button('Open debug window',self.toggle_window))
self.menu.append(advanced_controls_menu)
#advanced_controls_menu.append(ui.Slider('ellipse_true_support_min_dist',self.detectProperties,label='ellipse_true_support_min_dist',min=0.1,max=7,step=0.1))
#self.menu.append(advanced_controls_menu)
sidebar.append(self.menu)

def deinit_gui(self):
Expand Down
19 changes: 8 additions & 11 deletions pupil_src/capture/pupil_detectors/detector_3d.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,14 @@ cdef class Detector_3D:
+"Adjust the pupil intensity range so that the pupil is fully overlaid with blue. "\
+"Adjust the pupil min and pupil max ranges (red circles) so that the detected pupil size (green circle) is within the bounds.")
self.menu2D.append(info)
self.menu2D.append(ui.Switch('coarse_detection',self.detectProperties2D,label='Use coarse detection'))
self.menu2D.append(ui.Slider('intensity_range',self.detectProperties2D,label='Pupil intensity range',min=0,max=60,step=1))
self.menu2D.append(ui.Slider('pupil_size_min',self.detectProperties2D,label='Pupil min',min=1,max=250,step=1))
self.menu2D.append(ui.Slider('pupil_size_max',self.detectProperties2D,label='Pupil max',min=50,max=400,step=1))
self.menu2D.append(ui.Slider('ellipse_roundness_ratio',self.detectProperties2D,min=0.01,max=1.0,step=0.01))
self.menu2D.append(ui.Slider('initial_ellipse_fit_treshhold',self.detectProperties2D,min=0.01,max=6.0,step=0.01))
self.menu2D.append(ui.Slider('canny_treshold',self.detectProperties2D,min=1,max=1000,step=1))
self.menu2D.append(ui.Slider('canny_ration',self.detectProperties2D,min=1,max=4,step=1))

#self.menu2D.append(ui.Slider('ellipse_roundness_ratio',self.detectProperties2D,min=0.01,max=1.0,step=0.01))
#self.menu2D.append(ui.Slider('initial_ellipse_fit_treshhold',self.detectProperties2D,min=0.01,max=6.0,step=0.01))
#self.menu2D.append(ui.Slider('canny_treshold',self.detectProperties2D,min=1,max=1000,step=1))
#self.menu2D.append(ui.Slider('canny_ration',self.detectProperties2D,min=1,max=4,step=1))
self.menu3D = ui.Growing_Menu('Pupil Detector 3D')
info_3d = ui.Info_Text("Open the debug window to see a visualization of the 3D pupil detection." )
self.menu3D.append(info_3d)
Expand All @@ -169,14 +169,11 @@ cdef class Detector_3D:
# self.menu3D.append(ui.Slider('max_circle_variance',self.detectProperties3D,label='3D fit max circle variance', min=0.01,max=2.0,step=0.001))
# self.menu3D.append(ui.Slider('combine_evaluation_max',self.detectProperties3D,label='3D fit max combinations eval', min=500,max=50000,step=5000))
# self.menu3D.append(ui.Slider('combine_depth_max',self.detectProperties3D,label='3D fit max combination depth', min=10,max=5000,step=20))


advanced_controls_menu = ui.Growing_Menu('Advanced Controls')
advanced_controls_menu.append(ui.Switch('coarse_detection',self.detectProperties2D,label='Use coarse detection'))
#advanced_controls_menu.append(ui.Slider('contour_size_min',self.detectProperties2D,label='Contour min length',min=1,max=200,step=1))
sidebar.append(self.menu2D)
sidebar.append(self.menu3D)
sidebar.append(advanced_controls_menu)
#advanced_controls_menu = ui.Growing_Menu('Advanced Controls')
#advanced_controls_menu.append(ui.Slider('contour_size_min',self.detectProperties2D,label='Contour min length',min=1,max=200,step=1))
#sidebar.append(advanced_controls_menu)

def deinit_gui(self):
self.gPool.sidebar.remove(self.menu2D)
Expand Down
4 changes: 2 additions & 2 deletions pupil_src/capture/recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ def init_gui(self):
self.menu.append(ui.Text_Input('rec_dir',self,setter=self.set_rec_dir,label='Path to recordings'))
self.menu.append(ui.Text_Input('session_name',self,setter=self.set_session_name,label='Recording session name'))
self.menu.append(ui.Switch('show_info_menu',self,on_val=True,off_val=False,label='Request additional user info'))
self.menu.append(ui.Selector('raw_jpeg',self,selection = [True,False], labels=["bigger file, less CPU", "smaller file, more CPU"],label='compression'))
self.menu.append(ui.Selector('raw_jpeg',self,selection = [True,False], labels=["bigger file, less CPU", "smaller file, more CPU"],label='Compression'))
self.menu.append(ui.Info_Text('Recording the raw eye video is optional. We use it for debugging.'))
self.menu.append(ui.Switch('record_eye',self,on_val=True,off_val=False,label='Record eye'))
self.menu.append(ui.Selector('audio_src',self, selection=self.audio_devices_dict.keys()))
self.menu.append(ui.Selector('audio_src',self, selection=self.audio_devices_dict.keys(),label='Audio Source'))

self.button = ui.Thumb('running',self,setter=self.toggle,label='Record',hotkey='r')
self.button.on_color[:] = (1,.0,.0,.8)
Expand Down
4 changes: 2 additions & 2 deletions pupil_src/capture/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ def set_detection_mapping_mode(new_mode):
general_settings.append(ui.Slider('scale',g_pool.gui, setter=set_scale,step = .05,min=1.,max=2.5,label='Interface size'))
general_settings.append(ui.Button('Reset window size',lambda: glfw.glfwSetWindowSize(main_window,frame.width,frame.height)) )
general_settings.append(ui.Selector('detection_mapping_mode',g_pool,label='detection & mapping mode',setter=set_detection_mapping_mode,selection=['2d','3d']))
general_settings.append(ui.Switch('eye0_process',label='detect eye 0',setter=lambda alive: start_stop_eye(0,alive),getter=lambda: eyes_are_alive[0].value ))
general_settings.append(ui.Switch('eye1_process',label='detect eye 1',setter=lambda alive: start_stop_eye(1,alive),getter=lambda: eyes_are_alive[1].value ))
general_settings.append(ui.Switch('eye0_process',label='Detect eye 0',setter=lambda alive: start_stop_eye(0,alive),getter=lambda: eyes_are_alive[0].value ))
general_settings.append(ui.Switch('eye1_process',label='Detect eye 1',setter=lambda alive: start_stop_eye(1,alive),getter=lambda: eyes_are_alive[1].value ))
general_settings.append(ui.Selector('Open plugin', selection = user_launchable_plugins,
labels = [p.__name__.replace('_',' ') for p in user_launchable_plugins],
setter= open_plugin, getter=lambda: "Select to load"))
Expand Down
4 changes: 2 additions & 2 deletions pupil_src/shared_modules/video_capture/uvc_capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def gui_init_cam_by_uid(requested_id):
cameras = uvc.device_list()
camera_names = ['Fake Capture']+[c['name'] for c in cameras]
camera_ids = [None]+[c['uid'] for c in cameras]
self.menu.append(ui.Selector('uid',self,selection=camera_ids,labels=camera_names,label='Capture Device', setter=gui_init_cam_by_uid) )
self.menu.append(ui.Selector('uid',self,selection=camera_ids,labels=camera_names,label='Capture device', setter=gui_init_cam_by_uid) )

sensor_control = ui.Growing_Menu(label='Sensor Settings')
sensor_control.append(ui.Info_Text("Do not change these during calibration or recording!"))
Expand All @@ -236,7 +236,7 @@ def gui_init_cam_by_uid(requested_id):
image_processing.collapsed=True

sensor_control.append(ui.Selector('frame_size',self,setter=set_size, selection=self.capture.frame_sizes,label='Resolution' ) )
sensor_control.append(ui.Selector('frame_rate',self, selection=self.capture.frame_rates,label='Framerate' ) )
sensor_control.append(ui.Selector('frame_rate',self, selection=self.capture.frame_rates,label='Frame rate' ) )


for control in self.capture.controls:
Expand Down

0 comments on commit 251a9dc

Please sign in to comment.