I'm working with a project where I should detect and extract the text from a image to later make it available to a search software .
I'm studying OpenCV but I don't find much content in Java just in Python. I'd like to implement this in Java. But if you know how to do this in Python, C++ it's ok. I just need the algorithm to get any idea.
My plan would be rotate the image 90°, make it a binary image (thresholding), detect the ROI (Region of Interest), in this case the text or maybe the shape rectangle, crop the white rectangle that holds the text and finally use OCR with Tesseract to obtain the text (PISF - 28 - 1469 - 3).
But to extract the text using tesseract is OK, I know how to to this. I just need to get the white rectangle that holds the text or the minimum region that holds the text and save it in the better form to later use it with Tesseract (OCR).
I would use the script in batch because I don't have just this image. And the other images can have different sizes.
Could anyone help me?
I'd apreciate any help.
My image is this:
Here is one way to do that in Python/OpenCV
Input:
Thresholded image:
Morphology cleaned image:
Extracted text region image:
Extracted binary text region image: