plotSubsets | R Documentation |
This is a convenience wrapper to apply the plotSubImage
function over a collection of bounding boxes. It takes
a collection of bounding boxes from GetBoxes
and an image and displays the subset of the image
specified by the bounding box arranged in a panel grid,
with the recognized output and associated confidences printed in the
title. This is useful for looking at misclassified terms.
This is unrelated to the tesseract API and is used for examining the region of the image in R.
plotSubsets(bbox, img, nrow = 4, ncol = 4,
titles = paste("OCR: ", row.names(bbox),
", conf: ", round(bbox[,"confidence"],0)),
...)
bbox |
bounding boxes as created by |
img |
the image object read using the appropriate function in
the appropriate package for the image type. See |
nrow |
the number of rows in the panel. |
ncol |
the number of columns in the panel. |
titles |
character vector of plot titles for the different panels/plots. |
... |
additional arguments passed to the inherited |
The purpose of this function is the side-effect of plotting the sub-image
The result is NULL
.
Matthew Espe
GetBoxes
plotSubImage
f = system.file("images", "OCRSample2.png", package = "Rtesseract")
pix = pixRead(f)
api = tesseract(pix)
bbox = GetBoxes(api, "textline")
#Recognize(api)
#bbox = lapply(api, BoundingBox, "textline")
if(FALSE && require("png")) {
img = png::readPNG(f)
plotSubsets(bbox, img, nrow = 10, ncol = 1)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.