diff --git a/src/utils.jl b/src/utils.jl index 62a60a8d..abb27f8f 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -120,35 +120,6 @@ function imextendedmin(img::AbstractArray, h::Int=2, conn::Int=2)::BitMatrix return mask_minima .> 0 end -function impose_minima(I::AbstractArray{T}, BW::AbstractArray{Bool}) where {T<:Integer} - marker = 255 .* BW - mask = imcomplement(min.(I .+ 1, 255 .- marker)) - reconstructed = IceFloeTracker.MorphSE.mreconstruct( - IceFloeTracker.MorphSE.dilate, marker, mask - ) - return IceFloeTracker.imcomplement(Int.(reconstructed)) -end - -function impose_minima( - I::AbstractArray{T}, BW::AbstractMatrix{Bool} -) where {T<:AbstractFloat} - # compute shift - a, b = extrema(I) - rng = b - a - h = rng == 0 ? 0.1 : rng / 1000 - - marker = -Inf * BW .+ (Inf * .!BW) - mask = min.(I .+ h, marker) - - return 1 .- IceFloeTracker.MorphSE.mreconstruct( - IceFloeTracker.MorphSE.dilate, 1 .- marker, 1 .- mask - ) -end - -function imregionalmin(A, conn=2) - return ImageMorphology.local_minima(A; connectivity=conn) .> 0 -end - """ impose_minima(I::AbstractArray{T}, BW::AbstractArray{Bool}) where {T<:Integer}