Class OcrConfig
OCR configuration details. OCR relies the open-source Tesseract OCR product to be already installed on your system.
You can configure this parser to use the Tesseract open-source OCR application to extract text out of images or documents containing embedded images (e.g. PDF). Supported image formats are TIFF, PNG, JPEG, GIF, and BMP.
To enable this feature, you must first download and install a copy of Tesseract appropriate for your platform (supported are Linux, Windows, Mac and other platforms). It will only be activated once you configure the path to its install location. Default language detection is for English. To support additional or different languages, you can provide a list of three-letter ISO-639-2 language codes supported by Tesseract (separated with + sign). These languages must be part of your Tesseract installation. You can download additional languages form the Tesseract web site.
When enabled, OCR is attempted on all supported image formats. To limit OCR to a subset of document content types, configure the corresponding content-types (e.g. application/pdf, image/tiff, image/png, etc.).
Tesseract Parameters
Unless disabled, Tesseract is detected and used by default. You can There are several extra parameters one can set to configure Tesseract. You can find a listing here.
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleangetDepth()inthashCode()booleansetApplyRotation(Boolean applyRotation) setColorSpace(String colorSpace) setContentTypeMatcher(TextMatcher contentTypeMatcher) The matcher of content types to apply OCR on.setDensity(Integer density) setDisabled(boolean disabled) setEnableImagePreprocessing(Boolean enableImagePreprocessing) setImageMagickPath(Path imageMagickPath) setLanguage(String language) setMaxFileSizeToOcr(Long maxFileSizeToOcr) setMinFileSizeToOcr(Long minFileSizeToOcr) setPageSegMode(String pageSegMode) setPageSeparator(String pageSeparator) setPreserveInterwordSpacing(Boolean preserveInterwordSpacing) setSkipOcr(Boolean skipOcr) setTessdataPath(Path tessdataPath) setTesseractPath(Path tesseractPath) setTimeoutSeconds(Integer timeoutSeconds) toString()
-
Constructor Details
-
OcrConfig
public OcrConfig()
-
-
Method Details
-
setContentTypeMatcher
The matcher of content types to apply OCR on.- Parameters:
contentTypeMatcher- content type matcher- Returns:
- this
-
isDisabled
public boolean isDisabled() -
getContentTypeMatcher
-
getApplyRotation
-
getColorSpace
-
getDensity
-
getDepth
-
getEnableImagePreprocessing
-
getFilter
-
getImageMagickPath
-
getLanguage
-
getMaxFileSizeToOcr
-
getMinFileSizeToOcr
-
getPageSegMode
-
getPageSeparator
-
getPreserveInterwordSpacing
-
getResize
-
getSkipOcr
-
getTessdataPath
-
getTesseractPath
-
getTimeoutSeconds
-
setDisabled
- Returns:
this.
-
setApplyRotation
- Returns:
this.
-
setColorSpace
- Returns:
this.
-
setDensity
- Returns:
this.
-
setDepth
- Returns:
this.
-
setEnableImagePreprocessing
- Returns:
this.
-
setFilter
- Returns:
this.
-
setImageMagickPath
- Returns:
this.
-
setLanguage
- Returns:
this.
-
setMaxFileSizeToOcr
- Returns:
this.
-
setMinFileSizeToOcr
- Returns:
this.
-
setPageSegMode
- Returns:
this.
-
setPageSeparator
- Returns:
this.
-
setPreserveInterwordSpacing
- Returns:
this.
-
setResize
- Returns:
this.
-
setSkipOcr
- Returns:
this.
-
setTessdataPath
- Returns:
this.
-
setTesseractPath
- Returns:
this.
-
setTimeoutSeconds
- Returns:
this.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-