JuliaImages / ImageSegmentation.jl

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

Fix and test clustering #74

Open timholy opened 2 years ago

timholy commented 2 years ago

This has one breaking change: while the docs advertise that "All the segmentation algorithms (except Fuzzy C-means) return a struct SegmentedImage," that's not been true for kmeans. This changes the output so that kmeans does return a SegmentedImage. This is a breaking change, because the types are not interchangeable. This became apparent when trying to add tests for kmeans, which have been lacking.

Before releasing this, we may want to make a second breaking change: currently, ImageSegmentation provides a new meaning for Matrix{Gray{T}} than Clustering.jl provides for Matrix{T}. This breaks our abstraction that Gray ≈ Number. A way to fix that would be to have ImageSegmentation.kmeans be a different function from Clustering.kmeans, and obviously have the one in ImageSegmentation call the one in Clustering.