JuliaImages / ImageSegmentation.jl

Partitioning images into meaningful regions
Other
47 stars 23 forks source link

unseeded_region_growing does not accept array of Real while seeded does #92

Open aramirezreyes opened 1 year ago

aramirezreyes commented 1 year ago

unseeded_region_growing does not work with an array of numbers. It requires an array of Colorant. On the other hand, the seeded_region_growing counterpart does work.

The solution seems pretty simple, would a PR be welcome or are there reasons why this is not desirable?

using ImageSegmentation
a = zeros(10,10)
a[3:3,3:3] .= 1
unseeded_region_growing(a, 0.1)
MethodError: no method matching unseeded_region_growing(::Matrix{Float64}, ::Float64)

Closest candidates are:
  unseeded_region_growing(::AbstractArray, ::Real, ::Vector{Int64})
   @ ImageSegmentation deprecated.jl:103
  unseeded_region_growing(::AbstractArray, ::Real, ::Vector{Int64}, ::Function)
   @ ImageSegmentation deprecated.jl:103
  unseeded_region_growing(::AbstractArray{CT, N}, ::Real) where {CT<:ColorTypes.Colorant, N}
   @ ImageSegmentation ~/.julia/packages/ImageSegmentation/oFzSR/src/region_growing.jl:235
  ...

Stacktrace:
 [1] top-level scope
   @ In[63]:4