You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below is self-contained example of image_connect assigning the same number to two pixels that are not connected. It only happens when there are too many components as determined by N.
library(magick)
N<-21# must be odd to get a grid instead of stripsw<- image_blank(N, N, color="white")
b<- image_blank(1, 1, color="black")
get_row<-function(i) i%%Nget_col<-function(i) i%/%N# NxN alternating 1x1 white and black squaresbw<- Reduce(function(w, i) {
w2<- image_composite(w, b, offset= paste0("+", get_row(i), "+", get_col(i)) )
image_destroy(w)
w2 },
seq(1, N*N, by=2),
w)
# bw %>% image_resize("400%") %>% image_browse# FALSE for N >= 17 when there are collisions but# TRUE for N <= 15 when there are no collisions
image_connect(bw) %>%
image_raster %>%
(function(x) all(table(x$col) ==1) )
image_connect could output a color image to encode components after component number 255. Or if that's not possible without changing the c++, I would like a warning that there are too many components for each to get a unique number.
The text was updated successfully, but these errors were encountered:
Below is self-contained example of
image_connect
assigning the same number to two pixels that are not connected. It only happens when there are too many components as determined by N.image_connect
could output a color image to encode components after component number 255. Or if that's not possible without changing the c++, I would like a warning that there are too many components for each to get a unique number.The text was updated successfully, but these errors were encountered: