SetRectangle | R Documentation |
SetRectangle
restricts the OCR to a sub-rectangle of the
original image. After calling SetRectangle
, the next
recognition done by the tesseract instance will only look at that
region. This is useful when one knows a priori that only a subset
of the image is of interest.
SetRectangle(api, ..., dims = sapply(list(...), as.integer))
api |
an instance of the |
... |
the specification of the rectangle as left, top, width and height. |
dims |
an alternative mechanism for specifying the location of
the corners of the rectangle as a single object, a vector of integer
values. The elements identify the left, top, width and height of the
rectangle
This should NOT be the coordinates
of the top-left and bottom-right of the rectangle, i.e. |
NULL
. The function is used for its side-effect on the tesseract instance.
Duncan Temple Lang
tesseract
, Recognize
,
GetText
f = system.file("images", "1990_p44.png", package = "Rtesseract")
ts = tesseract(f)
dims = GetImageDims(ts)
# region chosen interactively
SetRectangle(ts, 500, 800, 1300, 800)
GetText(ts)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.