From 54ade09b95c2680d2393d4020604c569189b8a1e Mon Sep 17 00:00:00 2001 From: Patrik Huber Date: Wed, 1 Aug 2018 22:57:00 +0100 Subject: [PATCH] Added an optional parameter frontal_range_threshold to select_contour The default value is 7.5 (degree), the value it used before. --- include/eos/fitting/contour_correspondence.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/eos/fitting/contour_correspondence.hpp b/include/eos/fitting/contour_correspondence.hpp index fedb7afa2..0c2233285 100644 --- a/include/eos/fitting/contour_correspondence.hpp +++ b/include/eos/fitting/contour_correspondence.hpp @@ -46,7 +46,8 @@ namespace fitting { struct ModelContour; struct ContourLandmarks; std::pair, std::vector> -select_contour(float yaw_angle, const ContourLandmarks& contour_landmarks, const ModelContour& model_contour); +select_contour(float yaw_angle, const ContourLandmarks& contour_landmarks, const ModelContour& model_contour, + float frontal_range_threshold = 7.5f); std::tuple, std::vector, std::vector> get_nearest_contour_correspondences(const core::LandmarkCollection& landmarks, const std::vector& landmark_contour_identifiers, @@ -266,13 +267,13 @@ get_contour_correspondences(const core::LandmarkCollection& lan * @return A pair with two vectors containing the selected 2D image contour landmark ids and the 3D model contour indices. */ inline std::pair, std::vector> -select_contour(float yaw_angle, const ContourLandmarks& contour_landmarks, const ModelContour& model_contour) +select_contour(float yaw_angle, const ContourLandmarks& contour_landmarks, const ModelContour& model_contour, float frontal_range_threshold) { using std::begin; using std::end; std::vector model_contour_indices; std::vector contour_landmark_identifiers; - if (yaw_angle >= -7.5f) // positive yaw = subject looking to the left + if (yaw_angle >= -frontal_range_threshold) // positive yaw = subject looking to the left { // ==> we use the right cnt-lms model_contour_indices.insert(end(model_contour_indices), begin(model_contour.right_contour), @@ -281,7 +282,7 @@ select_contour(float yaw_angle, const ContourLandmarks& contour_landmarks, const begin(contour_landmarks.right_contour), end(contour_landmarks.right_contour)); } - if (yaw_angle <= 7.5f) + if (yaw_angle <= frontal_range_threshold) { // ==> we use the left cnt-lms model_contour_indices.insert(end(model_contour_indices), begin(model_contour.left_contour),