diff --git a/exe/FeatureExtraction/FeatureExtraction.cpp b/exe/FeatureExtraction/FeatureExtraction.cpp index ed17599..071e605 100644 --- a/exe/FeatureExtraction/FeatureExtraction.cpp +++ b/exe/FeatureExtraction/FeatureExtraction.cpp @@ -232,9 +232,9 @@ int main (int argc, char **argv) // Get the input output file parameters // Indicates that rotation should be with respect to camera or world coordinates - bool use_world_coordinates; + bool use_camera_coordinates; string output_codec; //not used but should - LandmarkDetector::get_video_input_output_params(input_files, output_files, tracked_videos_output, use_world_coordinates, output_codec, arguments); + LandmarkDetector::get_video_input_output_params(input_files, output_files, tracked_videos_output, use_camera_coordinates, output_codec, arguments); bool video_input = true; bool images_as_video = false; @@ -584,13 +584,13 @@ int main (int argc, char **argv) // Work out the pose of the head from the tracked model cv::Vec6d pose_estimate; - if(use_world_coordinates) + if(use_camera_coordinates) { - pose_estimate = LandmarkDetector::GetCorrectedPoseWorld(face_model, fx, fy, cx, cy); + pose_estimate = LandmarkDetector::GetCorrectedPoseCamera(face_model, fx, fy, cx, cy); } else { - pose_estimate = LandmarkDetector::GetCorrectedPoseCamera(face_model, fx, fy, cx, cy); + pose_estimate = LandmarkDetector::GetCorrectedPoseWorld(face_model, fx, fy, cx, cy); } if (hog_output_file.is_open()) diff --git a/lib/local/FaceAnalyser/src/GazeEstimation.cpp b/lib/local/FaceAnalyser/src/GazeEstimation.cpp index d1dfa76..c7386d3 100644 --- a/lib/local/FaceAnalyser/src/GazeEstimation.cpp +++ b/lib/local/FaceAnalyser/src/GazeEstimation.cpp @@ -88,7 +88,7 @@ cv::Point3f GetPupilPosition(cv::Mat_ eyeLdmks3d){ void FaceAnalysis::EstimateGaze(const LandmarkDetector::CLNF& clnf_model, cv::Point3f& gaze_absolute, float fx, float fy, float cx, float cy, bool left_eye) { - cv::Vec6d headPose = LandmarkDetector::GetPoseCamera(clnf_model, fx, fy, cx, cy); + cv::Vec6d headPose = LandmarkDetector::GetCorrectedPoseWorld(clnf_model, fx, fy, cx, cy); cv::Vec3d eulerAngles(headPose(3), headPose(4), headPose(5)); cv::Matx33d rotMat = LandmarkDetector::Euler2RotationMatrix(eulerAngles); @@ -117,7 +117,7 @@ void FaceAnalysis::EstimateGaze(const LandmarkDetector::CLNF& clnf_model, cv::Po cv::Mat faceLdmks3d = clnf_model.GetShape(fx, fy, cx, cy); faceLdmks3d = faceLdmks3d.t(); - cv::Mat offset = (cv::Mat_(3, 1) << 0, -3.50, 0); + cv::Mat offset = (cv::Mat_(3, 1) << 0, -3.50, 7.0); int eyeIdx = 1; if (left_eye) { diff --git a/lib/local/LandmarkDetector/src/LandmarkDetectorFunc.cpp b/lib/local/LandmarkDetector/src/LandmarkDetectorFunc.cpp index 40b13d9..7f77ad1 100644 --- a/lib/local/LandmarkDetector/src/LandmarkDetectorFunc.cpp +++ b/lib/local/LandmarkDetector/src/LandmarkDetectorFunc.cpp @@ -111,7 +111,7 @@ cv::Vec6d LandmarkDetector::GetCorrectedPoseWorld(const CLNF& clnf_model, double double X = ((clnf_model.params_global[4] - cx) * (1.0/fx)) * Z; double Y = ((clnf_model.params_global[5] - cy) * (1.0/fy)) * Z; - + // Correction for orientation // 2D points diff --git a/lib/local/LandmarkDetector/src/LandmarkDetectorUtils.cpp b/lib/local/LandmarkDetector/src/LandmarkDetectorUtils.cpp index 6df74ed..6962e52 100644 --- a/lib/local/LandmarkDetector/src/LandmarkDetectorUtils.cpp +++ b/lib/local/LandmarkDetector/src/LandmarkDetectorUtils.cpp @@ -97,7 +97,7 @@ void create_directories(string output_path) // Extracting the following command line arguments -f, -op, -of, -ov (and possible ordered repetitions) void get_video_input_output_params(vector &input_video_files, vector &output_files, - vector &output_video_files, bool& world_coordinates_pose, string& output_codec, vector &arguments) + vector &output_video_files, bool& camera_coordinates_pose, string& output_codec, vector &arguments) { bool* valid = new bool[arguments.size()]; @@ -106,8 +106,8 @@ void get_video_input_output_params(vector &input_video_files, vector &input_video_files, vector