Commit f859b934 authored by li412076173's avatar li412076173

changed for demo

parent 48b7c395
#include <atomic>
#include "MousePositionProvider.h"
//#include <tobii/tobii_streams.h>
#include <assert.h>
#include <CameraProfileDelegate/CameraProfileTask.h>
using namespace cv;
Point currentMousePosition = Point(-1,-1);
/*
Point currentGazePosition = Point(-1, -1);
bool gazeValid = false;
void gaze_point_callback(tobii_gaze_point_t const* gaze_point, void* user_data)
{
if (gaze_point->validity == TOBII_VALIDITY_VALID) {
currentGazePosition.x = gaze_point->position_xy[0] * ScreenCameraInfo::getCurrentDiviceInfo().screenPhysicalResolution.width;
currentGazePosition.y = gaze_point->position_xy[1] * ScreenCameraInfo::getCurrentDiviceInfo().screenPhysicalResolution.height;
gazeValid = true;
return;
}
gazeValid = false;
}
tobii_api_t* api;
tobii_error_t error_tobii;
tobii_device_t* device;
*/
void onmouse(int event, int x, int y, int flags, void* param) {
if (event == CV_EVENT_MOUSEMOVE) {
currentMousePosition = Point(x, y);
}
}
void setWindowNameOfMouse(string title) {
setMouseCallback(title,onmouse);
}
Point getMousePosition() {
return currentMousePosition;
}
/*
Point getGazePosition() {
error_tobii = tobii_api_create(&api, NULL, NULL);
assert(error_tobii == TOBII_ERROR_NO_ERROR);
error_tobii = tobii_device_create(api, NULL, &device);
assert(error_tobii == TOBII_ERROR_NO_ERROR);
error_tobii = tobii_gaze_point_subscribe(device, gaze_point_callback, 0);
assert(error_tobii == TOBII_ERROR_NO_ERROR);
while(!gazeValid){
error_tobii = tobii_wait_for_callbacks(device);
assert(error_tobii == TOBII_ERROR_NO_ERROR || error_tobii == TOBII_ERROR_TIMED_OUT);
error_tobii = tobii_process_callbacks(device);
assert(error_tobii == TOBII_ERROR_NO_ERROR);
}
gazeValid = false;
error_tobii = tobii_gaze_point_unsubscribe(device);
assert(error_tobii == TOBII_ERROR_NO_ERROR);
error_tobii = tobii_device_destroy(device);
assert(error_tobii == TOBII_ERROR_NO_ERROR);
error_tobii = tobii_api_destroy(api);
assert(error_tobii == TOBII_ERROR_NO_ERROR);
api = NULL;
device = NULL;
return currentGazePosition;
}
*/
\ No newline at end of file
......@@ -3,4 +3,5 @@
using namespace std;
cv::Point getMousePosition();
void setWindowNameOfMouse(string);
\ No newline at end of file
void setWindowNameOfMouse(string);
//cv::Point getGazePosition();
\ No newline at end of file
......@@ -31,8 +31,8 @@ public:
getStatus(items);
int offsetLeft = 0;
int offsetTop = 0;
double fontScale = 1.0;
int thickness = 2;
double fontScale = 0.5;
int thickness = 1;
for (string i : items) {
cv::Size stringSize = getTextSize(cv::String(i), CV_FONT_HERSHEY_SIMPLEX, fontScale, thickness, 0);
offsetLeft = 5;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment