This is possible, but not simple or trivial. Try some Internet searching for tools that can extract text from photo images. I'm sure they exist - some commercial, and some (possibly) open source (free).
If you google "Java OCR " (optical character recognition) you will find a good number of libraries, some of which are open source.
On the other hand, if you are trying to automate CAPTCHA recognition then Daniweb TOS prohibits such discussions here.