image_label | R Documentation |
This function labels connected components in a binary image while allowing for a specified maximum gap between pixels to still be considered part of the same object.
image_label(img, max_gap = 0)
img |
A binary image matrix where |
max_gap |
An integer specifying the maximum allowable gap (in pixels)
between connected components to be considered as part of the same object.
Default is |
An object of class Image
(from the EBImage package), where each
connected component is assigned a unique integer label.
if(interactive()){
library(pliman)
img <- matrix(c(
1, 1, 0, 0, 0, 1, 1, 1, 0,
0, 0, 0, 0, 0, 1, 0, 0, 0,
1, 1, 0, 0, 1, 1, 1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1
), nrow = 4, byrow = TRUE)
image_label(img, max_gap = 1)
image_label(img, max_gap = 2)
image_label(img, max_gap = 3)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.