readPNGBinary {handwriter} | R Documentation |
Read PNG Binary
Description
This function reads in and binarizes a PNG image.
Usage
readPNGBinary(
path,
cutoffAdjust = 0,
clean = TRUE,
crop = TRUE,
inversion = FALSE
)
Arguments
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. |
Value
Returns image from path. 0 represents black, and 1 represents white by default.
Examples
image_path <- system.file("extdata", "phrase_example.png", package = "handwriter")
csafe_document <- list()
csafe_document$image = readPNGBinary(image_path)
plotImage(csafe_document)
[Package handwriter version 3.1.1 Index]