image_crop_click {plothelper} | R Documentation |
Cut out a Subregion of an Image by Mouse Click
Description
This function is a wrapper of
magick::image_crop
. While the
latter asks you to set a geometry
parameter, this function enables you
to set the four sides of a subregion only
by click the mouse. You must click at
least 2 times (that is, click on 2 different
points to define a rectangle). After clicking,
please press Esc on your keyboard. You
can also designate an irregular polygon
by mouse with at least 3 clicks. If it is
irregular, you MUST click on positions
in order (something like that, when you
draw a polygon in R, you must input
the positions of points in order).
Usage
image_crop_click(x, only_value = FALSE, rectangle = TRUE, trim = FALSE)
Arguments
x |
an image read into R by
|
only_value |
the default is FALSE, which will return the subregion. If you set it to TRUE, the result is only four values with the order: left, right, top, bottom. |
rectangle |
whether the cropped area is a rectangle (default is TRUE). If it is FALSE, the subregion can be irregular. |
trim |
this is only used when
|