ColorG: Identifying the region of interest (lower bound) for a plant...

Description Usage Arguments Details Value Examples

View source: R/ColorG.R

Description

This function is specifically designed for processing the plant images taken in the University of Nebraska-Lincoln (UNL) greenhouse Innovation Center. It helps identify the lower boundary of the plant by using images of empty pot with a plastic green bar. See the sample image: image_pot.png.

Usage

1
2
ColorG (imagefile, rowThreshold = 0.007, Bthreshold = 60 / 255,
EGThreshold = 0.1, weight = c(-1, 2, -1))

Arguments

imagefile

an input RGB image of the empty pot

rowThreshold

a positive real number, used to identify the position of the green strip in the empty pot.

Bthreshold

a value between 0 and 1. It is applied to the sum of the RGB intensities.

EGThreshold

a value between 0 and 1. It is applied to the contrast intensity by the specified weight in the function.

weight

a 3 by 1 numeric vector. The three elements indicate the weight of the pixel intensities of R, G, B, respectively. In default, it takes weight c(-1,2,-1), for contrast intensity.

Details

In the example part, this function identifies the green strip in an empty pot, which can be considered as the lower boundary of a plant, and change the color of the green strip from green to white.

Value

lowb

lower bound of the region of interest.

c

output image with changed color on the green strip.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#read an RGB image
library(png)
imageX = readPNG(system.file("extdata", "image_pot.png",
                             package = "implant",
                             mustWork = TRUE))[ , ,c(1:3)]
writePNG(imageX,"~/imageX.png")
tempG = ColorG (imagefile = imageX, rowThreshold = 0.007, Bthreshold = 60 / 255,
EGThreshold = 0.1, weight = c(-1, 2, -1))
tempG$c
tempG$lowb

rwang14/implant documentation built on Sept. 6, 2020, 3:21 a.m.