Confidence reporting bug if not tracked in first frame.

This commit is contained in:
Tadas Baltrusaitis 2017-11-24 17:44:32 +00:00
parent 21bdf03801
commit c15a5042a9
4 changed files with 9 additions and 7 deletions

View File

@ -323,12 +323,13 @@ void FaceAnalyser::AddNextFrame(const cv::Mat& frame, const cv::Mat_<float>& det
// Extract shape parameters from the detected landmarks
cv::Vec6f params_global;
cv::Mat_<float> params_local;
pdm.CalcParams(params_global, params_local, detected_landmarks);
// First align the face if tracking was successfull
if(success)
{
pdm.CalcParams(params_global, params_local, detected_landmarks);
// The aligned face requirement for AUs
AlignFaceMask(aligned_face_for_au, frame, detected_landmarks, params_global, pdm, triangulation, true, align_scale_au, align_width_au, align_height_au);
@ -348,6 +349,7 @@ void FaceAnalyser::AddNextFrame(const cv::Mat& frame, const cv::Mat_<float>& det
aligned_face_for_au = cv::Mat(align_height_au, align_width_au, CV_8UC3);
aligned_face_for_output.setTo(0);
aligned_face_for_au.setTo(0);
params_local = cv::Mat_<float>(pdm.NumberOfModes(), 1, 0.0f);
}
if (aligned_face_for_output.channels() == 3 && out_grayscale)

View File

@ -102,7 +102,7 @@ public:
// Indicating if the tracking has been initialised (for video based tracking)
bool tracking_initialised;
// The actual output of the regressor (-1 is perfect detection 1 is worst detection)
// Representing how confident we are that tracking succeeds (0 - complete failure, 1 - perfect success)
double detection_certainty;
// Indicator if eye model is there for eye detection

View File

@ -511,7 +511,7 @@ void CLNF::Read(string main_location)
detection_success = false;
tracking_initialised = false;
model_likelihood = -10; // very low
detection_certainty = 1; // very uncertain
detection_certainty = 0; // very uncertain
// Initialising default values for the rest of the variables
@ -534,7 +534,7 @@ void CLNF::Reset()
detection_success = false;
tracking_initialised = false;
model_likelihood = -10; // very low
detection_certainty = 1; // very uncertain
detection_certainty = 0; // very uncertain
// local parameters (shape)
params_local.setTo(0.0);
@ -647,11 +647,11 @@ bool CLNF::DetectLandmarks(const cv::Mat_<uchar> &image, FaceModelParameters& pa
detection_success = fit_success;
if(fit_success)
{
detection_certainty = -1;
detection_certainty = 1;
}
else
{
detection_certainty = 1;
detection_certainty = 0;
}
}

View File

@ -156,7 +156,7 @@ gaze_inds = cellfun(@(x) ~isempty(x) && x==1, strfind(column_names, 'gaze_angle'
% Read gaze (x,y,z) for one eye and (x,y,z) for another
gaze = all_params(valid_frames, gaze_inds);
plot(time, gaze(:,1), 'DisplayName', 'Left - right');
plot(time_stamps, gaze(:,1), 'DisplayName', 'Left - right');
hold on;
plot(time_stamps, gaze(:,2), 'DisplayName', 'Up - down');
xlabel('Time(s)') % x-axis label