From: A 2D eye gaze estimation system with low-resolution webcam images
LET S be the rectangular socket region consists of P number of pixels: S_{1} ... S_{ P } |
---|
LET A be a two-dimensional array of pixels |
LET O be the position of the template's origin |
LET AVG be the average intensity of socket region |
LET W be the deformable eyeball model involves N number of template windows: W_{ 1 } ... W_{ N } |
LET Z be the size of the template window |
LET L be the template window consists of Z number of pixels: L_{ 1 } ... L_{ Z } |
LET V be the index number of the window where window has the highest intensity variance between current index and previous index. |
LET WIDTH be the width of the input camera image |
LET alpha be the angle between windows |
LET cutOffRatio be the ratio determines the initial index with the highest variance |
in a window which is used for getting rid of eyebrows |
LET epsilon be the tolerance value for eyeball detection LET B be the index of vertex over the border of eyeball |
SET minIntensity TO 256.0f |
FOR EACH i = 1 TO P |
//Start of pixels |
IF BRIGHTNESS( S_{ i } ) <minIntensity THEN |
SET minIntensity TO BRIGHTNESS( S_{ i } ) |
SET O_{ x } TO POSITION( S_{ i } )--> x |
SET O_{ y } TO POSITION( S_{ i } )--> y |
END IF |
//End of pixels |
END LOOP |
SET alpha TO 0.0f |
SET integralIndices TO 0.0f |
SET integralBrightness TO 0.0f |
FOR EACH j = 1 TO N |
//Start of windows |
INCREASE alpha BY ( TWO_PI/ N ) |
SET maxVariance TO 0.0f |
SET maxAverageIntensity TO 0.0f |
FOR EACH k = Z TO 1 |
//Start of indices in windows |
SET point_x TO O_{ x }+ k * COS ( alpha ) |
SET point_y TO O_{ y }+ k * SIN ( alpha ) |
SET index TO point_y * WIDTH + point_x |
SET A[j,k] TO COLOR( S_{ index } ) |
SET variance TO ABS ( BRIGHTNESS( A[j,k] ) - BRIGHTNESS( A[j,k-1] ) ) |
SET V TO Integer.MAX_VALUE//highest possible value of an integer. |
END IF |
IF variance>maxVariance AND V>Z/cutOffRatio THEN |
SET maxVariance TO variance |
SET V TO k |
END IF |
END LOOP |
SET integralIntensity TO 0.0f |
FOR EACH l = V TO 1 //Integrate from the index with the highest variance to the origin's index |
INCREASE integralIntensity BY ( 255 - BRIGHTNESS( A[j, l] ) ) |
END LOOP |
SET averageIntensity TO ( integralIntensity/l) |
IF averageIntensity>maxAverageIntensity THEN |
SET maxAverageIntensity TO averageIntensity |
SET B TO V |
END IF |
//End of indices in windows |
END LOOP |
INCREASE integralIndices BY B; |
INCREASE integralBrightness BY BRIGHTNESS( A[j,B] ) |
IF integralIndices/j >epsilon AND integralBrightness /j <AVG THEN |
ADD B TO ARRAYLIST |
END IF |
//End of windows |
END LOOP |