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(String tessDataPath, String language, boolean OCRon)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<RegionExtractionResult>
extractRegions(File file, List<Region> regions)
String
extractTextFromImage(File file, RegionDefinion coordinates)
int
getPageCount(File imageFile)
Dimension
getPageDimensionInPt(File file, int pageId)
void
setLanguage(String lang)
-
-
-
Method Detail
-
getPageDimensionInPt
public Dimension getPageDimensionInPt(File file, int pageId) throws Exception
- Specified by:
getPageDimensionInPt
in classAbstractExtractionService
- Throws:
Exception
-
getPageCount
public int getPageCount(File imageFile) throws Exception
- Specified by:
getPageCount
in classAbstractExtractionService
- Throws:
Exception
-
extractTextFromImage
public String extractTextFromImage(File file, RegionDefinion coordinates) throws IOException, net.sourceforge.tess4j.TesseractException
- Throws:
IOException
net.sourceforge.tess4j.TesseractException
-
extractRegions
public List<RegionExtractionResult> extractRegions(File file, List<Region> regions) throws IOException, net.sourceforge.tess4j.TesseractException
- Specified by:
extractRegions
in classAbstractExtractionService
- Throws:
IOException
net.sourceforge.tess4j.TesseractException
-
setLanguage
public void setLanguage(String lang)
- Specified by:
setLanguage
in classAbstractExtractionService
-
-