.. _config-simplegazetracker: Configure SimpleGazeTracker (0.12.0 or later) ============================================================= Configuration file of SimpleGazeTracker is a plain text file. Default configuration file name is CONFIG_(EDITION), where (EDITION) is edition name (FLYCAPTURE2, OPENCV, OPTITRACK or SPINNAKER). Configuration file must have two sections named **[SimpleGazeTrackerCommon]** and **[SimpleGazeTrackerCamera]**. The former section includes camera-independent parameters, while the latter section includes camera-specific parameters. This is an example of CONFIG_SPINNAKER. :: [SimpleGazeTrackerCommon] BINOCULAR=0 THRESHOLD=17 MAX_PUPIL_WIDTH=25 MIN_PUPIL_WIDTH=15 PURKINJE_THRESHOLD=236 PURKINJE_SEARCHAREA=29 PURKINJE_EXCLUDEAREA=8 CAMERA_WIDTH=320 CAMERA_HEIGHT=224 PREVIEW_WIDTH=640 PREVIEW_HEIGHT=480 ROI_WIDTH=320 ROI_HEIGHT=224 SHOW_DETECTIONERROR_MSG=0 PORT_SEND=10001 PORT_RECV=10000 DELAY_CORRECTION=0 OUTPUT_PUPILSIZE=1 USBIO_BOARD=0 USBIO_AD=0;BIP5VOLTS USBIO_DI=FIRSTPORTA USB_USE_THREAD=0 OPEN_SETUP_GUIDE=1 MORPH_TRANS=0 [SimpleGazeTrackerCamera] # Camera specific parameters for Spinnaker Edition CAMERA_N=0 OFFSET_X=0 OFFSET_Y=0 BINNING_SIZE=1 FRAME_RATE=30 EXPOSURE=3000 BLUR_FILTER_SIZE=3 USE_THREAD=1 SLEEP_DURATION=0 .. note:: - Parameter name is case sensitive. - Lines start with '#' are ignored. Camera-independent parameters -------------------------------------- ======================= ============================================================== ========================= Parameter Description Adjustable at run-time ======================= ============================================================== ========================= BINOCULAR This parameter must be **0** or **1**. If the value is 1, NO SimpleGazeTracker runs at binocular recording mode. Otherwise, it runs at monocular recording mode. THRESHOLD This parameter affects detection of pupil. YES See :ref:`adjusting-camera` for detal. MAX_PUPIL_WIDTH This parameter affects detection of pupil. YES See :ref:`adjusting-camera` for detal. MIN_PUPIL_WIDTH This parameter affects detection of pupil. YES See :ref:`adjusting-camera` for detal. PURKINJE_THRESHOLD This parameter affects detection of the first Purkinje image. YES See :ref:`adjusting-camera` for detal. PURKINJE_SEARCHAREA This parameter affects detection of the first Purkinje image. YES See :ref:`adjusting-camera` for detal. PURKINJE_EXCLUDEAREA This parameter affects detection of pupil center. YES See :ref:`adjusting-camera` for detal. CAMERA_WIDTH Width of the image sent from the camear. NO CAMERA_HEIGHT Height of the image sent from the camear. NO PREVIEW_WIDTH Width of the preview image on the screen of the Recorder PC. NO PREVIEW_HEIGHT Height of the preview image on the screen of the Recorder PC. NO ROI_WIDTH SimpleGazeTracker searches pupil and the first Purkinje image NO only from the region specified by this parameter and ROI_HEIGHT. See :ref:`set-roi` for detail. **New in 0.5.1 / Renamed in 0.12.0** ROI_HEIGHT SimpleGazeTracker searches pupil and the first Purkinje image NO only from the region specified by this parameter and ROI_WIDTH. See :ref:`set-roi` for detail. **New in 0.5.1 / Renamed in 0.12.0** SHOW_DETECTIONERROR_MSG This parameter must be **0** or **1**. If the value is 1, NO Error message is overlaid on the camer apreview image if detection of pupil and the first Purkinje image is failed. See :ref:`adjusting-camera` for detal. **New in 0.5.1** PORT_SEND TCP/IP Port number for sending information to the Recorder PC. NO This value must be the same to **portRecv (not portSend)** parameter of :func:`GazeParser.TrackingTools.BaseController.connect`. Default value is 10001. **New in 0.5.1** PORT_RECV TCP/IP Port number for receiving commands from the Recorder NO PC. This value must be the same to **portSend (not portRecv)** parameter of :func:`GazeParser.TrackingTools.BaseController.connect`. Default value is 10000. **New in 0.5.1** DELAY_CORRECTION If delay in measuring gaze position is unacceptably long, NO you can use this parameter to correct delay. Unit of the value is millisedonds. **Currently, only integer (not float) value is accepted.** Default value is 0. See :ref:`stim_cap_delay` for detail. **New in 0.5.1** OUTPUT_PUPILSIZE This parameter must be **0** or **1**. If the value is 1, NO pupil size (area of ellipse fitted to the pupil) is output to the data file. **New in 0.5.3** USBIO_BOARD ID or name of USB-IO device. See :ref:`usb-io` for detail. NO USBIO_AD Port and range of analog input channel(s). See :ref:`usb-io` for detail. NO USBIO_DI Port of digital input. See :ref:`usb-io` for detail. NO USB_USE_THREAD This parameter must be **0** or **1**. A saparate thread is NO used to read analog/digital inputs from USB-IO device if the value is 1. Generally, using separate thread results in better performance. OPEN_SETUP_GUIDE This parameter must be **0** or **1**. If this value is 1, NO a dialog is shown when SimpleGazeTracker is started to ask to open camear setup guide. Note that this value is automatically set to 0 after the dialog is shown. **New in 0.11.0** MORPH_TRANS Apply morphological transformation if this value is greater YES than 1 (closing) or smaller than -1 (opening). Absolute value of this parameter corresponds to kernel size of the transformation. ======================= ============================================================== ========================= .. note:: **MAXPOINTS** and **MINPOINTS** are obsolete. Please use MAX_PUPIL_WIDTH and MIN_PUPIL_WIDTH instead. If 0 is set to **ROI_WIDTH** and **ROI_HEIGHT**, it will be overwritten by CAMERA_WDITH and CAMERA_HEIGHT (new in 0.12.0). Camera-specific parameters (OpenCV) --------------------------------------------- ===================== ============================================================== ========================= Parameter Description Adjustable at run-time ===================== ============================================================== ========================= CAMERA_ID This integer is passed to the constructor or CV::VideoCapture. NO Usually you need not write this parameter to the configuration file if you connect only one camera to your PC. If you have multiple cameras on your PC and SimpleGazeTracker does not use desirable camera, use this parameter to tell SimpleGazeTracker which camera should be used. **New in 0.5.1** USE_THREAD This parameter must be **0** or **1**. A saparate thread is NO used to capture image if the value is 1. Generally, using separate thread results in better performance: however, it will cause segmentation fault if your opencv library is not built with multithreading support. Set this value 0 if segmentation fault occurs. SLEEP_DURATION When USE_THREAD is 0, performance of SimpleGazeTracker NO may severely spoiled because captring camera image may lock process until capture is finished. In such a case, set SLEEP_DURATION to wait to capture image until a specified amount of time has elapsed. The Unit of the value is *milliseconds*. This value should be a bit smaller than inter-frame interval of the camera. For example, about 14-15 would work fine if your camera capture image at 60Hz (1000ms/60frames = 16.667ms). FRAME_RATE Set this value to cv::CAP_PROP_FPS using NO cv::VideoCapture::set. Frame rate of the camera is set to this value if it is configurable from cv::VideoCapture::set. EXPOSURE Set this value to cv::CAP_PROP_EXPOSURE using NO cv::VideoCapture::set. Exposure of the camera is set to this value if it is configurable from cv::VideoCapture::set. BRIGHTNESS Set this value to cv::CAP_PROP_BRIGHTNESS using NO cv::VideoCapture::set. Brightness of the camera is set to this value if it is configurable from cv::VideoCapture::set. CONTRAST Set this value to cv::CAP_PROP_CONTRAST using NO cv::VideoCapture::set. Contrast of the camera is set to this value if it is configurable from cv::VideoCapture::set. GAIN Set this value to cv::CAP_PROP_GAIN using NO cv::VideoCapture::set. Gain of the camera is set to this value if it is configurable from cv::VideoCapture::set. ===================== ============================================================== ========================= .. note:: - Image size (cv::CAP_PROP_FRAME_WIDTH and cv::CAP_PROP_FRAME_HEIGHT) are configured by CAMERA_WIDTH and CAMERA_HEIGHT. - Whether these parameters work correctly depends on camera unit. Probably it also depends on build options of OpenCV library. It is recommended to comment-out or delete unnecessary parameters because such options may cause unexpected effects. Camera-specific parameters (OptiTrack) --------------------------------------------- ===================== ============================================================== ========================= Parameter Description Adjustable at run-time ===================== ============================================================== ========================= FRAME_RATE Frame rate of the camera. NO EXPOSURE Exposure duration. YES INTENSITY (ONLY FOR V100R2) Intensity of built-in IR LED illumination. YES ===================== ============================================================== ========================= Camera-specific parameters (FlyCapture2) --------------------------------------------- ===================== ============================================================== ========================= Parameter Description Adjustable at run-time ===================== ============================================================== ========================= CAMERA_N Set camera ID (0=first device). NO OFFSET_X Set horizontal offset of ROI. NO OFFSET_Y Set vertical offset of ROI. NO FRAME_RATE Frame rate of the camera. NO SHUTTER Shutter duration in milliseconds. YES CAMERA_MODE Set camera mode. Only 0 (mode0) and 1 (mode1) are supported. NO *SimpleGazeTracker supports only Format7 mode and RAW8 pixcel format.* USE_THREAD This parameter must be **0** or **1**. A saparate thread is NO used to capture image if the value is 1. Generally, using separate thread results in better performance: however, it will cause segmentation fault if your opencv library is not built with multithreading support. Set this value 0 if segmentation fault occurs. SLEEP_DURATION When USE_THREAD is 0, performance of SimpleGazeTracker NO may severely spoiled because captring camera image may lock process until capture is finished. In such a case, set SLEEP_DURATION to wait to capture image until a specified amount of time has elapsed. The Unit of the value is *milliseconds*. This value should be a bit smaller than inter-frame interval of the camera. For example, about 14-15 would work fine if your camera capture image at 60Hz (1000ms/60frames = 16.667ms). BLUR_FILTER_SIZE Set size of Gaussian filter that is applied to camera image. NO If the value is smaller than 2, Filter is not applied. ===================== ============================================================== ========================= .. note:: Image size is configured by CAMERA_WIDTH and CAMERA_HEIGHT. Camera-specific parameters (Spinnaker) --------------------------------------------- ===================== ============================================================== ========================= Parameter Description ===================== ============================================================== ========================= CAMERA_N Set camera ID (0=first device). NO OFFSET_X Set horizontal offset for cropping. Size of cropped area is NO specified by CAMERA_WIDTH and CAMERA_HEIGHT in "Image" tab. OFFSET_Y Set vertical offset for cropping. Size of cropped area is NO specified by CAMERA_WIDTH and CAMERA_HEIGHT in "Image" tab. BINNING_SIZE Set binning mode. Specifying 2 results in 2x2 binning. NO Specify 1 not to use binning mode. FRAME_RATE Frame rate of the camera. NO EXPOSURE Exposure duration in microseconds. YES BLUR_FILTER_SIZE Set size of Gaussian filter that is applied to camera image. NO If the value is smaller than 2, Filter is not applied. ===================== ============================================================== ========================= .. note:: Image size is configured by CAMERA_WIDTH and CAMERA_HEIGHT.