ocr: Image Text OCR

Description Usage Arguments Details See Also Examples

Description

Extract text from an image using the tesseract package.

Usage

1
2
3
image_ocr(image, language = "eng", HOCR = FALSE, ...)

image_ocr_data(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().

HOCR

if TRUE return results as HOCR xml instead of plain text

...

additional parameters passed to tesseract

Details

To use this function you need to tesseract first:

1
  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: _index_, analysis, animation, attributes, color, composite, device, edges, editing, effects, fx, geometry, morphology, options, painting, segmentation, transform, video

Examples

1
2
3
4
5
if(require("tesseract")){
img <- image_read("http://jeroen.github.io/images/testocr.png")
image_ocr(img)
image_ocr_data(img)
}

ropensci/magick documentation built on Jan. 15, 2019, 3:27 a.m.