public class TesseractDecoder extends ImageDecoder
session
Constructor and Description |
---|
TesseractDecoder(ScrapingSession session,
java.lang.String customImageMagickCommands,
java.lang.String customTesseractCommands)
Converts an image to text using tesseract and imagemagick
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes any resources associated with the decoder.
|
DecodedImage |
decodeFile(java.io.File file)
Converts the image given to a DecodedImage that will handle it.
|
double |
getBalance()
Returns the current balance of the account (if it can be accessed via the API).
|
decodeFile, decodeURL, setAutoCloseAfterScrapeEnds
public TesseractDecoder(@NotNull ScrapingSession session, @Nullable java.lang.String customImageMagickCommands, @Nullable java.lang.String customTesseractCommands)
session
- The scraping sessioncustomImageMagickCommands
- A string of custom commands to send to imageMagick for preparing the imagecustomTesseractCommands
- A string of custom commands to send to Tesseract for preparing the image@NotNull public DecodedImage decodeFile(@NotNull java.io.File file)
ImageDecoder
decodeFile
in class ImageDecoder
file
- The image filepublic void close()
ImageDecoder
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class ImageDecoder
public double getBalance()
ImageDecoder
getBalance
in class ImageDecoder