private void RecordObservation(RecorderOpenFace recorder, RawImage vis_image, int face_id, bool success, float fx, float fy, float cx, float cy, double timestamp, int frame_number) { recorder.SetObservationTimestamp(timestamp); double confidence = landmark_detector.GetConfidence(); List <float> pose = new List <float>(); landmark_detector.GetPose(pose, fx, fy, cx, cy); recorder.SetObservationPose(pose); List <Tuple <float, float> > landmarks_2D = landmark_detector.CalculateAllLandmarks(); List <Tuple <float, float, float> > landmarks_3D = landmark_detector.Calculate3DLandmarks(fx, fy, cx, cy); List <float> global_params = landmark_detector.GetRigidParams(); List <float> local_params = landmark_detector.GetNonRigidParams(); recorder.SetObservationLandmarks(landmarks_2D, landmarks_3D, global_params, local_params, confidence, success); var gaze = gaze_analyser.GetGazeCamera(); var gaze_angle = gaze_analyser.GetGazeAngle(); var landmarks_2d_eyes = landmark_detector.CalculateAllEyeLandmarks(); var landmarks_3d_eyes = landmark_detector.CalculateAllEyeLandmarks3D(fx, fy, cx, cy); recorder.SetObservationGaze(gaze.Item1, gaze.Item2, gaze_angle, landmarks_2d_eyes, landmarks_3d_eyes); var au_regs = face_analyser.GetCurrentAUsReg(); var au_classes = face_analyser.GetCurrentAUsClass(); recorder.SetObservationActionUnits(au_regs, au_classes); recorder.SetObservationFaceID(face_id); recorder.SetObservationFrameNumber(frame_number); recorder.SetObservationFaceAlign(face_analyser.GetLatestAlignedFace()); var hog_feature = face_analyser.GetLatestHOGFeature(); recorder.SetObservationHOG(success, hog_feature, face_analyser.GetHOGRows(), face_analyser.GetHOGCols(), face_analyser.GetHOGChannels()); recorder.SetObservationVisualization(vis_image); recorder.WriteObservation(); }