Class ImageExtractionService
- java.lang.Object
-
- step.plugins.compare.services.atomic.AbstractExtractionService
-
- step.plugins.compare.services.atomic.ImageExtractionService
-
public class ImageExtractionService extends AbstractExtractionService
-
-
Constructor Summary
Constructors Constructor Description ImageExtractionService(java.lang.String tessDataPath, java.lang.String language, boolean OCRon)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<RegionExtractionResult>
extractRegions(java.io.File file, java.util.List<Region> regions)
java.lang.String
extractTextFromImage(java.io.File file, RegionDefinion coordinates)
int
getPageCount(java.io.File imageFile)
Dimension
getPageDimensionInPt(java.io.File file, int pageId)
void
setLanguage(java.lang.String lang)
-
-
-
Method Detail
-
getPageDimensionInPt
public Dimension getPageDimensionInPt(java.io.File file, int pageId) throws java.lang.Exception
- Specified by:
getPageDimensionInPt
in classAbstractExtractionService
- Throws:
java.lang.Exception
-
getPageCount
public int getPageCount(java.io.File imageFile) throws java.lang.Exception
- Specified by:
getPageCount
in classAbstractExtractionService
- Throws:
java.lang.Exception
-
extractTextFromImage
public java.lang.String extractTextFromImage(java.io.File file, RegionDefinion coordinates) throws java.io.IOException, net.sourceforge.tess4j.TesseractException
- Throws:
java.io.IOException
net.sourceforge.tess4j.TesseractException
-
extractRegions
public java.util.List<RegionExtractionResult> extractRegions(java.io.File file, java.util.List<Region> regions) throws java.io.IOException, net.sourceforge.tess4j.TesseractException
- Specified by:
extractRegions
in classAbstractExtractionService
- Throws:
java.io.IOException
net.sourceforge.tess4j.TesseractException
-
setLanguage
public void setLanguage(java.lang.String lang)
- Specified by:
setLanguage
in classAbstractExtractionService
-
-