View source: R/textlinedetector.R
image_textlines_crop | R Documentation |
Applies a sequence of image operations to obtain a region which contains relevant texts by cropping white space on the borders of the image. This is done in the following steps: morphological opening, morphological closing, blurring, canny edge detection, convex hull contours of the edges, keep only contours above the mean contour area, find approximated contour lines of the convex hull contours of these, dilation and thresholding.
image_textlines_crop(x)
x |
an object of class magick-image |
an object of class magick-image
library(opencv)
library(magick)
library(image.textlinedetector)
path <- system.file(package = "image.textlinedetector", "extdata", "example.png")
img <- image_read(path)
image_info(img)
img <- image_textlines_crop(img)
image_info(img)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.