From faa5eb4494db193a63238b4eefe401f1f05256a5 Mon Sep 17 00:00:00 2001 From: Camilo De La Torre <64303300+camilodlt@users.noreply.github.com> Date: Wed, 22 May 2024 00:15:28 +0200 Subject: [PATCH] Don't accept NaN as a threshold for unseeded_region_growing --- src/region_growing.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/region_growing.jl b/src/region_growing.jl index d2ecacc..3f63bb5 100644 --- a/src/region_growing.jl +++ b/src/region_growing.jl @@ -238,6 +238,7 @@ function unseeded_region_growing(img::AbstractArray{CT,N}, threshold::Real, end function unseeded_region_growing(img::AbstractArray{CT,N}, threshold::Real, neighbourhood::Function, diff_fn::Function = default_diff_fn) where {CT<:Colorant,N} + @assert !isnan(threshold) "The threshold can't be a NaN value, it'll result in an instance per pixel" TM = meantype(CT) # Fast linear<->cartesian indexing lookup