Home > GVSToolbox > combineBothEyes.m

combineBothEyes

PURPOSE ^

combine gaze data from two eyes into one by averaging

SYNOPSIS ^

function eyePos = combineBothEyes( leftEyePos, rightEyePos )

DESCRIPTION ^

 combine gaze data from two eyes into one by averaging
 July 5, 2011
 Notes: combine the left and right eye track
 
 Syntax: eyePos = combineBothEyes( leftEyePos, rightEyePos )
 
 Input:
   leftEyePos: left eye tracking data, (Nx1) vector  of complex (x+i*y) 
       coordinates.  -1-i1 or nan-inan  to identify missing data.
   rightEyePos: just like for right eye track
 
 Output:
   eyePos: the mean eye track

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % combine gaze data from two eyes into one by averaging
0002 % July 5, 2011
0003 % Notes: combine the left and right eye track
0004 %
0005 % Syntax: eyePos = combineBothEyes( leftEyePos, rightEyePos )
0006 %
0007 % Input:
0008 %   leftEyePos: left eye tracking data, (Nx1) vector  of complex (x+i*y)
0009 %       coordinates.  -1-i1 or nan-inan  to identify missing data.
0010 %   rightEyePos: just like for right eye track
0011 %
0012 % Output:
0013 %   eyePos: the mean eye track
0014 
0015 function eyePos = combineBothEyes( leftEyePos, rightEyePos )
0016 
0017 % vector of all 1's
0018 leftKnown = ones( size( leftEyePos ));
0019 rightKnown = ones( size( leftEyePos )); 
0020 
0021 % make 0 if -1, or nan
0022 leftKnown( real(leftEyePos) == -1 ) = 0;
0023 leftKnown( isnan(real(leftEyePos))) = 0;   
0024 rightKnown( real(rightEyePos) == -1 ) = 0;
0025 rightKnown( isnan(real(rightEyePos))) = 0;
0026 known = find( leftKnown+rightKnown == 2); % both known
0027 
0028 eyePos = -1*ones( size(leftEyePos));
0029 eyePos( known ) = (leftEyePos(known) + rightEyePos(known))/2;
0030 
0031 
0032 
0033 
0034 
0035 
0036 
0037 
0038

Generated on Tue 01-Jul-2014 12:35:04 by m2html © 2005