
Last chance! 50% off unlimited learning
Sale ends in
Bucket fill
bucketfill(im, x, y, z = 1, color, opacity = 1, sigma = 0,
high_connexity = FALSE)
an image
X-coordinate of the starting point of the region to fill.
Y-coordinate of the starting point of the region to fill.
Z-coordinate of the starting point of the region to fill.
a vector of values (of length spectrum(im)), or a colour name (e.g. "red"). If missing, use the colour at location (x,y,z).
opacity. If the opacity is below 1, paint with transparency.
Tolerance for neighborhood values: spread to neighbours if difference is less than sigma (for grayscale). If there are several channels, the sum of squared differences is used: if it below sigma^2, the colour spreads.
Use 8-connexity (only for 2d images, default FALSE).
px.flood
# NOT RUN {
#Change the colour of a sail
boats.new <- bucketfill(boats,x=169,y=179,color="pink",sigma=.2)
layout(t(1:2))
plot(boats,main="Original")
plot(boats.new,main="New sails")
#More spreading, lower opacity, colour specified as vector
ugly <- bucketfill(boats,x=169,y=179,color=c(0,1,0),sigma=.6,opacity=.5)
plot(ugly)
# }
Run the code above in your browser using DataLab