Learn R Programming

magick (version 1.2)

ocr: Image Text OCR

Description

Extract text from an image using the tesseract package.

Usage

image_ocr(image, language = "eng", ...)

Arguments

image

magick image object returned by image_read() or image_graph()

language

passed to tesseract. To install additional languages see instructions in tesseract_download().

...

additional parameters passed to tesseract

Details

To use this function you need to tesseract first:

  install.packages("tesseract")

Best results are obtained if you set the correct language in tesseract. To install additional languages see instructions in tesseract_download().

See Also

Other image: analysis, animation, attributes, color, composite, device, editing, effects, index, painting, transform

Examples

Run this code
# NOT RUN {
if(require("tesseract")){
img <- image_read("http://jeroen.github.io/images/testocr.png")
image_ocr(img)
}
# }

Run the code above in your browser using DataLab