powered by
This function reads in and binarizes a PNG image.
readPNGBinary( path, cutoffAdjust = 0, clean = TRUE, crop = TRUE, inversion = FALSE )
Returns image from path. 0 represents black, and 1 represents white by default.
File path for image.
Multiplicative adjustment to the K-means estimated binarization cutoff.
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.
Logical value dictating whether or not to crop the white out around the image. TRUE by default.
Logical value dictating whether or not to flip each pixel of binarized image. Flipping happens after binarization. FALSE by default.
image_path <- system.file("extdata", "phrase_example.png", package = "handwriter") csafe_document <- list() csafe_document$image = readPNGBinary(image_path) plotImage(csafe_document)
Run the code above in your browser using DataLab