forked from SharpSenses/libpxcclr.cs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pxcmfacedata.cs
784 lines (680 loc) · 26 KB
/
pxcmfacedata.cs
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
/*******************************************************************************
INTEL CORPORATION PROPRIETARY INFORMATION
This software is supplied under the terms of a license agreement or non-disclosure
agreement with Intel Corporation and may not be copied or disclosed except in
accordance with the terms of that agreement
Copyright(c) 2014 Intel Corporation. All Rights Reserved.
*******************************************************************************/
using System;
using System.Runtime.InteropServices;
#if RSSDK_IN_NAMESPACE
namespace intel.rssdk
{
#endif
public partial class PXCMFaceData : PXCMBase
{
new public const Int32 CUID = 0x54414446;
public const Int32 ALERT_NAME_SIZE = 30;
[Flags]
public enum LandmarkType
{
LANDMARK_NOT_NAMED = 0,
LANDMARK_EYE_RIGHT_CENTER,
LANDMARK_EYE_LEFT_CENTER,
LANDMARK_EYELID_RIGHT_TOP,
LANDMARK_EYELID_RIGHT_BOTTOM,
LANDMARK_EYELID_RIGHT_RIGHT,
LANDMARK_EYELID_RIGHT_LEFT,
LANDMARK_EYELID_LEFT_TOP,
LANDMARK_EYELID_LEFT_BOTTOM,
LANDMARK_EYELID_LEFT_RIGHT,
LANDMARK_EYELID_LEFT_LEFT,
LANDMARK_EYEBROW_RIGHT_CENTER,
LANDMARK_EYEBROW_RIGHT_RIGHT,
LANDMARK_EYEBROW_RIGHT_LEFT,
LANDMARK_EYEBROW_LEFT_CENTER,
LANDMARK_EYEBROW_LEFT_RIGHT,
LANDMARK_EYEBROW_LEFT_LEFT,
LANDMARK_NOSE_TIP,
LANDMARK_NOSE_TOP,
LANDMARK_NOSE_BOTTOM,
LANDMARK_NOSE_RIGHT,
LANDMARK_NOSE_LEFT,
LANDMARK_LIP_RIGHT,
LANDMARK_LIP_LEFT,
LANDMARK_UPPER_LIP_CENTER,
LANDMARK_UPPER_LIP_RIGHT,
LANDMARK_UPPER_LIP_LEFT,
LANDMARK_LOWER_LIP_CENTER,
LANDMARK_LOWER_LIP_RIGHT,
LANDMARK_LOWER_LIP_LEFT,
LANDMARK_FACE_BORDER_TOP_RIGHT,
LANDMARK_FACE_BORDER_TOP_LEFT,
LANDMARK_CHIN,
}
[Flags]
public enum LandmarksGroupType
{
LANDMARK_GROUP_LEFT_EYE = 0x0001,
LANDMARK_GROUP_RIGHT_EYE = 0x0002,
LANDMARK_GROUP_RIGHT_EYEBROW = 0x0004,
LANDMARK_GROUP_LEFT_EYEBROW = 0x0008,
LANDMARK_GROUP_NOSE = 0x0010,
LANDMARK_GROUP_MOUTH = 0x0020,
LANDMARK_GROUP_JAW = 0x0040,
};
[Serializable]
[StructLayout(LayoutKind.Sequential, Size = 40)]
internal struct Reserved
{
internal Int32 res1, res2, res3, res4, res5, res6, res7, res8, res9, res10;
}
[Serializable]
[StructLayout(LayoutKind.Sequential)]
public class LandmarkPointSource
{
public Int32 index;
public LandmarkType alias;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
internal Int32[] reserved;
public LandmarkPointSource()
{
reserved = new Int32[10];
}
}
[Serializable]
[StructLayout(LayoutKind.Sequential)]
public class LandmarkPoint
{
public LandmarkPointSource source;
public Int32 confidenceImage;
public Int32 confidenceWorld;
public PXCMPoint3DF32 world;
public PXCMPointF32 image;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
public Int32[] reserved;
public LandmarkPoint()
{
reserved = new Int32[10];
}
}
[Serializable]
[StructLayout(LayoutKind.Sequential)]
public class HeadPosition
{
public PXCMPoint3DF32 headCenter;
public Int32 confidence;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 9)]
internal Int32[] reserved;
public HeadPosition()
{
reserved = new Int32[9];
}
}
[Serializable]
[StructLayout(LayoutKind.Sequential)]
public class PoseEulerAngles
{
public Single yaw;
public Single pitch;
public Single roll;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
internal Int32[] reserved;
public PoseEulerAngles()
{
reserved = new Int32[10];
}
}
[Serializable]
[StructLayout(LayoutKind.Sequential)]
public class PoseQuaternion
{
public Single x, y, z, w;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
internal Int32[] reserved;
public PoseQuaternion()
{
reserved = new Int32[10];
}
}
[Serializable]
[StructLayout(LayoutKind.Sequential)]
public partial class DetectionData
{
/*
* Assigns average depth of detected face to outFaceAverageDepth,
* returns true if data and outFaceAverageDepth exists, false otherwise.
*/
public Boolean QueryFaceAverageDepth(out Single outFaceAverageDepth)
{
return PXCMFaceData_DetectionData_QueryFaceAverageDepth(instance, out outFaceAverageDepth);
}
/*
* Assigns 2D bounding rectangle of detected face to outBoundingRect,
* returns true if data and outBoundingRect exists, false otherwise.
*/
public Boolean QueryBoundingRect(out PXCMRectI32 outBoundingRect)
{
return PXCMFaceData_DetectionData_QueryBoundingRect(instance, out outBoundingRect);
}
private IntPtr instance;
internal DetectionData(IntPtr instance)
{
this.instance = instance;
}
}
[Serializable]
[StructLayout(LayoutKind.Sequential)]
public partial class LandmarksData
{
/*
* Returns the number of tracked landmarks.
*/
public Int32 QueryNumPoints()
{
return PXCMFaceData_LandmarksData_QueryNumPoints(instance);
}
/*
* Assigns all the points to outNumPoints array.
* Returns true if data and parameters exists, false otherwise.
*/
public Boolean QueryPoints(out LandmarkPoint[] outPoints)
{
return QueryPointsINT(instance, out outPoints);
}
/*
* Assigns point matched to index to outPoint.
* Returns true if data and outPoint exists and index is correct, false otherwise.
*/
public Boolean QueryPoint(Int32 index, out LandmarkPoint outPoint)
{
return QueryPointINT(instance, index, out outPoint);
}
/*
* Returns the number of tracked landmarks in groupFlags.
*/
public Int32 QueryNumPointsByGroup(LandmarksGroupType groupFlags)
{
return PXCMFaceData_LandmarksData_QueryNumPointsByGroup(instance, groupFlags);
}
/*
* Assigns points matched to groupFlags to outPoints.
* User is expected to allocate outPoints to size bigger than the group size - point contains the original source (index + name).
* Returns true if data and parameters exist, false otherwise.
*/
public Boolean QueryPointsByGroup(LandmarksGroupType groupFlags, out LandmarkPoint[] outPoints)
{
return QueryPointsByGroupINT(instance, groupFlags, out outPoints);
}
/*
* Mapping function -> retrieves index corresponding to landmark's name.
*/
public Int32 QueryPointIndex(LandmarkType name)
{
return PXCMFaceData_LandmarksData_QueryPointIndex(instance, name);
}
private IntPtr instance;
internal LandmarksData(IntPtr instance)
{
this.instance = instance;
}
};
[Serializable]
[StructLayout(LayoutKind.Sequential)]
public partial class PoseData
{
/*
* Assigns pose Euler angles to outPoseEulerAngles.
* Returns true if data and parameters exist, false otherwise.
*/
public Boolean QueryPoseAngles(out PoseEulerAngles outPoseEulerAngles)
{
return QueryPoseAnglesINT(instance, out outPoseEulerAngles);
}
/*
* Assigns pose rotation as quaternion to outPoseQuaternion.
* Returns true if data and parameters exist, false otherwise.
*/
public Boolean QueryPoseQuaternion(out PoseQuaternion outPoseQuaternion)
{
return QueryPoseQuaternionINT(instance, out outPoseQuaternion);
}
/*
* Assigns the head position to outHeadPosition.
* Returns true if data and parameters exist, false otherwise.
*/
public Boolean QueryHeadPosition(out HeadPosition outHeadPosition)
{
return QueryHeadPositionINT(instance, out outHeadPosition);
}
/*
* Assigns 3x3 face's rotation matrix to outRotationMatrix.
* Returns true if data and parameters exist, false otherwise.
*/
public void QueryRotationMatrix(out Double[] outRotationMatrix)
{
QueryRotationMatrixINT(instance, out outRotationMatrix);
}
/*
* Returns position(angle) confidence
*/
public Int32 QueryConfidence()
{
return PXCMFaceData_PoseData_QueryConfidence(instance);
}
private IntPtr instance;
internal PoseData(IntPtr instance)
{
this.instance = instance;
}
}
public partial class ExpressionsData
{
public enum FaceExpression
{
EXPRESSION_BROW_RAISER_LEFT = 0,
EXPRESSION_BROW_RAISER_RIGHT,
EXPRESSION_BROW_LOWERER_LEFT,
EXPRESSION_BROW_LOWERER_RIGHT,
EXPRESSION_SMILE,
EXPRESSION_KISS,
EXPRESSION_MOUTH_OPEN,
EXPRESSION_EYES_CLOSED_LEFT,
EXPRESSION_EYES_CLOSED_RIGHT,
EXPRESSION_HEAD_TURN_LEFT,
EXPRESSION_HEAD_TURN_RIGHT,
EXPRESSION_HEAD_UP,
EXPRESSION_HEAD_DOWN,
EXPRESSION_HEAD_TILT_LEFT,
EXPRESSION_HEAD_TILT_RIGHT,
EXPRESSION_EYES_TURN_LEFT,
EXPRESSION_EYES_TURN_RIGHT,
EXPRESSION_EYES_UP,
EXPRESSION_EYES_DOWN,
EXPRESSION_TONGUE_OUT,
EXPRESSION_PUFF_RIGHT,
EXPRESSION_PUFF_LEFT
}
[StructLayout(LayoutKind.Sequential)]
public class FaceExpressionResult
{
public Int32 intensity;
internal Reserved reserved;
}
/// <summary>
/// Queries single expression result
/// </summary>
/// <param name="expression">Single expression</param>
/// <param name="expressionResult">Expression result - such as intensity</param>
/// <returns>Returns true if expression was calculated successfully, false otherwise.</returns>
public Boolean QueryExpression(FaceExpression expression, out FaceExpressionResult expressionResult)
{
return QueryExpressionINT(instance, expression, out expressionResult);
}
private IntPtr instance;
internal ExpressionsData(IntPtr instance)
{
this.instance = instance;
}
}
public partial class RecognitionData
{
/**
@brief Register a user in the Recognition database.
@return The unique user ID assigned to the registered face by the Recognition module.
*/
public Int32 RegisterUser()
{
return PXCMFaceData_RecognitionData_RegisterUser(instance);
}
/**
@brief Removes a user from the Recognition database.
*/
public void UnregisterUser()
{
PXCMFaceData_RecognitionData_UnregisterUser(instance);
}
/**
@brief Checks if a user is registered in the Recognition database.
@return true - if user is in the database, false otherwise.
*/
public Boolean IsRegistered()
{
return PXCMFaceData_RecognitionData_IsRegistered(instance);
}
/**
@brief Returns the ID assigned to the current face by the Recognition module
@return The ID assigned by the Recognition module, or -1 if face was not recognized.
*/
public Int32 QueryUserID()
{
return PXCMFaceData_RecognitionData_QueryUserID(instance);
}
private IntPtr instance;
internal RecognitionData(IntPtr instance)
{
this.instance = instance;
}
}
public partial class RecognitionModuleData
{
public Int32 QueryDatabaseSize()
{
return PXCMFaceData_RecognitionModuleData_QueryDatabaseSize(instance);
}
public Boolean QueryDatabaseBuffer(Byte[] buffer)
{
return PXCMFaceData_RecognitionModuleData_QueryDatabaseBuffer(instance, buffer);
}
public void UnregisterUserByID(Int32 userId)
{
PXCMFaceData_RecognitionModuleData_UnregisterUserByID(instance, userId);
}
private IntPtr instance;
internal RecognitionModuleData(IntPtr instance)
{
this.instance = instance;
}
}
public partial class PulseData
{
public float QueryHeartRate()
{
return PXCMFaceData_PulseData_QueryHeartRate(instance);
}
private IntPtr instance;
internal PulseData(IntPtr instance)
{
this.instance = instance;
}
}
public partial class Face
{
/*
* Returns user ID.
*/
public Int32 QueryUserID()
{
return PXCMFaceData_Face_QueryUserID(instance);
}
/*
* Returns user's detection data instance - null if it is not enabled.
*/
public DetectionData QueryDetection()
{
IntPtr instance2 = PXCMFaceData_Face_Detection(instance);
return instance2 == IntPtr.Zero ? null : new DetectionData(instance2);
}
/*
* Returns user's landmarks data instance - null if it is not enabled.
*/
public LandmarksData QueryLandmarks()
{
IntPtr instance2 = PXCMFaceData_Face_QueryLandmarks(instance);
return instance2 == IntPtr.Zero ? null : new LandmarksData(instance2);
}
/*
* Returns user's pose data - null if it is not enabled.
*/
public PoseData QueryPose()
{
IntPtr instance2 = PXCMFaceData_Face_QueryPose(instance);
return instance2 == IntPtr.Zero ? null : new PoseData(instance2);
}
/*
* Returns user's expressions data - null if it not enabled.
*/
public ExpressionsData QueryExpressions()
{
IntPtr data = PXCMFaceData_Face_QueryExpressions(instance);
if (data == IntPtr.Zero) return null;
return new ExpressionsData(data);
}
/*
* Returns user's recognition data - null if it is not enabled.
*/
public RecognitionData QueryRecognition()
{
IntPtr data = PXCMFaceData_Face_QueryRecognition(instance);
if (data == IntPtr.Zero) return null;
return new RecognitionData(data);
}
public PulseData QueryPulse()
{
IntPtr data = PXCMFaceData_Face_QueryPulse(instance);
if (data == IntPtr.Zero) return null;
return new PulseData(data);
}
/*
* Returns user's gaze data - null if it is not enabled.
*/
public GazeData QueryGaze()
{
IntPtr gaze = PXCMFaceData_Face_QueryGaze(instance);
if (gaze == IntPtr.Zero) return null;
return new GazeData(gaze);
}
/*
* Returns user's gaze calibration data - null if it is not enabled.
*/
public GazeCalibData QueryGazeCalibration()
{
IntPtr calib = PXCMFaceData_Face_QueryGazeCalibration(instance);
if (calib == IntPtr.Zero) return null;
return new GazeCalibData(calib);
}
private IntPtr instance;
internal Face(IntPtr instance)
{
this.instance = instance;
}
}
/*
* Updates data to latest available output.
*/
public pxcmStatus Update()
{
return PXCMFaceData_Update(instance);
}
/*
* Returns detected frame timestamp.
*/
public Int64 QueryFrameTimestamp()
{
return PXCMFaceData_QueryFrameTimestamp(instance);
}
/*
* Returns number of total detected faces in frame.
*/
public Int32 QueryNumberOfDetectedFaces()
{
return PXCMFaceData_QueryNumberOfDetectedFaces(instance);
}
/*
* Returns tracked face corresponding with the algorithm-assigned faceId, null if no such faceId exists.
*/
public Face QueryFaceByID(Int32 faceId)
{
IntPtr face2 = PXCMFaceData_QueryFaceByID(instance, faceId);
return (face2 != IntPtr.Zero) ? new Face(face2) : null;
}
/*
* Returns tracked face corresponding with the given index, 0 being the first according the to chosen tracking strategy;
* Returns null if no such index exists.
*/
public Face QueryFaceByIndex(Int32 index)
{
IntPtr face2 = PXCMFaceData_QueryFaceByIndex(instance, index);
return (face2 != IntPtr.Zero) ? new Face(face2) : null;
}
public RecognitionModuleData QueryRecognitionModule()
{
IntPtr data = PXCMFaceData_QueryRecognitionModule(instance);
if (data == IntPtr.Zero) return null;
return new RecognitionModuleData(data);
}
[StructLayout(LayoutKind.Sequential)]
public class AlertData
{
/** @enum AlertType
* Available events that can be detected by the system (alert types)
*/
[Flags]
public enum AlertType
{
ALERT_NEW_FACE_DETECTED = 1, // thrown when a new face enters the FOV and its position and bounding rectangle is available.
ALERT_FACE_OUT_OF_FOV, // thrown when a new face (even slightly) out of field of view.
ALERT_FACE_BACK_TO_FOV, // thrown when a tracked face is back fully to field of view.
ALERT_FACE_OCCLUDED, // thrown when face is occluded (even slightly) by any object or hand.
ALERT_FACE_NO_LONGER_OCCLUDED, // thrown when face is not occluded by any object or hand.
ALERT_FACE_LOST // thrown when an existing face leaves the FOV and its position and bounding rectangle become unavailable.
}
public AlertType label; // The label that identifies this alert*/
public Int64 timeStamp; // The time-stamp in which the event occurred
public Int32 faceId; // The ID of the relevant face, if relevant and known
internal Reserved reserved;
}
/**
@brief Get the number of fired alerts in the current frame.
@return the number of fired alerts.
*/
public Int32 QueryFiredAlertsNumber()
{
return PXCMFaceData_QueryFiredAlertsNumber(instance);
}
/**
@brief Return whether the specified alert is fired for a specific face in the current frame, and retrieve its data.
@param[in] alertEvent the label of the alert event.
@param[out] outAlertName parameter to contain the name of the alert,maximum size - ALERT_NAME_SIZE
@see AlertData
@return PXC_STATUS_NO_ERROR if returning the alert's name was successful; otherwise, return one of the following errors:
PXCM_STATUS_PARAM_UNSUPPORTED - if outAlertName is null.
PXCM_STATUS_DATA_UNAVAILABLE - if no alert corresponding to alertEvent was found.
*/
public pxcmStatus QueryAlertNameByID(AlertData.AlertType alertEvent, out String outAlertName)
{
return QueryAlertNameByIDINT(instance, alertEvent, out outAlertName);
}
[StructLayout(LayoutKind.Sequential)]
public class GazePoint {
public PXCMPointI32 screenPoint;
public Int32 confidence;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
internal Int32[] reserved;
public GazePoint() {
reserved=new Int32[10];
}
};
public partial class GazeData
{
/*
* Assigns gaze result to outGazeResult.
* Returns true if data and parameters exist, false otherwise.
*/
public GazePoint QueryGazePoint()
{
GazePoint gp = new GazePoint();
PXCMFaceData_GazeData_QueryGazePoint(instance, gp);
return gp;
}
/*
* Return gaze horizontal angle in degrees.
*/
public Double QueryGazeHorizontalAngle()
{
return PXCMFaceData_GazeData_QueryGazeHorizontalAngle(instance);
}
/*
* Return gaze vertical angle in degrees.
*/
public Double QueryGazeVerticalAngle()
{
return PXCMFaceData_GazeData_QueryGazeVerticalAngle(instance);
}
private IntPtr instance;
internal GazeData(IntPtr instance)
{
this.instance = instance;
}
}
public partial class GazeCalibData
{
public enum CalibrationState : int
{
CALIBRATION_IDLE = 0,
CALIBRATION_NEW_POINT,
CALIBRATION_SAME_POINT,
CALIBRATION_DONE
};
public enum CalibrationStatus : int
{
CALIBRATION_STATUS_SUCCESS = 0,
CALIBRATION_STATUS_FAIR,
CALIBRATION_STATUS_POOR,
CALIBRATION_STATUS_FAILED
};
public enum DominantEye
{
DOMINANT_RIGHT_EYE = 0,
DOMINANT_LEFT_EYE,
DOMINANT_BOTH_EYES // A state for averaging both eyes, currently not supported.
};
/*
* Assigns gaze result to outGazeResult.
* Returns true if data and parameters exist, false otherwise.
*/
public CalibrationState QueryCalibrationState()
{
return PXCMFaceData_GazeCalibData_QueryCalibrationState(instance);
}
/*
* Assigns gaze result to outGazeResult.
* Returns true if data and parameters exist, false otherwise.
*/
public PXCMPointI32 QueryCalibPoint()
{
PXCMPointI32 cp = new PXCMPointI32();
PXCMFaceData_GazeCalibData_QueryClibPoint(instance, ref cp);
return cp;
}
/**
retrieves calib data size
*/
public Int32 QueryCalibDataSize()
{
return PXCMFaceData_GazeCalibData_QueryCalibDataSize(instance);
}
/**
retrieves calib data buffer
*/
public CalibrationStatus QueryCalibData(out Byte[] buffer)
{
buffer = null;
Int32 size=QueryCalibDataSize();
if (size<=0) return CalibrationStatus.CALIBRATION_STATUS_FAILED;
buffer = new byte[size];
return PXCMFaceData_GazeCalibData_QueryCalibData(instance, buffer);
}
/**
The optimal eye of the current calibration - the one which yielded the highest accuracy between the two eyes,
aiming at hitting the user's dominant eye; Unless the user requested set of the dominant eye.
This is the eye relied on in the gaze inference algorithm.
*/
public DominantEye QueryCalibDominantEye()
{
return PXCMFaceData_GazeCalibData_QueryCalibDominantEye(instance);
}
private IntPtr instance;
internal GazeCalibData(IntPtr instance)
{
this.instance = instance;
}
}
internal PXCMFaceData(IntPtr instance, Boolean delete)
: base(instance, delete)
{
}
};
#if RSSDK_IN_NAMESPACE
}
#endif