net.sourceforge.javaocr.ocrPlugins.aspectRatio
Class AspectRatioOCR
java.lang.Object
net.sourceforge.javaocr.scanner.DocumentScannerListenerAdaptor
net.sourceforge.javaocr.ocrPlugins.aspectRatio.AspectRatioOCR
- All Implemented Interfaces:
- AccuracyProviderInterface, DocumentScannerListener
public class AspectRatioOCR
- extends DocumentScannerListenerAdaptor
- implements AccuracyProviderInterface
Provides an OCR that can be used in addition to other OCR plug-ins to
increase accuracy.
- Author:
- William Whitney
|
Method Summary |
void |
acceptAccuracyListener(AccuracyListenerInterface listener)
|
private OCRIdentification |
determineCharacterPossibilities(double targetRatio)
|
void |
endRow(PixelImage pixelImage,
int y1,
int y2)
|
private double |
getRatio(int width,
int height)
|
void |
processChar(PixelImage pixelImage,
int x1,
int y1,
int x2,
int y2,
int rowY1,
int rowY2)
|
void |
processSpace(PixelImage pixelImage,
int x1,
int y1,
int x2,
int y2)
|
private void |
processTrainingImages()
|
void |
scan(BufferedImage targetBfImage)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
listener
private AccuracyListenerInterface listener
trainingImages
private final HashMap<Character,ArrayList<TrainingImage>> trainingImages
charRatioList
private final ArrayList<CharacterRatio> charRatioList
documentScanner
private DocumentScanner documentScanner
LOG
private static final Logger LOG
AspectRatioOCR
public AspectRatioOCR(HashMap<Character,ArrayList<TrainingImage>> trainingImages)
scan
public void scan(BufferedImage targetBfImage)
acceptAccuracyListener
public void acceptAccuracyListener(AccuracyListenerInterface listener)
- Specified by:
acceptAccuracyListener in interface AccuracyProviderInterface
endRow
public void endRow(PixelImage pixelImage,
int y1,
int y2)
- Specified by:
endRow in interface DocumentScannerListener- Overrides:
endRow in class DocumentScannerListenerAdaptor
processChar
public void processChar(PixelImage pixelImage,
int x1,
int y1,
int x2,
int y2,
int rowY1,
int rowY2)
- Specified by:
processChar in interface DocumentScannerListener- Overrides:
processChar in class DocumentScannerListenerAdaptor
processSpace
public void processSpace(PixelImage pixelImage,
int x1,
int y1,
int x2,
int y2)
- Specified by:
processSpace in interface DocumentScannerListener- Overrides:
processSpace in class DocumentScannerListenerAdaptor
processTrainingImages
private void processTrainingImages()
getRatio
private double getRatio(int width,
int height)
determineCharacterPossibilities
private OCRIdentification determineCharacterPossibilities(double targetRatio)
Copyright © -2012. All Rights Reserved.