
Colour segmentation by k-means on pixels (Geron Ch 8, morie.fn hmiseg)
Source:R/geron_w4b_native.R
morie_geron_image_segmentation.RdColour segmentation by k-means on pixels (Geron Ch 8, morie.fn hmiseg)
Examples
morie_geron_image_segmentation(image = matrix(c(1, 2, 3, 4, 5, 6), nrow = 2), n_clusters = 5L)
#> $segmented
#> , , 1
#>
#> [,1] [,2] [,3]
#> [1,] 1 3 5.5
#> [2,] 2 4 5.5
#>
#>
#> $labels
#> [,1] [,2] [,3]
#> [1,] 4 2 1
#> [2,] 0 3 1
#>
#> $palette
#> [,1]
#> [1,] 2.0
#> [2,] 5.5
#> [3,] 3.0
#> [4,] 4.0
#> [5,] 1.0
#>
#> $inertia
#> [1] 0.5
#>
#> $compression_ratio
#> [1] 1.2
#>
#> $estimate
#> [1] 0.5
#>
#> $n
#> [1] 6
#>
#> $method
#> [1] "Colour segmentation by k-means on pixels"
#>