Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: character recognition,nntool
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
dipti chaudhary

Posts: 11
Registered: 12/16/09
character recognition,nntool
Posted: Jan 3, 2013 2:37 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi All,
I want to do character recognition. I have the following code. But, after i run this program at Matlab. I am still unable to recognition any number.
What is the step taken to make the below coding works?
please help me?

clc;
close all;
clear all;
letter1 = [1 0 0 0 1 ...
1 0 0 0 1 ...
1 0 0 0 1 ...
1 0 0 0 1 ...
1 0 0 0 1 ...
1 0 0 0 1 ...
1 0 0 0 1]';

letter2 = [1 0 0 0 1 ...
0 1 1 1 0 ...
1 1 1 1 0 ...
1 1 1 0 1 ...
1 1 0 1 1 ...
1 0 1 1 1 ...
0 0 0 0 0]';

letter3 = [1 0 0 0 1 ...
0 1 1 1 0 ...
1 1 1 1 0 ...
1 1 0 0 1 ...
1 1 1 1 0 ...
0 1 1 1 0 ...
1 0 0 0 1]';
letter4 = [1 1 1 0 1 ...
1 1 0 0 1 ...
1 0 1 0 1 ...
0 1 1 0 1 ...
0 0 0 0 0 ...
1 1 1 0 1 ...
1 1 1 0 1]';

letter5 = [0 0 0 0 0 ...
0 1 1 1 1 ...
0 1 1 1 1 ...
0 0 0 0 1 ...
1 1 1 1 0 ...
0 1 1 1 0 ...
1 0 0 0 1]';

letter6 = [1 0 0 0 1 ...
0 1 1 1 1 ...
0 1 1 1 1 ...
0 0 0 0 1 ...
0 1 1 1 0 ...
0 1 1 1 0 ...
1 0 0 0 1]';

letter7 = [0 0 0 0 0 ...
1 1 1 1 0 ...
1 1 1 1 0 ...
1 1 1 0 1 ...
1 1 0 1 1 ...
1 0 1 1 1 ...
0 1 1 1 1]';
letter8 = [1 0 0 0 1 ...
0 1 1 1 0 ...
0 1 1 1 0 ...
1 0 0 0 1 ...
0 1 1 1 0 ...
0 1 1 1 0 ...
1 0 0 0 1]';

letter9 = [1 0 0 0 1 ...
0 1 1 1 0 ...
0 1 1 1 0 ...
0 1 1 1 0 ...
0 1 1 1 0 ...
0 1 1 1 0 ...
1 0 0 0 1]';

letter0 = [1 0 0 0 1 ...
0 0 0 0 0 ...
0 1 1 1 0 ...
0 1 1 1 0 ...
0 1 1 1 0 ...
0 0 0 0 0 ...
1 0 0 0 1]';


P = [letter1,letter2,letter3,letter4,letter5,letter6,letter7,letter8,letter9,letter0];
T = eye(10);

S1 = 10;
[R,Q] = size(P);
[S2,Q] = size(T);

net = newff(minmax(P),[S1 S2],{'logsig' 'logsig'},'traingdx');
net.performFcn = 'sse';
net.trainParam.goal = 0.1;
net.trainParam.show = 20;
net.trainParam.epochs = 5000;
net.trainParam.mc = 0.95;
[net,tr] = train(net,P,T);

noisyJ = P(:,10)+randn(35,1)*0.2;
plotchar(noisyJ);
A2 = sim(net,noisyJ);
A2 = compet(A2);
answer = find(compet(A2) == 1);
plotchar(P(:,answer));







Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.