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
注釈
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, SimpleGazeTracker runs at binocular recording mode. Otherwise, it runs at monocular recording mode. |
NO |
THRESHOLD |
This parameter affects detection of pupil. See Adjusting camera (monocular recording) for detal. |
YES |
MAX_PUPIL_WIDTH |
This parameter affects detection of pupil. See Adjusting camera (monocular recording) for detal. |
YES |
MIN_PUPIL_WIDTH |
This parameter affects detection of pupil. See Adjusting camera (monocular recording) for detal. |
YES |
PURKINJE_THRESHOLD |
This parameter affects detection of the first Purkinje image. See Adjusting camera (monocular recording) for detal. |
YES |
PURKINJE_SEARCHAREA |
This parameter affects detection of the first Purkinje image. See Adjusting camera (monocular recording) for detal. |
YES |
PURKINJE_EXCLUDEAREA |
This parameter affects detection of pupil center. See Adjusting camera (monocular recording) for detal. |
YES |
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 only from the region specified by this parameter and ROI_HEIGHT. See Setting region of interest (ROI) for detail. New in 0.5.1 / Renamed in 0.12.0 |
NO |
ROI_HEIGHT |
SimpleGazeTracker searches pupil and the first Purkinje image only from the region specified by this parameter and ROI_WIDTH. See Setting region of interest (ROI) for detail. New in 0.5.1 / Renamed in 0.12.0 |
NO |
SHOW_DETECTIONERROR_MSG |
This parameter must be 0 or 1. If the value is 1, Error message is overlaid on the camer apreview image if detection of pupil and the first Purkinje image is failed. See Adjusting camera (monocular recording) for detal. New in 0.5.1 |
NO |
PORT_SEND |
TCP/IP Port number for sending information to the Recorder PC.
This value must be the same to portRecv (not portSend)
parameter of
|
NO |
PORT_RECV |
TCP/IP Port number for receiving commands from the Recorder
PC. This value must be the same to portSend
(not portRecv) parameter of
|
NO |
DELAY_CORRECTION |
If delay in measuring gaze position is unacceptably long, 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 Delay from stimulus presentation to image capture for detail. New in 0.5.1 |
NO |
OUTPUT_PUPILSIZE |
This parameter must be 0 or 1. If the value is 1, pupil size (area of ellipse fitted to the pupil) is output to the data file. New in 0.5.3 |
NO |
USBIO_BOARD |
ID or name of USB-IO device. See USB I/O units (SimpleGazeTracker 0.7.0 or later) for detail. |
NO |
USBIO_AD |
Port and range of analog input channel(s). See USB I/O units (SimpleGazeTracker 0.7.0 or later) for detail. |
NO |
USBIO_DI |
Port of digital input. See USB I/O units (SimpleGazeTracker 0.7.0 or later) for detail. |
NO |
USB_USE_THREAD |
This parameter must be 0 or 1. A saparate thread is used to read analog/digital inputs from USB-IO device if the value is 1. Generally, using separate thread results in better performance. |
NO |
OPEN_SETUP_GUIDE |
This parameter must be 0 or 1. If this value is 1, 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 |
NO |
MORPH_TRANS |
Apply morphological transformation if this value is greater than 1 (closing) or smaller than -1 (opening). Absolute value of this parameter corresponds to kernel size of the transformation. |
YES |
注釈
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. 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 |
NO |
USE_THREAD |
This parameter must be 0 or 1. A saparate thread is 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. |
NO |
SLEEP_DURATION |
When USE_THREAD is 0, performance of SimpleGazeTracker 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). |
NO |
FRAME_RATE |
Set this value to cv::CAP_PROP_FPS using cv::VideoCapture::set. Frame rate of the camera is set to this value if it is configurable from cv::VideoCapture::set. |
NO |
EXPOSURE |
Set this value to cv::CAP_PROP_EXPOSURE using cv::VideoCapture::set. Exposure of the camera is set to this value if it is configurable from cv::VideoCapture::set. |
NO |
BRIGHTNESS |
Set this value to cv::CAP_PROP_BRIGHTNESS using cv::VideoCapture::set. Brightness of the camera is set to this value if it is configurable from cv::VideoCapture::set. |
NO |
CONTRAST |
Set this value to cv::CAP_PROP_CONTRAST using cv::VideoCapture::set. Contrast of the camera is set to this value if it is configurable from cv::VideoCapture::set. |
NO |
GAIN |
Set this value to cv::CAP_PROP_GAIN using cv::VideoCapture::set. Gain of the camera is set to this value if it is configurable from cv::VideoCapture::set. |
NO |
注釈
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. SimpleGazeTracker supports only Format7 mode and RAW8 pixcel format. |
NO |
USE_THREAD |
This parameter must be 0 or 1. A saparate thread is 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. |
NO |
SLEEP_DURATION |
When USE_THREAD is 0, performance of SimpleGazeTracker 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). |
NO |
BLUR_FILTER_SIZE |
Set size of Gaussian filter that is applied to camera image. If the value is smaller than 2, Filter is not applied. |
NO |
注釈
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 specified by CAMERA_WIDTH and CAMERA_HEIGHT in "Image" tab. |
NO |
OFFSET_Y |
Set vertical offset for cropping. Size of cropped area is specified by CAMERA_WIDTH and CAMERA_HEIGHT in "Image" tab. |
NO |
BINNING_SIZE |
Set binning mode. Specifying 2 results in 2x2 binning. Specify 1 not to use binning mode. |
NO |
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. If the value is smaller than 2, Filter is not applied. |
NO |
注釈
Image size is configured by CAMERA_WIDTH and CAMERA_HEIGHT.