Learn R Programming

CropDetectR (version 0.0.1)

make_bw: Changes a grayscale image to black and white

Description

Takes in a grayscale image and finds the best threshold for binarization of the image.

Usage

make_bw(image)

Arguments

image

The image generated after the ExG transformation in the EBImage format.

Value

A binary image

Details

This function uses the https://github.com/aoles/EBImage/blob/master/R/otsu.R otsu function from EBImage to make the grayscale image into a binary black and white image. How the otsu transformation works and chooses the threshold can be understood more clearly at http://www.labbookpages.co.uk/software/imgProc/otsuThreshold.html.

Examples

Run this code
# NOT RUN {
BW_Image <- make_bw(image)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab