Can someone share some octave/matlab code/algo to preprocess a photo taken from mobile camera of a handwritten digit. After preprocessing data should have similar characteristic like MNIST data set digits images. I have a neural network trained using MNIST date set. Now I want to test my implementation by taking handwritten digit using phone camere and saving it on my computer. I want to give this image as input to test my neural net implementation. Thanks in advance !!
Asked
Active
Viewed 599 times
-1
-
3Save the file onto your computer, drag the file into your MATLAB working directory, load the image, run it through your implementation. This is a ton very basic MATLAB stuff that you can look up (especially for someone that implemented their own NN!). Since you've provided no code showing you've tried something, you won't get much more help. – Falimond Nov 30 '13 at 07:29
-
Yes agree it looks basic but when I tryed it did not worked for me. – user3051413 Nov 30 '13 at 10:05
-
Yes agree it looks basic but when I tried it did not worked for me. My NN implementation is trained using MNIST training dataset and I have validated using MNIST test dataset. It seems that there is a need to do some preprocessing of image captured to match that with MNIST format then only my network can predict. My problem is straight: I have a captured single digit image. Saved it on computer, need to transform it to 28*28 bit image with characteristic similar to MNIST data so that I can test my NN with that. – user3051413 Nov 30 '13 at 10:12
1 Answers
0
As it is already saved on your computer, drag and drop the image file into whatever directory your NN files are located/sources images from.
myImage = imread('myImageName.jpg'); %load the image file
grayImage = rgb2gray(myImage);
% maybe there is some processing you should do here so that the mean pixel white value for
% your image is the same as that of the MNIST data, and also centered in the window
% or maybe just test it as is and see how your NN implementation handles it
formatMNIST = imresize(greyImage,[28,28]); % change size to 28x28
% now formatMNIST should be useable in your NN

Falimond
- 608
- 4
- 11