| image_wordsegmentation | R Documentation |
Filter the image using the gaussian kernel and extract components which are connected which are to be considered as words.
image_wordsegmentation(x, kernelSize = 11L, sigma = 11L, theta = 7L)
x |
an object of class opencv-image containing black/white binary data (type CV_8U1) |
kernelSize |
size of the kernel |
sigma |
sigma of the kernel |
theta |
theta of the kernel |
a list with elements
n: the number of lines found
overview: an opencv-image of the detected areas
words: a list of opencv-image's, one for each word area
library(opencv) library(magick) library(image.textlinedetector) path <- system.file(package = "image.textlinedetector", "extdata", "example.png") img <- image_read(path) img <- image_resize(img, "x1000") areas <- image_textlines_flor(img, light = TRUE, type = "sauvola") areas$overview areas$textlines[[6]] textwords <- image_wordsegmentation(areas$textlines[[6]]) textwords$n textwords$overview textwords$words[[2]] textwords$words[[3]]