输出中间边框

来源:互联网 发布:linux如何增加新命令 编辑:程序博客网 时间:2024/05/01 17:33

   

通过边框位置在原图显示,用rectangle函数,

颜色还可以表示置信度,越绿越可能是人脸。



cv::Mat img_ = cv::imread("E://7.jpg");    bounding_box_ = bounding_box;//for (int i = 0; i < bounding_box_.size();i++) {//rectangle(img_, bounding_box_[i], 3);//}    confidence_ = confidence;int green = confidence_[i] * 255;int red = (1 - confidence_[i]) * 255;for (int i = 0; i < bounding_box_.size(); i++) {rectangle(img_, bounding_box_[i], cv::Scalar(0, green, red), 3);}