Merge remote-tracking branch 'origin/master'

This commit is contained in:
xinyang
2019-07-23 15:17:00 +08:00
2 changed files with 3 additions and 1 deletions

View File

@@ -150,7 +150,7 @@ bool ArmorFinder::findArmorBox(const cv::Mat &src, ArmorBox &box) {
char filename[100];
sprintf(filename, PROJECT_DIR"/armor_box_photo/%s_%d.jpg", id2name[one_box.id].data(),
time(nullptr) + clock());
cv::imwrite(filename, src(armor_box.rect));
cv::imwrite(filename, src(armor_box.rect & cv::Rect2d(0, 0, src.rows, src.cols)));
}
}
if (box.rect == cv::Rect2d(0, 0, 0, 0)) {

View File

@@ -128,9 +128,11 @@ bool ArmorFinder::findLightBlobs(const cv::Mat &src, LightBlobs &light_blobs) {
cv::threshold(color_channel, src_bin_light, 200, 255, CV_THRESH_BINARY); // 二值化对应通道
if(src_bin_light.empty()) return false;
imagePreProcess(src_bin_light); // 开闭运算
cv::threshold(color_channel, src_bin_dim, 160, 255, CV_THRESH_BINARY); // 二值化对应通道
if(src_bin_dim.empty()) return false;
imagePreProcess(src_bin_dim); // 开闭运算
if(src_bin_light.size() == cv::Size(640, 480) && show_light_blobs) {