Package org.hildan.ocr
Class SimpleOcr
-
- All Implemented Interfaces:
public final class SimpleOcrA
SimpleOcrcan read characters out of an image containing a single line of text.It does so by splitting the image into sub-images representing individual text elements, and matching the sub-images against the given referenceImages.
Sub-images are often individual characters, but sometimes several characters can be grouped together due to kerning. For instance, a lowercase letter following an uppercase T ou V can be part of a single sub-image (Te, To, Va...).
The given textDetector defines pixels that are considered part of the text.
-
-
Constructor Summary
Constructors Constructor Description SimpleOcr(List<ReferenceImage> referenceImages, Color textColor, Double minRecognitionScore, Integer spaceWidthThreshold)Creates a new SimpleOcr based on a default ColorSimilarityFilter. SimpleOcr(List<ReferenceImage> referenceImages, TextDetector textDetector, Double minRecognitionScore, Integer spaceWidthThreshold)
-
Method Summary
Modifier and Type Method Description final StringrecognizeText(BufferedImage image)Infers text from the given image based on the referenceImages of known characters. -
-
Constructor Detail
-
SimpleOcr
SimpleOcr(List<ReferenceImage> referenceImages, Color textColor, Double minRecognitionScore, Integer spaceWidthThreshold)
Creates a new SimpleOcr based on a default ColorSimilarityFilter.
-
SimpleOcr
SimpleOcr(List<ReferenceImage> referenceImages, TextDetector textDetector, Double minRecognitionScore, Integer spaceWidthThreshold)
-
-
Method Detail
-
recognizeText
final String recognizeText(BufferedImage image)
Infers text from the given image based on the referenceImages of known characters.
-
-
-
-