Confidence reporting bug if not tracked in first frame.
This commit is contained in:
parent
21bdf03801
commit
c15a5042a9
4 changed files with 9 additions and 7 deletions
|
@ -323,12 +323,13 @@ void FaceAnalyser::AddNextFrame(const cv::Mat& frame, const cv::Mat_<float>& det
|
||||||
// Extract shape parameters from the detected landmarks
|
// Extract shape parameters from the detected landmarks
|
||||||
cv::Vec6f params_global;
|
cv::Vec6f params_global;
|
||||||
cv::Mat_<float> params_local;
|
cv::Mat_<float> params_local;
|
||||||
pdm.CalcParams(params_global, params_local, detected_landmarks);
|
|
||||||
|
|
||||||
// First align the face if tracking was successfull
|
// First align the face if tracking was successfull
|
||||||
if(success)
|
if(success)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
pdm.CalcParams(params_global, params_local, detected_landmarks);
|
||||||
|
|
||||||
// The aligned face requirement for AUs
|
// 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);
|
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_au = cv::Mat(align_height_au, align_width_au, CV_8UC3);
|
||||||
aligned_face_for_output.setTo(0);
|
aligned_face_for_output.setTo(0);
|
||||||
aligned_face_for_au.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)
|
if (aligned_face_for_output.channels() == 3 && out_grayscale)
|
||||||
|
|
|
@ -102,7 +102,7 @@ public:
|
||||||
// Indicating if the tracking has been initialised (for video based tracking)
|
// Indicating if the tracking has been initialised (for video based tracking)
|
||||||
bool tracking_initialised;
|
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;
|
double detection_certainty;
|
||||||
|
|
||||||
// Indicator if eye model is there for eye detection
|
// Indicator if eye model is there for eye detection
|
||||||
|
|
|
@ -511,7 +511,7 @@ void CLNF::Read(string main_location)
|
||||||
detection_success = false;
|
detection_success = false;
|
||||||
tracking_initialised = false;
|
tracking_initialised = false;
|
||||||
model_likelihood = -10; // very low
|
model_likelihood = -10; // very low
|
||||||
detection_certainty = 1; // very uncertain
|
detection_certainty = 0; // very uncertain
|
||||||
|
|
||||||
// Initialising default values for the rest of the variables
|
// Initialising default values for the rest of the variables
|
||||||
|
|
||||||
|
@ -534,7 +534,7 @@ void CLNF::Reset()
|
||||||
detection_success = false;
|
detection_success = false;
|
||||||
tracking_initialised = false;
|
tracking_initialised = false;
|
||||||
model_likelihood = -10; // very low
|
model_likelihood = -10; // very low
|
||||||
detection_certainty = 1; // very uncertain
|
detection_certainty = 0; // very uncertain
|
||||||
|
|
||||||
// local parameters (shape)
|
// local parameters (shape)
|
||||||
params_local.setTo(0.0);
|
params_local.setTo(0.0);
|
||||||
|
@ -647,11 +647,11 @@ bool CLNF::DetectLandmarks(const cv::Mat_<uchar> &image, FaceModelParameters& pa
|
||||||
detection_success = fit_success;
|
detection_success = fit_success;
|
||||||
if(fit_success)
|
if(fit_success)
|
||||||
{
|
{
|
||||||
detection_certainty = -1;
|
detection_certainty = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
detection_certainty = 1;
|
detection_certainty = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
% Read gaze (x,y,z) for one eye and (x,y,z) for another
|
||||||
gaze = all_params(valid_frames, gaze_inds);
|
gaze = all_params(valid_frames, gaze_inds);
|
||||||
|
|
||||||
plot(time, gaze(:,1), 'DisplayName', 'Left - right');
|
plot(time_stamps, gaze(:,1), 'DisplayName', 'Left - right');
|
||||||
hold on;
|
hold on;
|
||||||
plot(time_stamps, gaze(:,2), 'DisplayName', 'Up - down');
|
plot(time_stamps, gaze(:,2), 'DisplayName', 'Up - down');
|
||||||
xlabel('Time(s)') % x-axis label
|
xlabel('Time(s)') % x-axis label
|
||||||
|
|
Loading…
Reference in a new issue