If you are asking about how to make a machine vision program, this is a very hard task. Without someone just giving you the code -- I'm not sure anyone here actually works with machine vision -- we would have a very hard time telling you everything you need to do to get the program to work. My suggestion is to find a site that has articles on machine vision. A site I like that has very good articles on this topic is generation5 . You can find machine vision articles here .
Beyond the knowledge of machine vision, you will also need a very strong foundation in the Java language itself and a good understanding of how to read and interpret image data.
From what you've posted, it would seem that you don't know much about Java or machine vision. If this is true, how in the world did you end up needing to do such a project? I'd say that it seems like you are needing this for a class. If this is so and you don't have the backing necessary for it, you are taking a class that is far too advanced for you. You will just have more problems as the coursework gets harder.