-1

有人可以分享一些 octave/matlab 代码/算法来预处理从手写数字的移动相机拍摄的照片。预处理后的数据应该具有类似 MNIST 数据集数字图像的特征。我有一个使用 MNIST 日期集训练的神经网络。现在我想通过使用手机摄像头获取手写数字并将其保存在我的计算机上来测试我的实现。我想将此图像作为输入来测试我的神经网络实现。提前致谢 !!

4

1 回答 1

0

由于它已经保存在您的计算机上,因此将图像文件拖放到您的 NN 文件所在的任何目录/从中获取图像。

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
于 2013-11-30T18:26:52.973 回答