ColorG: Identifying the region of interest & changing color of...

Description Usage Arguments Details Value Examples

View source: R/ColorG.R

Description

This function is used to identify the region of interest, and change the color of particular part of an image. Specifically, this function is designed for the plant images taken by the UNL greenhouse system. It helps identify the lower boundary of the region of interest and change the color of the green strip of an empty pot from green to white. See example image:

Usage

1
2
ColorG (image, rowThreshold = 0.007, block = 5, Tol = 2, Bthreshold = 60 / 255,
EGThreshold = 0.1, weight = c(-1, 2, -1), changeto = c(1, 1, 1))

Arguments

image

matrix of pixels of the image for processing.

rowThreshold

positive real number, which is the threshold value of each row.

block

postive integer, which is the moving average of average pixels of each row of the matrix of the matrix.

Tol

small number. Essentially, this argument to add the tolarance when identifying the lower boundary of the region of interest.

Bthreshold

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

EGThreshold

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

weight

3 by 1 numeric vector. The three elements indicate the weight of the pixel intensities of R,G,B, respectively. In default, it takes the value of c(-1,2,-1), which helps to construct a relative green ratio.

changeto

numeric vector, in which elements refer to the pixel intensities of the colors you want each channel of the eliminated part changed to, respectivley.

Details

In the example part, this function helps identify the lower boundary of the region of interest, and eliminate the green strip of an empty pot by changing its color from green to white.

Value

uppb

upper bound of the region of interest.

lowb

lower bound of the region of interest.

rowmean

proportion of the signals of the green strip appear in each row of pixel matrix of the image.

c

matrix of pixels of the processed image.

Examples

1
2
3
ColorG (image, rowThreshold = 0.007, block = 5, Tol = 2, Bthreshold = 60 / 255,
EGThreshold = 0.1, weight = c(-1, 2, -1), changeto = c(1, 1, 1))
writePNG(image, "~/Desktop/Visible/imageColorG.png")

rwang14/implant documentation built on Dec. 9, 2019, 6:36 p.m.