我使用C++中的OpenCV人脸检测器来代替dlib的检测器进行人脸对齐,因为dlib的检测器速度较慢。
要使用dlib的人脸对齐功能,我必须将检测到的矩形传递给人脸对齐函数。
然而,即使dlib的检测器正常工作,我也无法做到这一点。
因为dlib的示例代码中使用了std::vector<rectangle> dets
,我尝试按照下面所示的方式进行赋值,但是失败了。
请注意,detect_rect
是由OpenCV检测器检测到的人脸矩形。
dets[0].l = detect_rect.left;
dets[0].t = detect_rect.top;
dets[0].r = detect_rect.right;
dets[0].b = detect_rect.bottom;
你能给我一些建议吗?
谢谢。
.l = rect.x;
.t = rect.y;
.r = imageWidth - (rect.x+rect.width);
.b = imageHeight - (rect.y+rect.height);
- Mickarectangle rect(left, top, right, bottom);``dets.push_back(rect);
谢谢! - univ_student