Learn R Programming

image.textlinedetector (version 0.2.3)

image_wordsegmentation: Find Words by Connected Components Labelling

Description

Filter the image using the gaussian kernel and extract components which are connected which are to be considered as words.

Usage

image_wordsegmentation(x, kernelSize = 11L, sigma = 11L, theta = 7L)

Value

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

Arguments

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

Examples

Run this code
# \donttest{
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]]
# }

Run the code above in your browser using DataLab