lapply | R Documentation |
This function allows us to loop over the results in the OCR result iterator and query each result using a given function. We can get the confidence level for the predicted term (word, symbol, etc.), the rectangular bounding box for the term, possible alternatives for the term.
lapply(X, FUN, ...) # level = "word",
X |
an object of class |
FUN |
the function to be applied to each successive result in the
|
level |
either a number or character vector that maps to a
|
... |
additional arguments |
A list with an element corresponding to each result in the OCR iterator.
Duncan Temple Lang
Tesseract https://code.google.com/p/tesseract-ocr/
tesseract
f = system.file("images", "OCRSample2.png", package = "Rtesseract")
api = tesseract(f)
Recognize(api)
alt = lapply(api, GetAlternatives, "symbol")
sym = getNativeSymbolInfo("r_getConfidence")
conf = lapply(api, sym$address, "word")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.