image_index {pliman}R Documentation

Image indexes

Description

image_index() Builds image indexes using Red, Green, Blue, Red-Edge, and NIR bands.

plot.image_index() produces a raster (type = "raster", default) or a density (type = "density") plot of the index values computed with image_index().

Usage

image_index(
  image,
  index = NULL,
  my_index = NULL,
  resize = FALSE,
  re = NULL,
  nir = NULL,
  show_image = TRUE,
  nrow = NULL,
  ncol = NULL,
  parallel = FALSE,
  workers = NULL,
  verbose = TRUE
)

## S3 method for class 'image_index'
plot(x, type = "raster", nrow = NULL, ncol = NULL, ...)

Arguments

image

An image object.

index

A character value (or a vector of characters) specifying the target mode for conversion to binary image. Use pliman_indexes() or the details section to see the available indexes. Defaults to NULL ((normalized) Red, Green and Blue). One can also use "RGB" for RGB only, "NRGB" for normalized RGB, or "all" for all indexes.

my_index

User can calculate a different index using the bands names, e.g. my_index = "R+B/G".

resize

Resize the image before processing? Defaults to 30, which resizes the image to 30% of the original size to speed up image processing. Set resize = FALSE to keep the original size of the image.

re

Respective position of the red-edge band at the original image file.

nir

Respective position of the near-infrared band at the original image file.

show_image

Show image after processing?

nrow, ncol

The number of rows or columns in the plot grid. Defaults to NULL, i.e., a square grid is produced.

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 image is a list. The number of sections is set up to 70% of available cores.

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 TRUE (default) a summary is shown in the console.

x

An object of class image_index.

type

The type of plot. Use type = "raster" (default) to produce a raster plot showing the intensity of the pixels for each image index or type = "density" to produce a density plot with the pixels' intensity.

...

Currently not used

Details

The following indexes are available in pliman.

Value

A list containing Grayscale images. The length will depend on the number of indexes used.

A trellis object containing the distribution of the pixels for each index.

Author(s)

Tiago Olivoto tiagoolivoto@gmail.com

Tiago Olivoto tiagoolivoto@gmail.com

References

Nobuyuki Otsu, "A threshold selection method from gray-level histograms". IEEE Trans. Sys., Man., Cyber. 9 (1): 62-66. 1979. doi: 10.1109/TSMC.1979.4310076

Examples

library(pliman)
img <- image_pliman("soybean_touch.jpg")
image_index(img, index = c("R, NR"))
library(pliman)
img <- image_pliman("sev_leaf.jpg")

# resize the image to 30% of the original size
ind <- image_index(img, resize = 30, show_image = FALSE)
plot(ind)

[Package pliman version 1.1.0 Index]