Skip to main content

API Docs (Java)

GazeTracker#

public class GazeTracker

GazeTracker is the class that generates gaze tracking data from the video from the device's front camera.

Construction#

initGazeTracker#

public static void initGazeTracker(Context context, GazeDevice gazeDevice, String key, InitializationCallback callback)

GazeTracker constructing process includes authentication.

The Function is asynchronous.

The created GazeTracker instance is delivered through InitializationCallback.

  • parameter

    • context

      • type: android.content.Context
    • gazeDevice

      • type: GazeDevice
      • description: GazeDevice Class
    • license

      • type: String
      • description: Key generated from SeeSo Console.
    • callback

      • type: InitializationCallback
      • description: InitializationCallback
  • return: void

  • usage:

      // Implement InitializationCallback  InitializationCallback initializationCallback = new InitializationCallback() {    @Override    public void onInitialized(GazeTracker gazeTracker, InitializationErrorType error) {        if (gazeTracker != null) {            // gazeTracker init success        } else {            // gazeTracker init fail        }    }  };    GazeTracker.initGazeTracker(context, new GazeDevice(), "YOUR_LICENSE_KEY", initializationCallback);

initGazeTracker with User Status Options#

public static void initGazeTracker(Context context, GazeDevice gazeDevice, String key, InitializationCallback callback, UserStatusOption option)

GazeTracker constructing process includes authentication.

The Function is asynchronous.

The created GazeTracker instance is delivered through InitializationCallback.

To use this initGazeTracker and User Status in your production environment, please contact to the SeeSo team.

  • parameter

    • context

      • type: android.content.Context
    • gazeDevice

      • type: GazeDevice
      • description: GazeDevice Class
    • license

      • type: String
      • description: Key generated from SeeSo Console
    • callback

      • type: InitializationCallback
      • description: InitializationCallback
    • option

      • type: UserStatusOption
      • description: A class containing User status option information
  • return: void

  • usage:

      // Implement InitializationCallback  InitializationCallback initializationCallback = new InitializationCallback() {    @Override    public void onInitialized(GazeTracker gazeTracker, InitializationErrorType error) {        if (gazeTracker != null) {            // gazeTracker init success        } else {            // gazeTracker init fail        }    }  };
      UserStatusOption userStatusOption = new UserStatusOption();
      if (isStatusAttention) {    userStatusOption.useAttention();  }  if (isStatusBlink) {    userStatusOption.useBlink();  }  if (isStatusDrowsiness) {    userStatusOption.useDrowsiness();  } 
      GazeTracker.initGazeTracker(context, new GazeDevice(), "YOUR_LICENSE_KEY", initializationCallback, userStatusOption);

Destruction#

deinitGazeTracker#

 public static void deinitGazeTracker(GazeTracker gazeTracker)

After deinitGazeTracker, every API will be disabled.

