有人能分享一些倍频程/matlab代码/算法来预处理手机摄像头拍摄的照片吗手写数字。预处理后的数据应具有类似于MNIST数据集数字图像的特征。我有一个使用MNIST数据集训练的神经网络。现在我想测试我的实现通过使用手机摄像头拍摄手写数字并将其保存在我的电脑上。我想把这个图像作为输入来测试我的神经网络实现。提前感谢!!
由于它已经保存在您的计算机上,请将图像文件拖放到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