I’m planning to use MNIST database to train a classifier to recognize the hand written numbers. I have a few questions:
- Can I read an image as a matrix or an array of pixels?
Two options I figured out so far is the getRGB and PixelGrabber. - How can I read the MNIST database?
I see it’s of the form:
00 00 00 00 00 00 54 B9 9F 97 3C 24 ….
http://docs.oracle.com/javase/1.4.2/docs/api/java/awt/image/BufferedImage.html
Take a look at getRGB . You will get back a color array of values in a single vector/row.
This site appears to have some classes for accessing the MINST database: http://www.bcl.hamilton.ie/~barak/teach/F98/ECE547/hw1/index.html
*You want top use Java’s built in classes such as BufferedImage because getting the files any other way would involve writing your own file parsers and doing so will probably be a waste of time.