% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ocr.R
\name{ocr}
\alias{ocr}
\alias{image_ocr}
\alias{image_ocr_data}
\title{Image Text OCR}
\usage{
image_ocr(image, language = "eng", HOCR = FALSE, ...)

image_ocr_data(image, language = "eng", ...)
}
\arguments{
\item{image}{magick image object returned by \code{\link[=image_read]{image_read()}} or \code{\link[=image_graph]{image_graph()}}}

\item{language}{passed to \link[tesseract:tesseract]{tesseract}. To install additional languages see
instructions in \link[tesseract:tessdata]{tesseract_download()}.}

\item{HOCR}{if \code{TRUE} return results as HOCR xml instead of plain text}

\item{...}{additional parameters passed to \link[tesseract:tesseract]{tesseract}}
}
\description{
Extract text from an image using the \link[tesseract:tesseract]{tesseract} package.
}
\details{
To use this function you need to tesseract first:

\if{html}{\out{<div class="sourceCode">}}\preformatted{  install.packages("tesseract")
}\if{html}{\out{</div>}}

Best results are obtained if you set the correct language in \link[tesseract:tesseract]{tesseract}.
To install additional languages see instructions in \link[tesseract:tessdata]{tesseract_download()}.
}
\examples{
\donttest{
if(require("tesseract")){
img <- image_read("http://jeroen.github.io/images/testocr.png")
image_ocr(img)
image_ocr_data(img)
}
}
}
\seealso{
Other image: 
\code{\link{_index_}},
\code{\link{analysis}},
\code{\link{animation}},
\code{\link{attributes}()},
\code{\link{color}},
\code{\link{composite}},
\code{\link{defines}},
\code{\link{device}},
\code{\link{edges}},
\code{\link{editing}},
\code{\link{effects}()},
\code{\link{fx}},
\code{\link{geometry}},
\code{\link{morphology}},
\code{\link{options}()},
\code{\link{painting}},
\code{\link{segmentation}},
\code{\link{transform}()},
\code{\link{video}}
}
\concept{image}
