Description Usage Arguments Details Value Examples
This function uses the Double-Criterion Thresholding method (DCT) to segment the object of study from the background of an image, and tranform the image to a binary image, i.e., a black and white image.
1 2 | imageBinary(image, weight = c(-1, 2, -1), threshold1 = 30 / 255,
threshold2 = 0.075)
|
image |
an array of pixels of the image for processing. |
weight |
a 3 by 1 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. |
threshold1,threshold2 |
Values between 0 and 1. threshold1 is applied to the sum of the RGB intensities. threshold2 is applied on the contrast intensity by the specified weight in the function. |
The plant pixels are classified as the intersection of sum of RGB intensities larger than threshold 1 and green intensities larger than threshold 2.
A matrix of the processed image.
1 2 3 4 5 6 7 | #read an RGB image
library(png)
image = readPNG(system.file("extdata", "image1.png",
package = "implant",
mustWork = TRUE))[ , ,c(1:3)]
imageB = imageBinary(image, weight = c(-1, 2, -1),
threshold1 = 30 / 255, threshold2 = 0.05)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.