Skip to content

Commit

Permalink
docs: impose_minima
Browse files Browse the repository at this point in the history
  • Loading branch information
cpaniaguam authored Nov 8, 2024
1 parent 24f9dde commit 6f3c44c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ function imextendedmin(img::AbstractArray; h::Int=2, conn::Int=2)::BitMatrix
return Bool.(mask_minima)
end

"""
impose_minima(I::AbstractArray{T}, BW::AbstractArray{Bool}) where {T<:Integer}
Use morphological reconstruction to enforce minima on the input image `I` at the positions where the binary mask `BW` is non-zero.
It supports both integer and grayscale images using different implementations for each.
"""
function impose_minima(I::AbstractArray{T}, BW::AbstractArray{Bool}) where {T<:Integer}
marker = 255 .* BW
mask = imcomplement(min.(I .+ 1, 255 .- marker))
Expand Down

0 comments on commit 6f3c44c

Please sign in to comment.