资源简介
tobii眼动仪视觉追踪程序源码,MATLAB
代码片段和文件信息
%
% EyeTrackingSample
%
clc
clear all
close all
addpath(‘functions‘);
addpath(‘../tetio‘);
% *************************************************************************
%
% Initialization and connection to the Tobii Eye-tracker
%
% *************************************************************************
disp(‘Initializing tetio...‘);
tetio_init();
% Set to tracker ID to the product ID of the tracker you want to connect to.
trackerId = ‘NOTSET‘;
% FUNCTION “SEARCH FOR TRACKERS“ IF NOTSET
if (strcmp(trackerId ‘NOTSET‘))
warning(‘tetio_matlab:EyeTracking‘ ‘Variable trackerId has not been set.‘);
disp(‘Browsing for trackers...‘);
trackerinfo = tetio_getTrackers();
for i = 1:size(trackerinfo2)
disp(trackerinfo(i).ProductId);
end
tetio_cleanUp();
error(‘Error: the variable trackerId has not been set. Edit the EyeTrackingSample.m script and replace “NOTSET“ with your tracker id (should be in the list above) before running this script again.‘);
end
fprintf(‘Connecting to tracker “%s“...\n‘ trackerId);
tetio_connectTracker(trackerId)
currentframeRate = tetio_getframeRate;
fprintf(‘frame rate: %d Hz.\n‘ currentframeRate);
% *************************************************************************
%
% Calibration of a participant
%
% *************************************************************************
SetCalibParams;
disp(‘Starting TrackStatus‘);
% Display the track status window showing the participant‘s eyes (to position the participant).
TrackStatus; % Track status window will stay open until user key press.
disp(‘TrackStatus stopped‘);
disp(‘Starting Calibration workflow‘);
% Perform calibration
HandleCalibWorkflow(Calib);
disp(‘Calibration workflow stopped‘);
% *************************************************************************
%
% Display a stimulus
%
% For the demo this simply reads and display an image.
% Any method for generation and display of stimuli availble to Matlab could
% be inserted here for example using Psychtoolbox or Cogent.
%
% *************************************************************************
close all;
X = imread(‘TobiiDots.jpg‘);
img=X; % Remove
figure(‘menuBar‘ ‘none‘ ‘name‘ ‘Image Display‘ ‘keypressfcn‘ ‘close;‘);
image(img);
axis equal;
axes(‘Visible‘ ‘off‘ ‘Units‘ ‘normalized‘...
‘Position‘ [0 0 1 1]...
‘DrawMode‘‘fast‘...
‘NextPlot‘‘replacechildren‘);
Calib.mondims = Calib.mondims1;
set(gcf‘position‘ [Calib.mondims.x Calib.mondims.y Calib.mondims.width Calib.mondims.height]);
xlim([1Calib.mondims.width]); ylim([1Calib.mondims.height]);axis ij;
set(gca‘xtick‘[]);set(gca‘ytick‘[]);
htext1 = text(double(0.5*Calib.mondims.width) double(0.5*Calib.mondims.height)...
‘Focus on any area of the image and we will tell you where you were looking‘...
‘HorizontalAlignment‘‘center‘...
‘BackgroundColor‘[.7 .9 .7]...
‘FontSize‘18);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4031 2013-05-22 11:01 Matlab\EyeTrackingSample\EyeTrackingSample.m
文件 3931 2013-05-22 11:01 Matlab\EyeTrackingSample\functions\Calibrate.m
文件 1133 2013-05-22 11:01 Matlab\EyeTrackingSample\functions\DataCollect.m
文件 703 2013-05-22 11:01 Matlab\EyeTrackingSample\functions\DisplayData.m
文件 1014 2013-05-22 11:01 Matlab\EyeTrackingSample\functions\Drawline.m
文件 1810 2013-05-22 11:01 Matlab\EyeTrackingSample\functions\HandleCalibWorkflow.m
文件 1819 2013-05-22 11:01 Matlab\EyeTrackingSample\functions\ParseGazeData.m
文件 4038 2013-05-22 11:01 Matlab\EyeTrackingSample\functions\PlotCalibrationPoints.m
文件 2788 2013-05-22 11:01 Matlab\EyeTrackingSample\functions\TrackStatus.m
文件 1029 2013-05-22 11:01 Matlab\EyeTrackingSample\SetCalibParams.m
文件 50006 2013-05-22 11:01 Matlab\EyeTrackingSample\tobiiDots.jpg
文件 3917824 2013-05-22 11:11 Matlab\tetio\tetio.dll
文件 85 2013-05-22 11:01 Matlab\tetio\tetio_addCalibPoint.m
文件 64 2013-05-22 11:01 Matlab\tetio\tetio_cleanUp.m
文件 70 2013-05-22 11:01 Matlab\tetio\tetio_clearCalib.m
文件 94 2013-05-22 11:01 Matlab\tetio\tetio_clockSyncState.m
文件 74 2013-05-22 11:01 Matlab\tetio\tetio_computeCalib.m
文件 82 2013-05-22 11:01 Matlab\tetio\tetio_connectTracker.m
文件 84 2013-05-22 11:01 Matlab\tetio\tetio_disconnectTracker.m
文件 112 2013-05-22 11:01 Matlab\tetio\tetio_enumeratefr
文件 100 2013-05-22 11:01 Matlab\tetio\tetio_getCalibPlotData.m
文件 88 2013-05-22 11:01 Matlab\tetio\tetio_getfr
文件 94 2013-05-22 11:01 Matlab\tetio\tetio_getTrackers.m
文件 58 2013-05-22 11:01 Matlab\tetio\tetio_init.m
文件 116 2013-05-22 11:01 Matlab\tetio\tetio_localClockResolution.m
文件 86 2013-05-22 11:01 Matlab\tetio\tetio_localTimeNow.m
文件 118 2013-05-22 11:01 Matlab\tetio\tetio_localToRemoteTime.m
文件 500736 2013-05-22 11:35 Matlab\tetio\tetio_matlab.mexw64
文件 164 2013-05-22 11:01 Matlab\tetio\tetio_readGazeData.m
文件 119 2013-05-22 11:01 Matlab\tetio\tetio_remoteToLocalTime.m
............此处省略13个文件信息
- 上一篇:ADMM工具包
- 下一篇:AF、DF协议的MATLAB仿真
评论
共有 条评论