#include <stdio.h>
#if _WIN32 || _WIN64
#include <windows.h>
static void sleep_ms(int time) {
Sleep(time);
}
#else
#include <unistd.h>
static void sleep_ms(int time) {
usleep(time * 1000);
}
#endif
char* serial_number = NULL;
printf("Entered calibration mode for eye tracker with serial number %s \n.", serial_number);
{
#define NUM_OF_POINTS 5U
{{0.5f, 0.5f}, {0.1f, 0.1f}, {0.1f, 0.9f}, {0.9f, 0.1f}, {0.9f, 0.9f}};
size_t i = 0;
for(; i < NUM_OF_POINTS; i++) {
printf(
"Show a point on screen at (%f,%f).\n", point->
x, point->
y);
sleep_ms(700);
printf(
"Collecting data at (%f,%f).\n", point->
x, point->
y);
}
}
printf("Computing and applying calibration.\n");
printf(
"Compute and apply returned %i and collected at %zu points.\n", status, calibration_result->
calibration_point_count);
} else {
printf("Calibration failed!\n");
}
printf(
"Removing calibration point at (%f,%f).\n", recalibrate_point->
x, recalibrate_point->
y);
printf(
"Show a point on screen at (%f,%f).\n", recalibrate_point->
x, recalibrate_point->
y);
printf("Computing and applying calibration.\n");
printf(
"Compute and apply returned %i and collected at %zu points.\n", status, calibration_result->
calibration_point_count);
} else {
printf("Calibration failed!\n");
}
}
printf("Left calibration mode.\n");
}
Definition: tobii_research_calibration.h:139
size_t calibration_point_count
Definition: tobii_research_calibration.h:147
TobiiResearchCalibrationStatus status
Definition: tobii_research_calibration.h:151
Definition: tobii_research.h:384
float x
Definition: tobii_research.h:388
float y
Definition: tobii_research.h:392
TOBII_RESEARCH_API void TOBII_RESEARCH_CALL tobii_research_free_string(char *str)
Free memory allocation for a string allocated by the SDK.
struct TobiiResearchEyeTracker TobiiResearchEyeTracker
Definition: tobii_research.h:315
TobiiResearchStatus
Definition: tobii_research.h:45
@ TOBII_RESEARCH_STATUS_OK
Definition: tobii_research.h:49
Functionality for implementing calibration.
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_screen_based_calibration_collect_data(TobiiResearchEyeTracker *eyetracker, float x, float y)
Starts collecting data for a calibration point.
@ TOBII_RESEARCH_CALIBRATION_SUCCESS
Definition: tobii_research_calibration.h:34
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_screen_based_calibration_enter_calibration_mode(TobiiResearchEyeTracker *eyetracker)
Enters the screen based calibration mode and the eye tracker is made ready for collecting data and ca...
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_screen_based_calibration_compute_and_apply(TobiiResearchEyeTracker *eyetracker, TobiiResearchCalibrationResult **result)
Uses the collected data and tries to compute calibration parameters.
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_screen_based_calibration_leave_calibration_mode(TobiiResearchEyeTracker *eyetracker)
Leaves the screen based calibration mode.
TOBII_RESEARCH_API void TOBII_RESEARCH_CALL tobii_research_free_screen_based_calibration_result(TobiiResearchCalibrationResult *result)
Free memory allocation for the calibration result received via tobii_research_screen_based_calibratio...
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_screen_based_calibration_discard_data(TobiiResearchEyeTracker *eyetracker, float x, float y)
Removes the collected data associated with a specific calibration point.
Functionality for an eye tracker.
TOBII_RESEARCH_API TobiiResearchStatus TOBII_RESEARCH_CALL tobii_research_get_serial_number(TobiiResearchEyeTracker *eyetracker, char **serial_number)
Gets the serial number of the eye tracker. All physical eye trackers have a unique serial number.