Skip to content

Commit e4ff619

Browse files
authored
skip compositing of a fully obscured image (#108)
this was causing crashes in multiblend
1 parent 7580590 commit e4ff619

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

xpano/algorithm/stitcher.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,12 @@ Status Stitcher::ComposePanorama(cv::OutputArray pano) {
325325

326326
for (size_t img_idx = 0; img_idx < imgs_.size(); ++img_idx) {
327327
NextTask(ProgressType::kStitchCompose);
328+
if (auto non_zero = cv::countNonZero(masks_warped[img_idx]);
329+
non_zero == 0) {
330+
spdlog::warn("Skipping fully obscured image");
331+
continue;
332+
}
333+
328334
spdlog::trace("Compositing image #{}", indices_[img_idx] + 1);
329335
auto compositing_timer = Timer();
330336

0 commit comments

Comments
 (0)