Skip to content

Commit 029c283

Browse files
committed
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
2 parents 4fc6995 + 4613c51 commit 029c283

File tree

4 files changed

+84
-192
lines changed

4 files changed

+84
-192
lines changed

modules/aruco/samples/tutorial_charuco_create_detect.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static bool readCameraParameters(std::string filename, cv::Mat& camMatrix, cv::M
2121
return false;
2222
fs["camera_matrix"] >> camMatrix;
2323
fs["distortion_coefficients"] >> distCoeffs;
24-
return true;
24+
return (camMatrix.size() == cv::Size(3,3)) ;
2525
}
2626

2727
void createBoard()
@@ -161,4 +161,4 @@ int main(int argc, char* argv[])
161161
break;
162162
}
163163
return 0;
164-
}
164+
}

modules/face/src/facemarkLBF.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,9 @@ void FacemarkLBFImpl::training(void* parameters){
332332
CV_Error(Error::StsBadArg, "Training data is not provided. Consider to add using addTrainingSample() function!");
333333
}
334334

335-
if (params.cascade_face.empty() || (params.model_filename.empty() && params.save_model))
335+
if (params.model_filename.empty() && params.save_model)
336336
{
337-
CV_Error(Error::StsBadArg, "The parameter cascade_face and model_filename should be set!");
337+
CV_Error(Error::StsBadArg, "The parameter model_filename should be set!");
338338
}
339339

340340
// flip the image and swap the landmark position
@@ -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)