View source: R/process_read_image.R
readPNGBinary | R Documentation |
This function reads in and binarizes a PNG image.
readPNGBinary(
path,
cutoffAdjust = 0,
clean = TRUE,
crop = TRUE,
inversion = FALSE
)
path |
File path for image. |
cutoffAdjust |
Multiplicative adjustment to the K-means estimated binarization cutoff. |
clean |
Whether to fill in white pixels with 7 or 8 neighbors. This will help a lot when thinning – keeps from getting little white bubbles in text. |
crop |
Logical value dictating whether or not to crop the white out around the image. TRUE by default. |
inversion |
Logical value dictating whether or not to flip each pixel of binarized image. Flipping happens after binarization. FALSE by default. |
Returns image from path. 0 represents black, and 1 represents white by default.
image_path <- system.file("extdata", "phrase_example.png", package = "handwriter")
csafe_document <- list()
csafe_document$image = readPNGBinary(image_path)
plotImage(csafe_document)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.