make_mask {pliman} | R Documentation |
Makes a mask in an image
Description
Make a mask using an Image
object and a brush.
Usage
make_mask(img, brush, rel_pos_x = 0.5, rel_pos_y = 0.5, plot = TRUE)
Arguments
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 |
Details
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
.
Value
A binary image with 0s and 1s.
Examples
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)
[Package pliman version 2.1.0 Index]