visageSDK
ShowcaseDemo/ShowcaseDemo/TrackerWrapper.h
1 #import <Foundation/Foundation.h>
2 #import <CoreGraphics/CoreGraphics.h>
3 #import <Accelerate/Accelerate.h>
4 #import "CustomGLView.h"
5 #import "Informer.h"
6 #import "AnalyserInformer.h"
7 
8 // declare C++ implementation for .mm (Obj-C++) files
9 #ifdef __cplusplus
10 #include "visageVision.h"
11 #include "VideoGrabber.h"
12 #include "DemoFrameGrabber.h"
13 #include "VisageRendering.h"
14 #include "CameraGrabber.h"
15 
16 #endif
17 
18 // declare C++ implementation for .m (Obj-C) files
19 #ifdef __OBJC__
20 #ifndef __cplusplus
21 typedef void VisageTracker;
22 typedef void FaceData;
23 typedef void DemoFrameGrabber;
24 typedef void FDP;
25 typedef void VsImage;
26 #endif
27 #endif
28 
45 @interface TrackerWrapper : NSObject {
46  CustomGLView *glView;
47 
52 
57 
58 
59  NSOperationQueue* opQ;
60  __weak NSBlockOperation* currentTrackOperation;
61 #ifdef __cplusplus
62  VisageSDK::VisageTracker* tracker;
64  VisageSDK::FaceData* trackingData;
65  AnalysisData* analysisData;
66  VideoGrabber* videoGrabber;
67  DemoFrameGrabber* demoFrameGrabber;
68  VsImage* frameBGRA;
69  VsImage* frameRGB;
70  VsImage* frameDisplay;
71 
75  int glWidth;
79  int glHeight;
80 
84  bool inGetTrackingResults;
85 
90 
95 
100 
101  bool earsActivated;
102 
107 
108  float tapPositionx;
109  float tapPositiony;
110 
111  bool instructionsMessage;
112 
113 #endif
114 }
115 
116 @property (nonatomic) CustomGLView *glView;
117 @property (nonatomic) bool ageActivated;
118 @property (nonatomic) bool genderActivated;
119 @property (nonatomic) bool emotionsActivated;
120 
121 @property (nonatomic) bool earsActivated;
122 
123 @property (nonatomic) int activeDisplay;
124 @property (nonatomic) float tapPositionx;
125 @property (nonatomic) float tapPositiony;
126 
127 @property (nonatomic) bool instructionsMessage;
128 
134 - (void)initTracker:(CustomGLView *)view withInformer:(Informer*) info andAnalyserInformer:(AnalyserInformer *)analyserInformer;
138 - (void)startTrackingFromCam:(int)camera;
142 - (void)startTrackingFromImage:(UIImage *)image;
146 - (void)startTrackingFromVideo:(NSString *)video;
150 - (void) trackingCamThread:(id)object;
154 - (void) trackingImageThread:(UIImage *)image;
158 - (void) trackingVideoThread:(NSString*) videoURL;
162 - (void)stopTracker;
163 /*
164  * Method for forcing multithreded mode.
165  *
166  * @param object dummy object
167  */
168 - (void)dummyThread:(id)object;
169 /*
170  * Method for forcing multithreded mode.
171  */
172 - (BOOL)startMultithread;
173 /*
174  * Method for performing face analysis.
175  */
176 - (void)doAnalysis:(int)faceIndex;
177 /*
178  * Method for resetting analyser filters.
179  */
180 - (void)resetAnalyserFilters:(int)index;
181 
189 - (void)displayTrackingResults:(int*)trackerStatus Frame:(VsImage*)frame Face:(VsRect*)rect;
193 - (long)getCurrentTimeMs;
194 
195 - (void)toggleEarsTracking:(bool)enableEars;
196 - (void)toggleIrisTracking:(bool)enableIris;
197 - (void)toggleRefineLandmarks:(bool)enableRefineLandmarks;
198 - (BOOL)initAnalyser;
199 
200 @end
VisageTracker is a face tracker capable of tracking the head pose, facial features and gaze for multi...
VisageFaceAnalyser contains face analysis algorithms capable of estimating age, gender and emotion fr...
int glHeight
Size of the OpenGL view.
Displays tracking information.
Analysis data structure, used as a container for all face analysis results.
Displays analyser information.
Implements simple high-level Objective-C interface around VisageSDK::VisageTracker functionallity.
Informer * m_informer
Informer used for displaying tracking information.
Controls OpenGL view used for tracking output.
bool ageActivated
Boolean variable that states if age analyser is turned on or off.
bool emotionsActivated
Boolean variable that states if emotions analyser is turned on or off.
AnalyserInformer * analyserInformer
Informer used for displaying analyser information.
int activeDisplay
Current drawing options variable.
Face data structure, used as container for all face tracking and detection results.
Definition: FaceData.h:259
bool genderActivated
Boolean variable that states if gender analyser is turned on or off.
Feature points of a face.
Definition: FDP.h:191
Image store container.
Implements a simple frame grabber that serves a single image to the tracker in order to demonstrate t...
int glWidth
Size of the OpenGL view.