Hehe, the
java 2D part will be easy. The algorythms for
pattern recognition are the hard part- they're the research work of a lifetime.
But you will want to be getting pixels in regions, and the colors of the pixels, and creating arbitrary shapes of pixels boundaries, etc, and java 2D will allow you to do all this very easily.