SetSourceResolution: Set and Get the Pixels Per Inch Resolution for a Tesseract...

View source: R/ext.R

SetSourceResolutionR Documentation

Set and Get the Pixels Per Inch Resolution for a Tesseract Image

Description

These functions allows us to specify the resolution of the image in pixels per inch and also to query the vertical resolution. This allows tesseract to more accurately estimate font size.

Usage

SetSourceResolution(api, ppi)

Arguments

api

an instance of the TesseractBaseAPI-class obtained from a call to tesseract

ppi

an integer giving the number of pixels per inch in the image

Value

SetSourceResolution returns NULL and is used for its side-effect on the tesseract object.

GetSourceYResolution returns an integer value.

Author(s)

Duncan Temple Lang

References

https://tesseract-ocr.github.io/a01281.html

See Also

tesseract

Examples

f = system.file("images", "SMITHBURN_1952_p3.png", package = "Rtesseract")
ts = tesseract(f)
GetSourceYResolution(ts) # correctly detected at 600 ppi
SetSourceResolution(ts, 300) # but we can change this
GetSourceYResolution(ts) # 300

duncantl/Rtesseract documentation built on March 25, 2022, 5:50 a.m.