image_textlines_flor: Text Line Segmentation based on valley finding in projection...

View source: R/textlinedetector.R

image_textlines_florR Documentation

Text Line Segmentation based on valley finding in projection profiles

Description

Text Line Segmentation based on valley finding in projection profiles

Usage

image_textlines_flor(
  x,
  light = TRUE,
  type = c("none", "niblack", "sauvola", "wolf")
)

Arguments

x

an object of class magick-image

light

logical indicating to remove light effects due to scanning

type

which type of binarisation to perform before doing line segmentation

Value

a list with elements

  • n: the number of lines found

  • overview: an opencv-image of the detected areas

  • textlines: a list of opencv-image's, one for each text line area

Examples


library(opencv)
library(magick)
library(image.textlinedetector)
path   <- system.file(package = "image.textlinedetector", "extdata", "example.png")
img    <- image_read(path)
img    <- image_resize(img, "1000x")
areas  <- image_textlines_flor(img, light = TRUE, type = "sauvola")
areas  <- lines(areas, img)
areas$n
areas$overview
combined <- lapply(areas$textlines, FUN=function(x) image_read(ocv_bitmap(x)))
combined <- do.call(c, combined)
combined
image_append(combined, stack = TRUE)


image.textlinedetector documentation built on Nov. 10, 2023, 1:09 a.m.