人脸检测期间的多个边界框

时间:2015-04-17 10:35:34

标签: c++ opencv

在人脸检测中,我尝试将Frontal和Profile探测器组合在一起(使用Viola-Jones方法)。但是,系统有一个单独的面的两个不同的边界框。我使用了groupRectangles函数,它没有产生一个有界框的预期结果而不是两个。请回答一些关于这个问题的建议吗?

1 个答案:

答案 0 :(得分:0)

我认为Micka想要编写按位操作而不是逻辑操作:

if((profileFace & frontFace).width > 0) 
    combinedFace = profileFace | frontFace; 

或者,如果矩形的重叠非常大,则可以合并矩形,即:

cv::Rect intersection = profileFace & frontFace;

// If the intersection is more then 80%, then use their intersection for further processing
if(std::min(intersection.area() / profileFace.area(), (intersection.area()) / frontFace.area()) > 0.8) {
    ...
}