utils_pick {pliman} | R Documentation |
Utilities for picking up points in an image
Description
-
pick_count()
opens an interactive section where the user will be able to click in the image to count objects (points) manually. In each mouse click, a point is drawn and an upward counter is shown in the console. Aftern
counts or after the user press Esc, the interactive process is terminated and the number of counts is returned. -
pick_coord()
Picks coordinates from the image -
pick_palette()
creates an image palette by picking up color point(s) from the image. -
pick_rgb()
Picks up the RGB values from selected point(s) in the image.
Usage
pick_count(
img,
n = Inf,
col = "red",
viewer = get_pliman_viewer(),
size = 0.8,
plot = TRUE,
verbose = TRUE
)
pick_coords(
img,
n = Inf,
col = "red",
viewer = get_pliman_viewer(),
size = 0.8,
verbose = TRUE
)
pick_rgb(
img,
n = Inf,
col = "red",
viewer = get_pliman_viewer(),
size = 0.8,
plot = TRUE,
verbose = TRUE
)
pick_palette(
img,
n = Inf,
r = 1,
shape = "box",
viewer = get_pliman_viewer(),
show = "rgb",
title = "Pick colors in the image",
index = "B",
random = TRUE,
width = 100,
height = 100,
col = "red",
size = 0.8,
plot = TRUE,
palette = TRUE,
verbose = TRUE
)
Arguments
img |
An |
n |
The number of points of the |
col , size |
The color and size for the marker point. |
viewer |
The viewer option. If not provided, the value is retrieved
using |
plot |
Call a new |
verbose |
If |
r |
The radius of neighborhood pixels. Defaults to |
shape |
A character vector indicating the shape of the brush around the
selected pixel. It can be |
show |
How to plot in mapview viewer, either |
title |
The title of the map view when |
index |
The index to use for the index view. Defaults to 'B'. |
random |
Randomize the selected pixels? Defaults to |
width , height |
The width and height of the generated palette. Defaults
to |
palette |
Plot the generated palette? Defaults to |
Value
-
pick_count()
returnsdata.frame
with thex
andy
coordinates of the selected point(x). -
pick_rgb()
returns adata.frame
with the R, G, and B values of the selected point(s). -
pick_palette()
returns an object of classImage
.
Author(s)
Tiago Olivoto tiagoolivoto@gmail.com
Examples
if(interactive()){
library(pliman)
img <- image_pliman("soybean_touch.jpg")
# start a counting process
pick_count(img)
# get rgb from point(s)
pick_rgb(img)
# create a palette from point(s)
pick_palette(img)
}