JuliaImages / ImageSegmentation.jl

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

Add a warning for in-place `flood_fill!` #82

Closed timholy closed 3 years ago

timholy commented 3 years ago

In-place fills have a risk of being incomplete if there is any chance that the fillval is already present in src. This conservatively adds a warning. There may be cases where this warning isn't needed, if the user has special knowledge that the values are actually distinct. But if so, it doesn't seem unreasonable to encourage the user to exclude them from f.

This deletes one previous test, because the fact that it works is very particular (it depends on starting at the one-and-only connected entry with value fillvalue). The new warning gets triggered in that former test, and that's probably a good thing.