ocv_deslant {image.textlinedetector} | R Documentation |
Deslant images by putting cursive text upright
Description
This algorithm sets handwritten text in images upright by removing cursive writing style.
One can use it as a preprocessing step for handwritten text recognition.
image_deslant
expects a magick-image and performs grayscaling before doing deslantingocv_deslant
expects a ocv-image and does not perform grayscaling before doing deslanting
Usage
ocv_deslant(image, bgcolor = 255, lower_bound = -1, upper_bound = 1)
image_deslant(image, bgcolor = 255, lower_bound = -1, upper_bound = 1)
Arguments
image |
an object of class opencv-image (for |
bgcolor |
integer value with the background color to use to fill the gaps of the sheared image that is returned. Defaults to white: 255 |
lower_bound |
lower bound of shear values. Defaults to -1 |
upper_bound |
upper bound of shear values. Defaults to 1 |
Value
an object of class opencv-image or magick-image with the deslanted image
Examples
library(magick)
library(opencv)
library(image.textlinedetector)
path <- system.file(package = "image.textlinedetector", "extdata", "cursive.png")
img <- ocv_read(path)
img <- ocv_grayscale(img)
img
up <- ocv_deslant(img)
up
img <- image_read(path)
img
image_deslant(img)
[Package image.textlinedetector version 0.2.3 Index]