Bug fix with bounding box computation and with Region of Interest for face validation.

This commit is contained in:
Tadas Baltrusaitis
2018-07-05 14:30:03 +01:00
parent 79d7116dae
commit a48a54b98c
2 changed files with 8 additions and 2 deletions

View File

@@ -344,9 +344,15 @@ float DetectionValidator::Check(const cv::Vec3d& orientation, const cv::Mat_<uch
xs = xs - min_x;
ys = ys - min_y;
// If the ROI is non existent return failure (this could happen if all landmarks are outside of the image)
if (max_x - min_x <= 1 || max_y - min_y <= 1)
{
return 0.0f;
}
cv::Mat_<float> intensity_img_float_local;
intensity_img(cv::Rect(min_x, min_y, max_x - min_x, max_y - min_y)).convertTo(intensity_img_float_local, CV_32F);
// the piece-wise affine image warping
paws[id].Warp(intensity_img_float_local, warped, detected_landmarks_local);

View File

@@ -480,7 +480,7 @@ namespace LandmarkDetector
for (int i = 0; i < n; ++i)
{
float val_x = landmarks.at<float>(i, 0);
float val_y = landmarks.at<float>(i, 0);
float val_y = landmarks.at<float>(i, 1);
if (i == 0 || val_x < min_x)
min_x = val_x;