For memory optimization, assigning null to the destructed object is recommended.

  • parameter

    • gazeTracker

      • type: GazeTracker
      • description: Instance of GazeTracker Class.
  • return: void

  • usage:

      // Implement InitializationCallback  InitializationCallback initializationCallback = new InitializationCallback() {    @Override      public void onInitialized(GazeTracker gazeTracker, InitializationErrorType error) {        if (gazeTracker != null) {          // gazeTracker init success
              // you can deinit gazeTracker instance          GazeTracker.deinitGazeTracker(gazeTracker);           gazeTracker = null;
            } else {          // gazeTracker init fail        }      }    };        GazeTracker.initGazeTracker(context, new GazeDevice(), "YOUR_LICENSE_KEY", initializationCallback);

Gaze Tracking#

startTracking#

public void startTracking()

This is the function that should be called before starting gaze tracking.

On successful start, the onStarted() callback is called.

  • parameter: X

  • return: void

  • usage:

      private InitializationCallback initializationCallback = new InitializationCallback() {    @Override      public void onInitialized(GazeTracker gazeTracker, InitializationErrorType error) {        if (gazeTracker != null) {          // gazeTracker init success
              // set StatusCallback          gazeTracker.setCallbacks(statusCallback);
              // startTracking          gazeTracker.startTracking();
            } else {          // gazeTracker init fail        }    }  };
      private StatusCallback statusCallback = new StatusCallback() {    @Override    public void onStarted() {      // gazeTracker.startTracking() Success    }
        @Override    public void onStopped(final StatusErrorType error) {     // gazeTracker.startTracking() Fail    }  };      GazeTracker.initGazeTracker(context, new GazeDevice(), "YOUR_LICENSE_KEY", initializationCallback);

stopTracking#

public void stopTracking()

This function is called to stop gaze tracking.

On successful stop, the onStop() callback is called.

  • parameter: X

  • return: void

  • usage:

      // Implement StatusCallback and already set callback to gazeTracker  private StatusCallback statusCallback = new StatusCallback() {    @Override    public void onStarted() {
        }      @Override    public void onStopped(final StatusErrorType error) {      // gazeTracker.stopTracking() Success    }  };
      gazeTracker.stopTracking();      

isTracking#

public boolean isTracking()

This function represents the status of gaze tracking. It returns true when gaze tracking is working, false when gaze tracking is stopped.

  • parameter: X

  • return: boolean

  • usage:

      boolean isTracking = gazeTracker.isTracking();  System.out.println("Tracking state : " + isTracking);

isCalibrating#

public boolean isCalibrating()

It returns true when calibrating, false when when not calibrating.

  • parameter: X

  • return: boolean

  • usage:

      boolean isCalibrating = gazeTracker.isCalibrating();  System.out.println("isCalibrating : " + isCalibrating);

setTrackingFPS#

public boolean setTrackingFPS(int fps)

The parameter that sets the FPS of the gaze tracking source.

Its value should bigger than 0 and no more than 30.

FPS can be dropped due to device spec. The default value is 30.

  • parameter

    • fps

      • type: int
      • description: Custom FPS(Frame Per Second) for gaze tracking
  • return: boolean

  • usage:

      gazeTracker.setTrackingFPS(20);

UserStatus Setting#

setAttentionInterval#

 public void setAttentionInterval(int interval)

Set time interval for the UserStatus Attention callback.

The UserStatus Attention score will be calculated for the given time interval.

The beginning and ending timestamps are passed through the onAttention callback as timestampBegin and timestampEnd.

The interval range is 10 to 60 (seconds), and the default value is 30 seconds.

  • parameter

    • interval

      • type: int
      • description: Time interval for the UserStatus Attention score.
  • return: void

  • usage:

      private InitializationCallback initializationCallback = new InitializationCallback() {    @Override      public void onInitialized(GazeTracker gazeTracker, InitializationErrorType error) {        if (gazeTracker != null) {          // gazeTracker init success
              // set StatusCallback          gazeTracker.setCallbacks(statusCallback);
              // set UserStatus Attention Interval          gazeTracker.setAttentionInterval(30);          } else {          // gazeTracker init fail        }    }  };

Get UserStatus Data#

getAttentionScore#

 public float getAttentionScore()

Get current Attention score from the GazeTracker.

This API does not provide timestamp of the Attention score data.

Use onAttention callback, unless the Attention score is required at a specific time/location.

  • parameter: X

  • return: float

  • usage:

      float currentAttention = gazeTracker.getAttentionScore();     

Calibration#

startCalibration#

public boolean startCalibration(CalibrationModeType mode, AccuracyCriteria criteria, float left, float top, float right, float bottom)public boolean startCalibration(CalibrationModeType mode, float left, float top, float right, float bottom)public boolean startCalibration(CalibrationModeType mode)public boolean startCalibration(float left, float top, float right, float bottom)public boolean startCalibration(AccuracyCriteria criteria)public boolean startCalibration(CalibrationModeType mode, AccuracyCriteria criteria)public boolean startCalibration()

It returns true when parameters are valid.

It also returns false when the calibration region has been set outside of the device screen.

The false return will block the calibration process.

  • parameter:

    • mode

      • type: CalibrationModeType
      • description: Can select the calibration option. DEFAULT(=FIVE_POINT), ONE_POINT, FIVE_POINT, SIX_POINT.
      • default: DEFAULT
    • left,top,right,bottom

      • type: float
      • description: Region that needs calibration. The unit is px.
      • default: 80% region of device screen.
    • criteria

      • type: AccuracyCriteria
      • description: Option that manage calibration process and accuracy. Three options - DEFAULT, LOW, HIGH - are available. Default is DEFAULT.
      • default: DEFAULT
  • return: boolean

  • usage:

      //implement calibrationCallback  private CalibrationCallback calibrationCallback = new TimeoutCalibrationCallback() {    @Override  public void onCalibrationProgress(final float progress) {    runOnUiThread(new Runnable() {      @Override      public void run() {        // process calibration point UI      }    });  }    @Override  public void onCalibrationNextPoint(final float x, final float y) {    runOnUiThread(new Runnable() {      @Override      public void run() {        // draw calibration point to (x,y)      }    });    handler.postDelayed(new Runnable() {      @Override      public void run() {        // After drawing the calibration point,         // call startCollectSamples after enough time (1,000 ms in this example) that considering user can recognize the point        gaze.startCollectSamples();      }    }, 1000);  }    @Override  public void onCalibrationFinished(double[] calibrationData) {    // saveCalibration(calibrationData);    runOnUiThread(      new Runnable() {        @Override        public void run() {          //remove calibration UI        }      });    }  };
      gazeTracker.setCalibrationCallback(calibrationCallback);
      boolean startedResult = gazeTracker.startCabliration(CalibrationModeType.ONE_POINT,100, 100, 1000, 1200);  boolean startedResult = gazeTracker.startCabliration(CalibrationModeType.ONE_POINT);  boolean startedResult = gazeTracker.startCabliration(100, 100, 1000, 1200);  boolean startedResult = gazeTracker.startCabliration();

stopCalibration#

public void stopCalibration()

This will stop calibration.

  • parameter: X

  • return: void

  • usage:

      gazeTracker.stopCalibration();

startCollectSamples#

public boolean startCollectSamples()

This relays the coordinates of the point that should be seen when calibration is in progress at the function: CalibrationCallback.onCalibrationNextPoint.

You should display coordinates on the screen and call startCollectSamples for calibration.

  • parameter: X

  • return: bool

  • usage:

      gazeTracker.startCollectSamples();

setCalibrationData#

public boolean setCalibrationData(double[] calibrationData)

Set existing calibration data to gazeTracker.

  • parameter:

    • calibrationData

      • type: double[]
      • description: Calibration Data
  • return: boolean

  • usage:

      //implement calibrationCallback  private CalibrationCallback calibrationCallback = new TimeoutCalibrationCallback() {
        @Override    public void onCalibrationFinished(double[] calibrationData) {      // After calibration is finished, the data is automatically reflected in the current gazeTracker instance.       // You can save it and apply the saved value to the new gazeTracker instance when you restart the app later.      // savedCalibrationData = calibrationData;    }  };
      gazeTracker.setCalibrationData(savedCalibrationData);

CameraPreview#

setCameraPreview#

public void setCameraPreview(android.view.TextureView cameraPreview)
  • parameter

    • cameraPreview

      • type: android.view.TextureView
      • description: TextureView for camera preview
  • return: void

  • usage:

      TextureView preview = findViewById(R.id.preview);  gazeTracker.setCameraPreview(preview);

removeCameraPreview#

public void removeCameraPreview()

Remove camera preview set on the gazeTracker instance.

  • parameter: X

  • return: void

  • usage:

      gazeTracker.removeCameraPreview();

Callback assistants#

setCallbacks#

public void setCallbacks(GazeTrackerCallback callback...)

Set GazeTrackerCallback implementations to gazeTracker.

  • parameter

    • callback

      • type: GazeTrackerCallback
      • description: Callbacks implementation of the GazeTrackerCallback.
  • return: void

  • usage:

      //implement statusCallback, gazeCallback, imageCallback, calibrationCallback, userStatusCallback  gazeTracker.setCallbacks(statusCallback, gazeCallback, imageCallback, calibrationCallback, userStatusCallback);

setStatusCallback#

public void setStatusCallback(StatusCallback callback)

Set StatusCallback implementations to gazeTracker.

  • parameter

    • callback

      • type: StatusCallback
      • description: Callback implementation of the StatusCallback.
  • return: void

  • usage:

      //implement statusCallback  gazeTracker.setStatusCallback(statusCallback);

removeStatusCallback#

public void removeStatusCallback()

Remove all StatusCallback implementations set in gazeTracker.

  • parameter: X

  • return: void

  • usage:

      gazeTracker.removeStatusCallback();

setGazeCallback#

public void setGazeCallback(GazeCallback callback)

Set GazeCallback implementations to gazeTracker.

  • parameter

    • callback

      • type: GazeCallback
      • description: Callback implementation of the GazeCallback.
  • return: void

  • usage:

      //implement gazeCallback  private GazeCallback gazeCallback = new GazeCallback() {    @Override    public void onGaze(final GazeInfo gazeInfo) {
        }            };
      gazeTracker.setGazeCallback(gazeCallback);

removeGazeCallback#

public void removeGazeCallback()

Remove all GazeCallback implementations set in gazeTracker

  • parameter: X

  • return: void

  • usage:

      gazeTracker.removeGazeCallback();

setCalibrationCallback#

public void setCalibrationCallback(CalibrationCallback callback)

Set CalibrationCallback implementations to gazeTracker.

  • parameter:

    • callback

      • type: CalibrationCallback
      • description: Callbacks implementation of the CalibrationCallback.
  • return: void

  • usage:

      //implement calibrationCallback  private CalibrationCallback calibrationCallback = new TimeoutCalibrationCallback() {
      @Override  public void onCalibrationProgress(final float progress) {    runOnUiThread(new Runnable() {      @Override      public void run() {        // process calibration point UI      }    });  }
      @Override  public void onCalibrationNextPoint(final float x, final float y) {    runOnUiThread(new Runnable() {      @Override      public void run() {        // draw calibration point to (x,y)      }    });    handler.postDelayed(new Runnable() {      @Override      public void run() {        // After drawing the calibration point,         // call startCollectSamples after enough time (1,000 ms in this example) that considering user can recognize the point        boolean isStart = gaze.startCollectSamples();      }    }, 1000);  }
      @Override  public void onCalibrationFinished(double[] calibrationData) {    // saveCalibration(calibrationData);    runOnUiThread(      new Runnable() {        @Override        public void run() {          //remove calibration UI        }      });    }  };
      gazeTracker.setCalibrationCallback(calibrationCallback);

removeCalibrationCallback#

public void removeCalibrationCallback()

Remove all CalibrationCallback implementations set in gazeTracker.

  • parameter: X

  • return: void

  • usage:

      gazeTracker.removeCalibrationCallback();

setUserStatusCallback#

public void setUserStatusCallback(UserStatusCallback callback)

Set UserStatusCallback implementations to gazeTracker.

  • parameter

    • callback

      • type: UserStatusCallback
      • description: Callback implementation of the UserStatusCallback.
  • return: void

  • usage:

      //implement gazeCallback  private UserStatusCallback userStatusCallback = new UserStatusCallback() {    @Override    public void onAttention(final long timestampBegin, final long timestampEnd, final float score) {
        }
        @Override    public void onDrowsiness(final long timestamp, final boolean isDrowsiness) {
        }
        @Override    public void onBlink(final long timestamp, final boolean isBlinkLeft, final boolean isBlinkRight, final boolean isBlink, final float eyeOpenness) {
        }  };
      gazeTracker.setUserStatusCallback(userStatusCallback);

removeUserStatusCallback#

public void removeUserStatusCallback()

Remove all UserStatusCallback implementations set in gazeTracker

  • parameter: X

  • return: void

  • usage:

      gazeTracker.removeUserStatusCallback();

setImageCallback#

public void setImageCallback(ImageCallback callback)

Set ImageCallback implementations to gazeTracker.

  • parameter:

    • callback

      • type: ImageCallback
      • description: Callbacks implementation of the ImageCallback.
  • return: void

  • usage:

      //implement imageCallback  private ImageCallback imageCallback = new ImageCallback() {    @Override    public void onImage(long timestamp, final byte[] buffer) {      uiHandler.post(new Runnable() {        @Override        public void run() {          ByteArrayOutputStream out = new ByteArrayOutputStream();          YuvImage yuvImage = new YuvImage(buffer, ImageFormat.NV21, 640, 480, null);          yuvImage.compressToJpeg(new Rect(0, 0, 640, 480), 50, out);          byte[] imageBytes = out.toByteArray();          Bitmap image = BitmapFactory.decodeByteArray(imageBytes, 0, imageBytes.length);          imgBuffer.setImageBitmap(image);        }      });    }  };
      gazeTracker.setImageCallback(imageCallback);

removeImageCallback#

public void removeImageCallback()

Remove all ImageCallback implementations set in gazeTracker.

  • parameter: X

  • return: void

  • usage:

      gazeTracker.removeImageCallback();

Version Check#

getVersionName#

public static String getVersionName()

Returns SeeSo SDK version.

  • parameter: X

  • return: String

  • usage:

      String version = GazeTracker.getVersionName();  System.out.println("SeeSo version :" + version);

InitializationCallback#

public interface InitailizationCallback

onInitialized#

public void onInitailzed(GazeTracker tracker, InitializationErrorType error);

This is callback function being called when GazeTracker.initGazeTracker function has been called.

Please read : Authentication for more details.

  • parameter:

    • tracker

      • type: GazeTracker
    • error

      • type : InitializationErrorType
  • return: void

  • implementation:

      public void onInitialized(GazeTracker tracker, InitializationErrorType error){    if (tracker != null){      this.tracker = tracker;    }else{      switch (error) {        case InitializationErrorType.ERROR_NONE:          break;        case InitializationErrorType.ERROR_INIT:          break;                ...      }    }       }

GazeTrackerCallback#

public interface GazeTrackerCallback

StatusCallback#

public interface StatusCallback extends GazeTrackerCallback

onStarted#

public void onStarted()

The function that automatically calls after startTracking() of GazeTracker object succeeds. Calibration is available after this.

  • parameter: X

  • return: void

  • implementation:

    public void onStarted(){   gazeTracker.startCalibration();}

onStopped#

public void onStopped(StatusErrorType error)
  • parameter:

    • error
      • description: StatusErrorType.ERROR_NONE, StatusErrorType.ERROR_CAMERA_START, StatusErrorType.ERROR_CAMERA_INTERRUPT are available.
  • return: void

  • implementation:

    public void onStopped(StatusErrorType error) {    if (error != StatusCallback.ERROR_NONE) {    // onStopped with error    }    else{    // onStopped without error    }}

GazeCallback#

public interface GazeCallback extends GazeTrackerCallback

onGaze#

public void onGaze(GazeInfo gazeInfo)
  • parameter:

    • gazeInfo

      • type: GazeInfo
  • return: void

  • implementation:

    private GazeCallback gazeCallback = new GazeCallback() {    @Override    public void onGaze(final GazeInfo gazeInfo) {
        }          };
    gazeTracker.setCallbacks(gazeCallback);
    

CalibrationCallback#

public interface CalibrationCallback extends GazeTrackerCallback

onCalibrationNextPoint#

public void onCalibrationNextPoint(float x, float y)

The x, y coordinate value of the gaze point that should be focused on during the calibration process.

Also, a proper UI should be on screen for notify the calibration target point.

You should call startCollectSamples to process the calibration.

  • parameter:

    • x, y

      • type: float
      • description: The x, y coordinate value of the gaze point that should be focused on during the calibration process. Origin is the device screen. The unit is pixel(px).
  • return: void

  • implementation:

    public void onCalibrationNextPoint(float x, float y){
      // Draw Calibration Point(x,y) in view.
      // than call startCollectSamples to proceed calibration.  gazeTracker.startCollectSamples();}

onCalibrationProgress#

public void onCalibrationProgress(float progress)

This is callback that represent the calibration progression. The value will be between 0.0~1.0.

The value start increases when startCollectSamples function executed.

*For UX, visualize the calibration progression with proper UI is recommended.

  • parameter

    • progress

      • type: float
      • description: Calibration progression for each point.
  • return: void

  • implementation:

    public void onCalibrationProgress(float progress){ // It is recommended to make appropriate changes to the calibration point ui according to progress.}

onCalibrationFinished#

public void onCalibrationFinished(double[] calibrationData)

This is callback function that notify when all calibration step finished.

The calibrationData passed as a parameter has already been applied to GazeTracker,

and you can save it and load the this calibration data directly into GazeTracker without new calibration by calling setCalibrationData(calibrationData) when restarting the app etc..

  • parameter:

    • calibrationData

      • type: double[]
      • description: Calibration Data
  • return: void

  • implementation:

      public void onCalibrationFinished(double[] calibrationData) {    // remove calibration UI, save calibration data    removeCalibrationUI();    saveCalibrationToSharedPreference(calibrationData);  } 

UserStatusCallback#

public interface UserStatusCallback extends GazeTrackerCallback

The User Status includes Attention, Drowsiness, and Blink.

Attention: How much the user attention is focused on the screen content for interval time (0.0 ~ 1.0)

  • Timestamp range of the data will be passed as timestampBegin and timestampEnd in onAttention callback.
  • The default time interval is 30 seconds.
  • If the user attention level is low, score in onAttention callback will be closed to 0.0.
  • If the user attention level is high, score in onAttention callback will be closed to 1.0.

Drowsiness: If the user feel drowsiness (True/False)

  • Timestamp of the data will be passed as timestamp in onDrowsiness callback.
  • If the user feel Drowsiness, isDrowsiness in onDrowsiness callback will be true.
  • Otherwise, isDrowsiness will be false.

Blink: If the user blink eyes (left eye, right eye, general(both eyes))

  • Timestamp of the data will be passed as timestamp in onBlink callback.
  • If the user blink left eye, isBlinkLeft in onBlink callback will be true.
  • If the user blink right eye, isBlinkRight in onBlink callback will be true.
  • If the user blink eyes, isBlink in onBlink callback will be true (This is a general blink condition).
  • If the user's eyes are wide, eyeOpenness in onBlink callback will be closed to 1.0 (not available yet).
  • If the user's eyes are narrow, eyeOpenness in onBlink callback will be closed to 0.0 (not available yet).

onAttention#

public void onAttention(long timestampBegin, long timestampEnd, float score)
  • parameter:

    • timestampBegin

      • type: long
      • description: Beginning Timestamp of the data.
    • timestampEnd

      • type: long
      • description: Ending Timestamp of the data.
    • score

      • type: float
      • description: User Attention rate score between the timestamps.
  • return: void

  • implementation:

    private UserStatusCallback userStatusCallback = new UserStatusCallback() {    @Override    public void onAttention(final long timestampBegin, final long timestampEnd, final float score) {
        }};
    gazeTracker.setUserStatusCallback(userStatusCallback);

onDrowsiness#

public void onDrowsiness(long timestamp, boolean isDrowsiness)
  • parameter:

    • timestamp

      • type: long
      • description: Timestamp of the data.
    • isDrowsiness

      • type: boolean
      • description: User Drowsiness flag.
  • return: void

  • implementation:

    private UserStatusCallback userStatusCallback = new UserStatusCallback() {    @Override    public void onDrowsiness(final long timestamp, final boolean isDrowsiness) {
        }};
    gazeTracker.setUserStatusCallback(userStatusCallback);
    

onBlink#

public void onBlink(long timestamp, boolean isBlinkLeft, boolean isBlinkRight, boolean isBlink, float eyeOpenness)
  • parameter:

    • timestamp

      • type: long
      • description: Timestamp of the data.
    • isBlinkLeft

      • type: boolean
      • description: User Left Blink flag.
    • isBlinkRight

      • type: boolean
      • description: User Right Blink flag.
    • isBlink

      • type: boolean
      • description: User Blink flag.
    • eyeOpenness

      • type: float
      • description: User EyeOpenness rate (not available yet).
  • return: void

  • implementation:

    private UserStatusCallback userStatusCallback = new UserStatusCallback() {    @Override    public void onBlink(final long timestamp, final boolean isBlinkLeft, final boolean isBlinkRight, final boolean isBlink, final float eyeOpenness) {
        }};
    gazeTracker.setUserStatusCallback(userStatusCallback);
    

ImageCallback#

public interface ImageCallback extends GazeTrackerCallback

onImage#

public void onImage(long timestamp, byte[] image)
  • parameter:

    • timestamp

      • type: long
      • description: Timestamp of the image. The unit is millisecond. The time format is UTC. format is YUV(NV21), width = 640, height = 480
    • image

      • type: byte[]
      • description: byte[] of image.
  • return: void

  • implementation:

    public void onImage(long timestamp, byte[] image){        try {            File file = new File(yourJpgFilePath);            FileOutputStream out = new FileOutputStream(file);            YuvImage yuvImage = new YuvImage(image, ImageFormat.NV21, 640, 480, null);            yuvImage.compressToJpeg(new Rect(0, 0, 640, 480), 50, out);            out.flush();            out.close();        } catch (IOException e) {            e.printStackTrace();        }    }

ENUM#

InitializationErrorType#

public enum InitializationErrorType

The Enum that contains error types of InitializationCallback

Please read : Authentication for more details.

StatusErrorType#

public enum StatusErrorType

The Enum that contains error types of StatusCallback

  • Enum

    • ERROR_NONE

      • description: Succeed without error.
    • ERROR_CAMERA_START

      • description: Error code occurs when GazeTracker.startTracking is called but front camera of device is not available.
    • ERROR_CAMERA_INTERRUPT

      • description: Error code occurs when the camera stream disturbed(i.e. used by other applications) or the application running at the background.

TrackingState#

public enum TrackingState

The Enum that contains tracking state types of GazeInfo

  • Enum

    • SUCCESS
      • description: Face alignment is in a best position (Gaze tracking success, with valid x and y).
    • LOW_CONFIDENCE
      • description: Face alignment is not in the best position, but can be used for tracking (Gaze tracking success, with less accurate x and y).
    • UNSUPPORTED
      • description: Face alignment is not suitable for tracking (Gaze tracking fail, with invalid x and y).
    • FACE_MISSING
      • description: Face is missing (Gaze tracking fail).

CalibrationModeType#

public enum CalibrationModeType

The Enum that contains calibration mode types of startCalibartion

  • Enum

    • DEFAULT

      • description: Set to the recommended mode. In the current version, Five-point calibration mode
    • ONE_POINT

      • description: One-point calibration mode
    • FIVE_POINT

      • description: Five-point calibration mode
    • SIX_POINT

      • description: Six-point calibration mode

AccuracyCriteria#

 public enum AccuracyCriteria

The Enum that contains accuracy criteria of startCalibartion

  • Enum

    • DEFAULT

      • description: Default calibration accuracy criteria.
    • LOW

      • description: Low calibration accuracy criteria.
    • HIGH

      • description: High calibration accuracy criteria.

EyeMovementState#

public enum EyeMovementState

The Enum that contains eye movement state types using at GazeInfo

  • Enum

    • FIXATION
    • SACCADE
    • UNKNOWN

ScreenState#

public enum ScreenState

The Enum that contains screen state types using at GazeInfo

  • Enum

    • INSIDE_OF_SCREEN

      • description: Gaze tracking is success and the gaze point is inside of device screen
    • OUTSIDE_OF_SCREEN

      • description: Gaze tracking is success and the gaze point is outside of device screen
    • UNKNOWN

      • description: Gaze tracking is fail

Class#

UserStatusOption#

public class UserStatusOption

The class contains User Status options information for GazeTracker

  • functions:

    • isUseAttention

      • parameter: x
      • return: boolean
      • description: Return true if Attention flag is on, otherwise return false.
    • isUseBlink

      • parameter: x
      • return: boolean
      • description: Return true if Blink flag is on, otherwise return false.
    • isUseDrowsiness

      • parameter: x
      • return: boolean
      • description: Return true if Drowsiness flag is on, otherwise return false.
    • useAttention

      • parameter: x
      • return: void
      • description: Set Attention flag.
    • useBlink

      • parameter: x
      • return: void
      • description: Set Blink flag.
    • useDrowsiness

      • parameter: x
      • return: void
      • description: Set Drowsiness flag.
    • useAll

      • parameter: x
      • return: void
      • description: Set All User Status flag.

GazeInfo#

public class GazeInfo {  public long timestamp;  public float x, y;  public TrackingState trackingState;  public EyeMovementState eyeMovementState;  public ScreenState screenState;}
  • variables:

    • timestamp

      • type: long
      • description: Timestamp of gaze point. The unit is millisecond. The time format is UTC.
    • x, y

      • type: float
      • description: x, y coordinate value of gaze point. Origin is device screen. The unit is pixel(px).
    • trackingState

      • type: TrackingState
      • description: SUCCESS, LOW_CONFIDENCE, UNSUPPORTED, FACE_MISSING
    • eyeMovementState

      • type: EyeMovementState
      • description: FIXATION, SACCADE, UNKNOWN
    • screenState

      • type: ScreenState
      • description: INSIDE_OF_SCREEN, OUTSIDE_OF_SCREEN, UNKNOWN

GazeDevice#

public class GazeDevice

This class manages the information of the screen origin for the camera to be set in GazeTracker.

Basically, it has information about the origin of the screen of several devices.

isCurrentDeviceFound#

public boolean isCurrentDeviceFound()
  • parameter: x

  • return: boolean

  • implementation:

    GazeDevice gazeDevice = new GazeDevice();boolean isFound = gazeDevice.isCurrentDeviceFound();System.out.println("isCurrentDeviceFound " + isFound);

addDeviceInfo#

public void addDeviceInfo(String modelName, float screen_origin_x, float screen_origin_y)
  • parameter:

    • modelName

      • type: String
      • description: Model name of device.
    • screen_origin_x

      • type: float
      • description: screen origin x
    • screen_origin_y

      • type: float
      • description: screen origin y
  • return: void

  • implementation:

    GazeDevice gazeDevice = new GazeDevice();gazeDevice.addDeviceInfo("SM-T720", -72f, -4f); // tab s5e

getCurrentDeviceInfo#

public GazeDevice.Info getCurrentDeviceInfo()
  • parameter: x

  • return: GazeDevice.Info

  • implementation:

    GazeDevice.Info info = gazeDevice.getCurrentDeviceInfo();System.out.println("info " + info.modelName + info.screen_origin_x + "x" + info.screen_origin_y);

getAvailableDevices#

public GazeDevice.Info[] getAvailableDevices()
  • parameter: x

  • return: GazeDevice.Info[]

  • implementation:

    GazeDevice.Info[] infos = gazeDevice.getAvailableDevices();for (GazeDevice.Info info : infos) {        System.out.println("info " + info.modelName + " : " + info.screen_origin_x + "x" + info.screen_origin_y);}

    GazeDevice.Info#

    public static class Info {    public String modelName;    public float screen_origin_x;    public float screen_origin_y;}