imgInput: Read and plot a tree-ring image file

Description Usage Arguments Details Value Author(s) Examples

Description

This function can read an image file from the hard disk and plot it in a newly-opened graphical device.

Usage

1
2
imgInput(img, dpi = NULL, RGB = c(0.299, 0.587, 0.114), 
         rotate = 0, magick = TRUE)

Arguments

img

A character string indicating the path of the image file. Supported formats include png, tiff, jpg and bmp.

dpi

An integer specifying the dpi of the image file. A minimum of 300 dpi is required when running automatic detection.

RGB

A numeric vector of length 3 giving the weight of RGB color channels.

rotate

An integer specifying how many degrees to rotate (clockwise). It requires one of the following values: 0, 90, 180 or 270.

magick

A logical value. If TRUE, the package magick is used to read images whose file sizes are over 10MB.

Details

Proper image preparation has a great influence on the measurement of ring widths. A tree-ring image should not contain irrelevant or redundant features, such as wooden mounts where cores are glued. The larger the file size of an image, the slower the image processing operation will be.

Pith side of a tree-ring sample should be placed on the right side of the graphical window. Use the argument rotate to change its position.

It is highly recommended to use the default value magick = TRUE, because the package magick can significantly reduce the memory usage.

Value

A magick image object containing the image data.

Author(s)

Jingning Shi

Examples

1
2
3
4
img.path <- system.file("001.png", package = "MtreeRing")

## Read and plot the image:
t1 <- imgInput(img = img.path, dpi = 1200)

JingningShi/GifRepo documentation built on May 14, 2019, 10:59 p.m.