I have extracted text from image through Tesseract OCR using java. But the output is consisting of some special characters because image contains some symbols.
I want to ignore all the special characters and display just text. Is there any way that i can do that?
In tesseract you can set
TessBaseAPI.VAR_CHAR_WHITELIST
andTessBaseAPI.VAR_CHAR_BLACKLIST
in order to ignore some special characters.Following would make tesseract only recognize A-Z and digits
Next snippet would allow you to recognize everything except for ~ and fl
Also please note that as mentioned in tesseract github issue you can't black or whitelist characters with tesseract 4.0 Alpha LSTM, instead you should train LSTM with characters you expect on your image.
Of course if you want - you can still use 3.* versions of tesseract, its tessdata is located here