utils_transform {pliman} | R Documentation |
Spatial transformations
Description
Performs image rotation and reflection
-
image autocrop()
Crops automatically an image to the area of objects. -
image_crop()
Crops an image to the desired area. -
image_trim()
Remove pixels from the edges of an image (20 by default). -
image_dimension()
Gives the dimension (width and height) of an image. -
image_rotate()
Rotates the image clockwise by the given angle. -
image_horizontal()
Converts (if needed) an image to a horizontal image. -
image_vertical()
Converts (if needed) an image to a vertical image. -
image_hreflect()
Performs horizontal reflection of theimage
. -
image_vreflect()
Performs vertical reflection of theimage
. -
image_resize()
Resize theimage
. See more atEBImage::resize()
. -
image_contrast()
Improve contrast locally by performing adaptive histogram equalization. See more atEBImage::clahe()
. -
image_dilate()
Performs image dilatation. See more atEBImage::dilate()
. -
image_erode()
Performs image erosion. See more atEBImage::erode()
. -
image_opening()
Performs an erosion followed by a dilation. See more atEBImage::opening()
. -
image_closing()
Performs a dilation followed by an erosion. See more atEBImage::closing()
. -
image_filter()
Performs median filtering in constant time. See more atEBImage::medianFilter()
. -
image_blur()
Performs blurring filter of images. See more atEBImage::gblur()
. -
image_skeleton()
Performs image skeletonization.
Usage
image_autocrop(
img,
index = "NB",
edge = 5,
filter = 3,
parallel = FALSE,
workers = NULL,
verbose = TRUE,
plot = FALSE
)
image_crop(
img,
width = NULL,
height = NULL,
viewer = get_pliman_viewer(),
show = "rgb",
parallel = FALSE,
workers = NULL,
verbose = TRUE,
plot = FALSE
)
image_dimension(img, parallel = FALSE, workers = NULL, verbose = TRUE)
image_rotate(
img,
angle,
bg_col = "white",
parallel = FALSE,
workers = NULL,
verbose = TRUE,
plot = TRUE
)
image_horizontal(
img,
parallel = FALSE,
workers = NULL,
verbose = TRUE,
plot = FALSE
)
image_vertical(
img,
parallel = FALSE,
workers = NULL,
verbose = TRUE,
plot = FALSE
)
image_hreflect(
img,
parallel = FALSE,
workers = NULL,
verbose = TRUE,
plot = FALSE
)
image_vreflect(
img,
parallel = FALSE,
workers = NULL,
verbose = TRUE,
plot = FALSE
)
image_resize(
img,
rel_size = 100,
width,
height,
parallel = FALSE,
workers = NULL,
verbose = TRUE,
plot = FALSE
)
image_trim(
img,
edge = NULL,
top = NULL,
bottom = NULL,
left = NULL,
right = NULL,
parallel = FALSE,
workers = NULL,
verbose = TRUE,
plot = FALSE
)
image_dilate(
img,
kern = NULL,
size = NULL,
shape = "disc",
parallel = FALSE,
workers = NULL,
verbose = TRUE,
plot = FALSE
)
image_erode(
img,
kern = NULL,
size = NULL,
shape = "disc",
parallel = FALSE,
workers = NULL,
verbose = TRUE,
plot = FALSE
)
image_opening(
img,
kern = NULL,
size = NULL,
shape = "disc",
parallel = FALSE,
workers = NULL,
verbose = TRUE,
plot = FALSE
)
image_closing(
img,
kern = NULL,
size = NULL,
shape = "disc",
parallel = FALSE,
workers = NULL,
verbose = TRUE,
plot = FALSE
)
image_skeleton(
img,
kern = NULL,
parallel = FALSE,
workers = NULL,
verbose = TRUE,
plot = FALSE,
...
)
image_thinning(
img,
niter = 3,
parallel = FALSE,
workers = NULL,
verbose = TRUE,
plot = FALSE,
...
)
image_filter(
img,
size = 2,
cache = 512,
parallel = FALSE,
workers = NULL,
verbose = TRUE,
plot = FALSE
)
image_blur(
img,
sigma = 3,
parallel = FALSE,
workers = NULL,
verbose = TRUE,
plot = FALSE
)
image_contrast(
img,
parallel = FALSE,
workers = NULL,
verbose = TRUE,
plot = FALSE
)
Arguments
img |
An image or a list of images of class |
index |
The index to segment the image. See |
edge |
|
filter |
Performs median filtering in the binary image. This is useful
to remove noise (like dust) and improve the image autocropping method. See
more at |
parallel |
Processes the images asynchronously (in parallel) in separate
R sessions running in the background on the same machine. It may speed up
the processing time when |
workers |
A positive numeric scalar or a function specifying the maximum number of parallel processes that can be active at the same time. |
verbose |
If |
plot |
If |
width , height |
|
viewer |
The viewer option. If not provided, the value is retrieved
using |
show |
How to plot in mapview viewer, either |
angle |
The rotation angle in degrees. |
bg_col |
Color used to fill the background pixels, defaults to |
rel_size |
The relative size of the resized image. Defaults to 100. For
example, setting |
top , bottom , left , right |
The number of pixels removed from |
kern |
An |
size |
|
shape |
A character vector indicating the shape of the brush. Can be
|
... |
Additional arguments passed on to |
niter |
The number of iterations to perform in the thinning procedure.
Defaults to 3. Set to |
cache |
The the L2 cache size of the system CPU in kB (integer).
Defaults to |
sigma |
A numeric denoting the standard deviation of the Gaussian filter
used for blurring. Defaults to |
Value
-
image_skeleton()
returns a binaryImage
object. All other functions returns a modified version of
image
depending on theimage_*()
function used.If
image
is a list, a list of the same length will be returned.
Author(s)
Tiago Olivoto tiagoolivoto@gmail.com
Examples
library(pliman)
img <- image_pliman("sev_leaf.jpg")
plot(img)
img <- image_resize(img, 50)
img1 <- image_rotate(img, 45)
img2 <- image_hreflect(img)
img3 <- image_vreflect(img)
img4 <- image_vertical(img)
image_combine(img1, img2, img3, img4)