%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clc
clear
%读取原始图像
I = imread('nnnl.jpg');
figure,imshow(I);
title('原始图像1');
%调用函数对图像进行二值化等一系列操作
img = myimgpreprocess(I);
for cnt=1:50
%调用函数对图像进行修剪
tmp=img{cnt};
bw2 = myimgcrop(tmp);
%调用函数对图像进行重采样
charvec = myimgresize(bw2);
out(:,cnt)=charvec;
end
P = out(:,1:40);
T = [eye(10) eye(10) eye(10) eye(10)];
Ptest = out(:,41:50);
%建立神经网络并对其进行训练
net = mycreatenn(P,T);
%测试神经网络
[a,b] = max(sim(net,Ptest));
%输出测试量
disp(b);