pixArea {GiNA} | R Documentation |
Finding the average area in pixels for objects
Description
Even not required, the average value area in pixels for the objects analyzed is a parameter of interest when the objects to be analyzed are particularly small such as seeds or extremely small fruits. Therefore, the use of this function provides a plot of the are in pixels for all the objects in the picture for a given cutoff value provided. Once the value has determined this can be provided to the scanCRAN
function in the argument 'minArea' to make the function perform faster.
Usage
pixArea(folder, cutoffvalue = 0.5, cores = 1, square = 10, fact = 0.25)
Arguments
folder |
A path where the pictures are located |
cutoffvalue |
A scalar value where the fruits are distinguishable from the background in the color scale handled by R which is 0-1 |
cores |
A scalar value indicating the number of cores that you want to use for parallelizing the function |
square |
size of the square to brush smaller objects from the picture |
fact |
a scalar value between 0-1 indicating at what extent the picture should be reduced in size in order to make computations faster, by default the pictures are sized at the 25 percent of their original size. If no reduction is required the user should set the argument to 1. |
Value
If parameters are indicated correctly the function returns:
- $plot
a plot showing the size of different objects in the picture in number of pixels.
References
We have spent valuable time developing this package, please cite it in your publication:
Diaz-Garcia L, Covarrubias-Pazaran G, Schlautman B, Zalapa J. GiNA: A flexible high throughput phenotyping tool. http://horticulture.wisc.edu/cggl/ZalapaLab/People.html. 2015.
Examples
library(GiNA)
data(GINA.sample) # RUN
display(GINA.sample)
writeImage(GINA.sample, "gina_cran.JPG") # RUN
folder <- getwd() # RUN
area <- pixArea(folder,cutoffvalue=0.5,cores=1) # RUN!!!