Skip to content

Commit f91b4d8

Browse files
author
Ivar Clemens
committed
Do conversion to grayscale after face detection.
1 parent f5aeecf commit f91b4d8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

modules/face/src/facemarkLBF.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,13 +535,14 @@ Rect FacemarkLBFImpl::getBBox(Mat &img, const Mat_<double> shape) {
535535
void FacemarkLBFImpl::prepareTrainingData(Mat img, std::vector<Point2f> facePoints,
536536
std::vector<Mat> & cropped, std::vector<Mat> & shapes, std::vector<BBox> &boxes)
537537
{
538+
Mat shape;
539+
Mat _shape = Mat(facePoints).reshape(1);
540+
Rect box = getBBox(img, _shape);
541+
538542
if(img.channels()>1){
539543
cvtColor(img,img,COLOR_BGR2GRAY);
540544
}
541545

542-
Mat shape;
543-
Mat _shape = Mat(facePoints).reshape(1);
544-
Rect box = getBBox(img, _shape);
545546
if(box.x != -1){
546547
_shape.convertTo(shape, CV_64FC1);
547548
Mat sx = shape.col(0);

0 commit comments

Comments
 (0)