make_mask | R Documentation |
Make a mask using an Image
object and a brush.
make_mask(img, brush, rel_pos_x = 0.5, rel_pos_y = 0.5, plot = TRUE)
img |
A |
brush |
An object created with |
rel_pos_x, rel_pos_y |
A relative position to include the brush in the image. Defaults to 0.5. This means that the brush will be centered in the original image. Smaller values move the brush toward the left and top, respectively. |
plot |
Plots the generated mask? Defaults to |
It applies a brush to an Image, selecting the Image
pixels that match the
brush values equal to 1. The position of the brush in the original image is
controlled by the relative positions x (rel_pos_x
) and y (rel_pos_y
)
arguments. The size of the brush must be smaller or equal to the smaller
dimension of image
.
A binary image with 0s and 1s.
img <- image_pliman("soybean_touch.jpg")
make_mask(img, brush = make_brush(size = 201))
make_mask(img,
brush = make_brush(size = 401, shape = "diamond"),
rel_pos_x = 0.1,
rel_pos_y = 0.8)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.