| 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)