ColorB: Identifying the region of interest (left and right...

Description Usage Arguments Value Examples

View source: R/ColorB.R

Description

This function is specifically designed for processing the plant images taken in the University of Nebraska-Lincoln (UNL) greenhouse Innovation Center. It identifies the left and right boundaries of the black bars of the background and help users identify the region of interest for the plants. See image1.png in the example data.

Usage

1
ColorB(image, colThreshold = 0.5)

Arguments

image

an RGB image of plant.

colThreshold

a positive real number, which is the used to identify the black bars appear in the columns of the image.

Value

lb

left bound for the region of interest.

rb

right bound for the region of the interest.

c

A modified image replacing all the area outside the region of interest by white color.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#read an RGB image
library(png)
image = readPNG(system.file("extdata", "image1.png",
                             package = "implant",
                             mustWork = TRUE))[ , ,c(1:3)]
writePNG(image,"~/imageOriginal.png")
resultColor = ColorB(image)
bound = c(resultColor$lb, resultColor$rb)
imageColor = resultColor$c
writePNG(imageColor,"~/imageColor.png")

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