Force ROI for Facemark to be square
This seems to help with Facemark accuracy.
This commit is contained in:
parent
6429ff82cd
commit
a58e7d9428
7
TODO.md
7
TODO.md
|
@ -4,7 +4,8 @@
|
||||||
- smoothing
|
- smoothing
|
||||||
|
|
||||||
## docs
|
## docs
|
||||||
- model format documentation
|
- getting started guide
|
||||||
|
- demo video?
|
||||||
|
|
||||||
## vision
|
## models
|
||||||
- fix worse facemark on dnn mode (maybe due to non-square roi?)
|
- better default model
|
||||||
|
|
|
@ -83,10 +83,18 @@ void cvFrame() {
|
||||||
biggestFace = i;
|
biggestFace = i;
|
||||||
biggestArea = iArea;
|
biggestArea = iArea;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//force ROI to be square
|
||||||
|
faces[i] = cv::Rect(faces[i].x + faces[i].width / 2 - faces[i].height / 2,
|
||||||
|
faces[i].y,
|
||||||
|
faces[i].height,
|
||||||
|
faces[i].height);
|
||||||
|
|
||||||
cv::rectangle (frame, faces[i], cv::Scalar (255, 255, 0));
|
cv::rectangle (frame, faces[i], cv::Scalar (255, 255, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: make a pointer to faces[biggestFace] and use that
|
||||||
|
|
||||||
std::vector<std::vector<cv::Point2f>> landmarks;
|
std::vector<std::vector<cv::Point2f>> landmarks;
|
||||||
|
|
||||||
if (facemark->fit (frame, faces, landmarks)) {
|
if (facemark->fit (frame, faces, landmarks)) {
|
||||||
|
|
Loading…
Reference in a new issue