utils_pick {pliman}R Documentation

Utilities for picking up points in an image

Description

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 Image object.

n

The number of points of the ⁠pick_*⁠ function. Defaults to Inf. This means that picking will run until the user press Esc.

col, size

The color and size for the marker point.

viewer

The viewer option. If not provided, the value is retrieved using get_pliman_viewer(). This option controls the type of viewer to use for interactive plotting. The available options are "base" and "mapview". If set to "base", the base R graphics system is used for interactive plotting. If set to "mapview", the mapview package is used. To set this argument globally for all functions in the package, you can use the set_pliman_viewer() function. For example, you can run set_pliman_viewer("mapview") to set the viewer option to "mapview" for all functions.

plot

Call a new plot(img) before processing? Defaults to TRUE.

verbose

If TRUE (default) shows a counter in the console.

r

The radius of neighborhood pixels. Defaults to 1.

shape

A character vector indicating the shape of the brush around the selected pixel. It can be "box", "disc", "diamond", "Gaussian" or "line". Defaults to "box". In this case, if 'r = 1', all the 8 surrounding pixels are sampled. Setting to "disc" and increasing the radius (r) will select surrounding pixels towards the format of a sphere around the selected pixel.

show

How to plot in mapview viewer, either ⁠'rgb⁠ or 'index'.

title

The title of the map view when vieweris used.

index

The index to use for the index view. Defaults to 'B'.

random

Randomize the selected pixels? Defaults to TRUE.

width, height

The width and height of the generated palette. Defaults to 100 for both, i.e., a square image of 100 x 100.

palette

Plot the generated palette? Defaults to TRUE.

Value

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)
}

[Package pliman version 2.1.0 Index]