Is the image Greyscale or RGB?
Either way - you can access the data by getting the Raster
Raster r = image.getData()
Lookup the methods on Raster - you can access the data as one array.
If the image is RGB - you will have to convert it to a Greyscale value (you let the JVM do it by creating a new Greyscale image and drawing to it, or doing it yourself by access each one and performing the math)...
Lemme know...