image_segment_mask | R Documentation |
Image
object using a brush maskIt combines make_mask()
and make_brush()
to segment an Image
object
using a brush of desired size, shape, and position.
image_segment_mask(
img,
size,
shape = "disc",
rel_pos_x = 0.5,
rel_pos_y = 0.5,
type = c("binary", "shadow"),
col_background = "white",
plot = TRUE,
...
)
img |
A |
size |
A numeric containing the size of the brush in pixels. This should be an odd number; even numbers are rounded to the next odd one. |
shape |
A character vector indicating the shape of the brush. Can be
|
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. |
type |
Defines the type of the mask. By default, a binary mask is
applied. This results in white pixels in the original image that matches
the 0s pixels in the brush. If |
col_background |
Background color after image segmentation. Defaults to
|
plot |
Plots the generated mask? Defaults to |
... |
Further arguments passed on to |
A color Image
object
img <- image_pliman("soybean_touch.jpg")
plot(img)
image_segment_mask(img, size = 601)
image_segment_mask(img,
size = 401,
shape = "diamond",
rel_pos_x = 0,
rel_pos_y = 0,
type = "shadow")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.