使用旧版候选区寻找方式。
This commit is contained in:
@@ -18,8 +18,7 @@ void showArmorBoxVector(std::string windows_name, const cv::Mat &src, const std:
|
||||
imshow(windows_name, image2show);
|
||||
}
|
||||
|
||||
void showArmorBoxClass(std::string windows_name, const cv::Mat &src, vector<cv::Rect2d> boxes_one,
|
||||
vector<cv::Rect2d> boxes_two, vector<cv::Rect2d> boxes_three){
|
||||
void showArmorBoxClass(std::string window_names, const cv::Mat &src, vector<cv::Rect2d> boxes[10]){
|
||||
static Mat image2show;
|
||||
if (src.type() == CV_8UC1) // 黑白图像
|
||||
{
|
||||
@@ -28,16 +27,32 @@ void showArmorBoxClass(std::string windows_name, const cv::Mat &src, vector<cv::
|
||||
{
|
||||
image2show = src.clone();
|
||||
}
|
||||
for (auto &box:boxes_one) {
|
||||
rectangle(image2show, box, Scalar(255, 0, 0), 1);
|
||||
if(!boxes[0].empty()){
|
||||
for(auto box : boxes[0]){
|
||||
cv::rectangle(image2show, box, Scalar(255, 0, 0), 1);
|
||||
}
|
||||
}else if(!boxes[1].empty()){
|
||||
for(auto box : boxes[1]){
|
||||
cv::rectangle(image2show, box, Scalar(0, 255, 0), 1);
|
||||
}
|
||||
}else if(!boxes[2].empty()){
|
||||
for(auto box : boxes[2]){
|
||||
cv::rectangle(image2show, box, Scalar(0, 0, 255), 1);
|
||||
}
|
||||
}else if(!boxes[3].empty()){
|
||||
for(auto box : boxes[3]){
|
||||
cv::rectangle(image2show, box, Scalar(0, 255, 255), 1);
|
||||
}
|
||||
}else if(!boxes[4].empty()){
|
||||
for(auto box : boxes[4]){
|
||||
cv::rectangle(image2show, box, Scalar(255, 0, 255), 1);
|
||||
}
|
||||
}else if(!boxes[5].empty()){
|
||||
for(auto box : boxes[5]){
|
||||
cv::rectangle(image2show, box, Scalar(255, 255, 0), 1);
|
||||
}
|
||||
}
|
||||
for (auto &box:boxes_two) {
|
||||
rectangle(image2show, box, Scalar(0, 255, 0), 1);
|
||||
}
|
||||
for (auto &box:boxes_three) {
|
||||
rectangle(image2show, box, Scalar(0, 0, 255), 1);
|
||||
}
|
||||
imshow(windows_name, image2show);
|
||||
imshow(window_names, image2show);
|
||||
}
|
||||
|
||||
void showArmorBox(std::string windows_name, const cv::Mat &src, cv::Rect2d armor_box) {
|
||||
|
||||
Reference in New Issue
Block a user