【发布时间】:2021-12-03 14:00:08
【问题描述】:
我正在使用 tesseract R 包来识别图像文件中的文本。但是,在绘制单词的边界框时,坐标似乎不正确。
library(tesseract)
library(magick)
library(tidyverse)
text <- tesseract::ocr_data("http://jeroen.github.io/images/testocr.png")
image <- image_read("http://jeroen.github.io/images/testocr.png")
text <- text %>%
separate(bbox, c("x1", "y1", "x2", "y2"), ",") %>%
mutate(
x1 = as.numeric(x1),
y1 = as.numeric(y1),
x2 = as.numeric(x2),
y2 = as.numeric(y2)
)
plot(image)
rect(
xleft = text$x1[1],
ybottom = text$y1[1],
xright = text$x2[1],
ytop = text$y2[1])
【问题讨论】:
标签: r ocr tesseract bounding-box