getExposure: Extract exposure from stardot (or similar) images

Description Usage Arguments Details Author(s) See Also

View source: R/getExposure.R

Description

This function allows to extract exposure from a set of binary images. It is currently optimized for stardot cameras.

Usage

1
getExposure(ipath, coords, train.data=FALSE, date.code, sample=NULL)

Arguments

ipath

The absolute path to a folder of JPEG binary images, as converted from RGB with the function binaryConvert()

coords

A named vector with 4 coordinates (x1, x2, y1, y2), as obtained from getCoords().

train.data

A named list with ten sample numbers and letter E, as obtained from trainOCR().

date.code

As in function extractDateFilename() in this package, to convert image names in POSIX vector.

sample

If NULL (default) all images in the folder are processed, otherwise an integer specifying how many files must be processed. This is useful if you want to check some extractions without processing the whole folder.

begin

The user can provide a beginning date as a character string in the form 'YYYY-MM-DD'. Images with a time stamp earlier than the provided date will be discarded. Default is NULL and the whole time series will be processed. Useful when updating an existing time series.

Details

This function performs a simplified OCR procedure to recognize numbers in a binary image. To do so, a full RGB image is first converted in binary (b/w) internally. Then the coordinates to crop the Exposure record are retrieved with getCoords() and, finally, the computation is done with getExposure. Before doing so you have to train the OCR with sample numbers. See trainOCR() for details. The procedure is based on simple matrix matching. The Exposure string is splitted into the digits that constitute it and then each digit is compared to the samples from the training. Finally, a dataframe is extracted with filenames in the first column, exposure in the second one and a POSIX vector in the third.

Author(s)

Gianluca Filippa <gian.filippa@gmail.com>

See Also

getCoords


gianlucafilippa/phenopix documentation built on Nov. 4, 2019, 1:06 p.m.