|
|
@ -666,7 +666,7 @@ Mat FacemarkLBFImpl::BBox::project(const Mat &shape) const { |
|
|
|
res(i, 0) = (shape_(i, 0) - x_center) / x_scale; |
|
|
|
res(i, 0) = (shape_(i, 0) - x_center) / x_scale; |
|
|
|
res(i, 1) = (shape_(i, 1) - y_center) / y_scale; |
|
|
|
res(i, 1) = (shape_(i, 1) - y_center) / y_scale; |
|
|
|
} |
|
|
|
} |
|
|
|
return res; |
|
|
|
return CV_CXX_MOVE(res); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Project relative shape to absolute shape binding to this bbox
|
|
|
|
// Project relative shape to absolute shape binding to this bbox
|
|
|
@ -677,7 +677,7 @@ Mat FacemarkLBFImpl::BBox::reproject(const Mat &shape) const { |
|
|
|
res(i, 0) = shape_(i, 0)*x_scale + x_center; |
|
|
|
res(i, 0) = shape_(i, 0)*x_scale + x_center; |
|
|
|
res(i, 1) = shape_(i, 1)*y_scale + y_center; |
|
|
|
res(i, 1) = shape_(i, 1)*y_scale + y_center; |
|
|
|
} |
|
|
|
} |
|
|
|
return res; |
|
|
|
return CV_CXX_MOVE(res); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Mat FacemarkLBFImpl::getMeanShape(std::vector<Mat> >_shapes, std::vector<BBox> &bboxes) { |
|
|
|
Mat FacemarkLBFImpl::getMeanShape(std::vector<Mat> >_shapes, std::vector<BBox> &bboxes) { |
|
|
@ -1038,7 +1038,7 @@ Mat FacemarkLBFImpl::RandomForest::generateLBF(Mat &img, Mat ¤t_shape, BBo |
|
|
|
lbf_feat(i*trees_n + j) = (i*trees_n + j)*base + code; |
|
|
|
lbf_feat(i*trees_n + j) = (i*trees_n + j)*base + code; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return lbf_feat; |
|
|
|
return CV_CXX_MOVE(lbf_feat); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void FacemarkLBFImpl::RandomForest::write(FileStorage fs, int k) { |
|
|
|
void FacemarkLBFImpl::RandomForest::write(FileStorage fs, int k) { |
|
|
@ -1380,7 +1380,7 @@ Mat FacemarkLBFImpl::Regressor::globalRegressionPredict(const Mat &lbf, int stag |
|
|
|
for (int j = 0; j < lbf.cols; j++) y += w_ptr[lbf_ptr[j]]; |
|
|
|
for (int j = 0; j < lbf.cols; j++) y += w_ptr[lbf_ptr[j]]; |
|
|
|
delta_shape(i, 1) = y; |
|
|
|
delta_shape(i, 1) = y; |
|
|
|
} |
|
|
|
} |
|
|
|
return delta_shape; |
|
|
|
return CV_CXX_MOVE(delta_shape); |
|
|
|
} // Regressor::globalRegressionPredict
|
|
|
|
} // Regressor::globalRegressionPredict
|
|
|
|
|
|
|
|
|
|
|
|
Mat FacemarkLBFImpl::Regressor::predict(Mat &img, BBox &bbox) { |
|
|
|
Mat FacemarkLBFImpl::Regressor::predict(Mat &img, BBox &bbox) { |
|
|
|