File: PsychCV.h

package info (click to toggle)
psychtoolbox-3 3.0.14.20170103%2Bgit6-g605ff5c.dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 103,044 kB
  • ctags: 69,483
  • sloc: ansic: 167,371; cpp: 11,232; objc: 4,708; sh: 1,875; python: 383; php: 344; makefile: 207; java: 113
file content (89 lines) | stat: -rwxr-xr-x 2,753 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
	PsychToolbox3/Source/Common/PsychCV/PsychPortAudio.h
	
	PLATFORMS:	All

	AUTHORS:

	Mario Kleiner   mk      mario.kleiner at tuebingen.mpg.de
	
	HISTORY:

	5.01.08			mk		wrote it.  
	
	NOTES:

*/

//begin include once 
#ifndef PSYCH_IS_INCLUDED_PsychCV
#define PSYCH_IS_INCLUDED_PsychCV

//project includes
#include "Psych.h" 
#include "PsychTimeGlue.h"

// Data structure for setting/returning/exchanging eye tracking data
// between PsychCV and the OpenEyes cvEyeTracker:
typedef struct PsychCVEyeResult {
	double gaze_x;
	double gaze_y;
	double pupil_x;
	double pupil_y;
	double cornea_x;
	double cornea_y;
	psych_bool validresult;
	double timestamp;
	unsigned int trackcount;
} PsychCVEyeResult;

// Internal helper functions:

// Startup function: Called at module load time / First time invocation:
void PsychCVInitialize(void);

// Module exit function: Called at shutdown/clear mex/... time:
PsychError PsychCVExit(void);

// Logger callback function to output OpenCV et al. debug messages at 'verbosity' > 5.
void PsychCVLogger(const char* msg);

// Setup help strings:
void InitializeSynopsis(void);

// Show command overview:
PsychError PSYCHCVDisplaySynopsis(void);

#ifdef PSYCHCV_USE_OPENCV
// Helper functions from the OpenEyesCVEyeTracker submodule:
psych_bool cvEyeTrackerInitialize(const char* logfilename, int eyewidth, int eyeheight, int eyechannels, void** eyeInputImageMono8, void** eyeInputImageColor, int scenewidth, int sceneheight, void** sceneInputImageRGB8, void** ellipseOutputImageRGB8, void** thresholdOutputImageMono8);
psych_bool cvEyeTrackerShutdown(void);
psych_bool cvEyeTrackerExecuteTrackingCycle(PsychCVEyeResult* eyeResult, psych_bool useHighGUI);
void cvEyeTrackerSetPupilLocation(int px, int py);
void cvEyeTrackerAddCalibrationPoint(int px, int py);
void cvEyeTrackerRecalibrate(psych_bool resetCalib);
void cvEyeTrackerSetParameters(int pupilEdgeThreshold, int starburstRays, int minFeatureCandidates, int corneaWindowSize, int edgeThreshold, int gaussWidth, double maxPupilEccentricity, double initialAngleSpread,
								double fanoutAngle1, double fanoutAngle2, int featuresPerRay, int specialFlags);
void cvEyeTrackerSetRansacConstraints(double minDist, double maxDist, double minArea, double maxArea); 
void cvEyeTrackerSetOverrideReferencePoint(int rx, int ry);
#endif

// Publically available functions:

// Version:
PsychError MODULEVersion(void); 

// Level of verbosity:
PsychError PSYCHCVVerbosity(void);

#ifdef PSYCHCV_USE_OPENCV
PsychError PSYCHCVOpenEyesInitialize(void);
PsychError PSYCHCVOpenEyesShutdown(void);
PsychError PSYCHCVOpenEyesTrackEyePosition(void);
PsychError PSYCHCVOpenEyesParameters(void);
#endif

PsychError PSYCHCVCopyMatrixToMemBuffer(void);

//end include once
#endif