Skip to content

Commit

Permalink
update:calc blockage_ratio by multi frame blockage mask
Browse files Browse the repository at this point in the history
Signed-off-by: swift_file <sky.y.m.318@gmail.com>
  • Loading branch information
swiftfile committed Jun 22, 2022
1 parent 451833e commit 52c78bb
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,7 @@ void BlockageDiagComponent::filter(
cv::Point(erode_kernel_, erode_kernel_));
cv::erode(no_return_mask, erosion_dst, element);
cv::dilate(erosion_dst, no_return_mask, element);
cv::Mat ground_no_return_mask;
cv::Mat sky_no_return_mask;
no_return_mask(cv::Rect(0, 0, horizontal_bins, horizontal_ring_id_)).copyTo(sky_no_return_mask);
no_return_mask(
cv::Rect(0, horizontal_ring_id_, horizontal_bins, vertical_bins - horizontal_ring_id_))
.copyTo(ground_no_return_mask);


static boost::circular_buffer<cv::Mat> no_return_mask_buffer(buffering_frames_);

Expand All @@ -191,6 +186,12 @@ void BlockageDiagComponent::filter(
} else {
no_return_mask.copyTo(no_return_mask_result);
}
cv::Mat ground_no_return_mask;
cv::Mat sky_no_return_mask;
no_return_mask_result(cv::Rect(0, 0, horizontal_bins, horizontal_ring_id_)).copyTo(sky_no_return_mask);
no_return_mask_result(
cv::Rect(0, horizontal_ring_id_, horizontal_bins, vertical_bins - horizontal_ring_id_))
.copyTo(ground_no_return_mask);
ground_blockage_ratio_ =
static_cast<float>(cv::countNonZero(ground_no_return_mask)) /
static_cast<float>(horizontal_bins * (vertical_bins - horizontal_ring_id_));
Expand Down

0 comments on commit 52c78bb

Please sign in to comment.