Skip to content

Commit

Permalink
feat: add fillholes! get_segment_mask
Browse files Browse the repository at this point in the history
  • Loading branch information
cpaniaguam committed Nov 7, 2024
1 parent 644d1f0 commit 93ca822
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/segmentation_a_direct.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,19 @@ function get_holes(img, min_opening_area=20, se=IceFloeTracker.se_disk4())
out = IceFloeTracker.MorphSE.fill_holes(out)

return out .!= img
end

function fillholes!(img)
img[get_holes(img)] .= true
return nothing
end

function get_segment_mask(ice_mask, tiled_binmask)
Threads.@threads for img in (ice_mask, tiled_binmask)
fillholes!(img)
end
segment_mask = ice_mask .&& tiled_binmask
return segment_mask
end

function branchbridge(img)
Expand Down

0 comments on commit 93ca822

Please sign in to comment.