mirror of
https://github.com/opencv/opencv_contrib.git
synced 2025-10-17 07:04:18 +08:00
Merge pull request #2953 from iclemens:lbf_dont_convert_to_grayscale
This commit is contained in:
@@ -535,13 +535,14 @@ Rect FacemarkLBFImpl::getBBox(Mat &img, const Mat_<double> shape) {
|
||||
void FacemarkLBFImpl::prepareTrainingData(Mat img, std::vector<Point2f> facePoints,
|
||||
std::vector<Mat> & cropped, std::vector<Mat> & shapes, std::vector<BBox> &boxes)
|
||||
{
|
||||
Mat shape;
|
||||
Mat _shape = Mat(facePoints).reshape(1);
|
||||
Rect box = getBBox(img, _shape);
|
||||
|
||||
if(img.channels()>1){
|
||||
cvtColor(img,img,COLOR_BGR2GRAY);
|
||||
}
|
||||
|
||||
Mat shape;
|
||||
Mat _shape = Mat(facePoints).reshape(1);
|
||||
Rect box = getBBox(img, _shape);
|
||||
if(box.x != -1){
|
||||
_shape.convertTo(shape, CV_64FC1);
|
||||
Mat sx = shape.col(0);
|
||||
|
Reference in New Issue
Block a user