Pre-process the image to crop the image where you want OCR to be done. you 
can use OpenCV to achieve that.

On Thursday, 4 June 2020 09:10:55 UTC+5:30, Shefali Modi wrote:
>
> With below code I am trying to read the subtitles  but code is returning 
> the text present at top.
> Any suggestion how I can read the text present at bottom of the image?
>
> String path = destDir + "/" + destFile;
>   log.info("Image is stored at : " + new File(path));
>   ITesseract instance = new Tesseract();
>   String tessDataPath = System.getProperty("user.dir") + File.separator + 
> "tessdata";
>   log.info("Tess Data directory is : " + tessDataPath);
>   instance.setDatapath(tessDataPath); //Setting Data path from 
> Tess4jInitializer.
>   instance.setLanguage("eng"); // Your custom Settings.
>
> try {
>  String result = instance.doOCR(new File(path));
>  log.info("After reading the text from image file : " + result);
> } catch (TesseractException e) {
> }
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tesseract-ocr+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tesseract-ocr/41688496-45ea-47ea-8b58-7c11f8522761%40googlegroups.com.

Reply via email to