getExposure {phenopix} | R Documentation |
Extract exposure from stardot (or similar) images
Description
This function allows to extract exposure from a set of binary images. It is currently optimized for stardot cameras.
Usage
getExposure(ipath, coords, train.data=FALSE, date.code, sample=NULL, begin=NULL)
Arguments
ipath |
The absolute path to a folder of JPEG binary images, as converted from RGB with the function |
coords |
A named vector with 4 coordinates (x1, x2, y1, y2), as obtained from
|
train.data |
A named list with ten sample numbers and letter E, as obtained from |
date.code |
As in function |
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>