Description Usage Arguments Details Value Examples
Select regions of interest in an image using different morphological operations
1 2 | roi_select(img, threshold, shrink = 5, grow = 5, fill = 5,
clean = 5, tolerance = 0.1, n = 1)
|
img |
An object of class |
threshold |
A |
shrink |
A |
grow |
A |
fill |
A |
clean |
A |
tolerance |
A |
n |
A |
The function applies several imager
morphological
manipulations to select the regions of interest. These include
threshold
which sets all values below certain cut to
0; shrink
/grow
for pixel set
dilation and erosion; fill
/clean
for removing isolated regions and holes. When n
is provided, the
individual regions (connected components) are selected where tolerance
is used to determine if two pixels belong to the same region.
A cimg
. The original input img
with an
additional attribute label
. label
is a vector
of
integer
s. The labels for the selected regions of interests starts
from 1 and 0 is ignored. When img
is a list, a list
is
returned.
1 2 3 4 5 6 7 8 9 | # load images
fl <- system.file('extdata', 'Image0001_.jpg', package = 'colocr')
img <- image_load(fl)
# choose ROI
newimg <- roi_select(img, threshold = 90)
# check the ROI labels
unique(attr(newimg, 'label'))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.