Yes, you are ambitious, but image processing and text recognition are possible in
Java. However, you will have to deal with the pixels of a fully expanded image from the JPG. The compression in a JPG would make it very hard to find patterns.
The "Machine Learning / Artificial Intelligence" area that covers such tasks is HUGE. To get you started, here is a link to a recent survey:
http://www.developer.com/java/other/article.php/1559871 The following site has Java code
http://www.cs.waikato.ac.nz/~ml/weka/index.html There are many many more, this is a very active area.
Bill