pixRead | R Documentation |
This function reads an image, determining what format it is and creates a C++ object that can be passed to Tesseract for optical character recognition.
pixRead(filename, addFinalizer = TRUE, multi = FALSE, ...)
pixCreate(x, ...)
filename |
the name of the file, fully or relatively qualified as necessary. |
x |
a vector of length three specifying the width, height and depth of the image. |
addFinalizer |
a logical value that controls whether the C code
for pixRead adds a finalizer to garbage collect the resulting Pix
object. When we pass the Pix to tesseract via
|
multi |
a logical value. If |
... |
additional arguments, currently ignored for
|
An object of class Pix-class
.
It is essential that this is assigned to an R variable so that
it is not garbage collected until the Recognize
function has been called for the TesseractBaseAPI-class
instance.
Duncan Temple Lang
Leptonica http://leptonica.com/ Tesseract https://code.google.com/p/tesseract-ocr/
SetImage
f = system.file("images", "OCRSample2.png", package = "Rtesseract")
pix = pixRead(f)
pixGetInputFormat(pix)
plot(pix)
dim(pix)
pix[,]
pixGetInputFormat(pix)
api = tesseract(pix)
lapply(api, GetAlternatives, "symbol")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.