
www.Usenet.com
| <-- __Chronological__ --> | <-- __Thread__ --> |
dear friend,
I know we can do it with neural networks, but it requires training
with a huge database, i.e what I was trying to answer, Can I build a
system which can do it with out database. This was the place were I
brought rule based system, which can eliminate the database
completely. we tried that but when I presented it to my instructor ,
she told that it will take a lot of time to write for each code ,
remember it worked for digit. But for character which is complex you
have to take care of many cases, i.e at every stage you have to
consider two possibilites , i.e if this edge is error , then what may
be the case build, the tree, where one path will lead to solution.
The advantage was because the boundary of the character was define, we
can expect the tree to end soon. But it was tedious to sit and write
so much of code.
I will try to explain you look at the below code, first the whole
character is converted into graphical form, then, for seven, it was if
it has leftnod and then the leftnode has the down node only, then it
was seven. (this is was the down code shows). Later we even imporved
the performance by saying that angle between head and left node sould
be between, -30 to 30 degree, then angle between left node and the
down node should be 40 to -40 degree and the nodes should not contain
any other nodes
Head 0--------------0leftnode
|
|
|
|
|
|
|
|
|
0 down node
If you can run my code, it clearly shows you how you are making the
nodes at the runtime.
Then I tried, but I left where, I was thinking to characterize the
node based on the length also so that, it completes all the parameters
on which a character can depend.
the below code is old one, but it basically explains you how it we can
do. Here down I have written that there are three cases for seven,
when you don't take into account angle. If you have angle the cases
doesnt come into picture at all.
You take any complex character, look that you can break then into
simple things, and then use a different rule based system , it is also
easy, it just says,
if the first component is this,
and the second component is this
and third component is this
then it is this character,
But the advantage here it is it increase the probability of getting
success also.
But only thing was there should have been some criteria , on which you
can break the character, it can be taken as after some pixel like that
the first criteria was to break it based on the number of links it
has, take an example of T the
leftnode
Head 0--------------0---------------0 right node
|
|
|
|
|
|
|
|
|
0 down node
then you can break the node at left node into different part as seven
and a right hand. This was my first criteria based on which I broke
the characters, remeber, it is easy to do once you have the above
structure.
The one which inprove this is a simpler algorithm which I tried to
build was to division of characters based on the intersection of
pixels.
this is the principle which I developed to break the online
handwritten characters. Write the online data on a array, and set the
piexel one where all you write, if the pixel is already set then it is
a intersection so break the character there, Then I started developing
an algorithm where I can convert the offline character data into
online character data. This I tried with an recursive algorithm, but I
din't complete and I started on different project by that time.
bye
RAMESH
//program to recognize seven
int recognize_seven(Node * Head)
{
float length;
float angle;
float calculate_angle(int,int,int,int);
int check_subnodes(Node *temp);
int check_one_subnode_only(Node *);
Node *temp,*temp1,*temp2,*temp3;
temp=NULL;
temp1=NULL;
temp2=NULL;
temp3=NULL;
while(1)
{
if(Head->D_L!=NULL)
temp=Head->D_L;
else
{
if(check_one_subnode_only(Head)!=1)
break;
}
if(Head->D_R!=NULL)
temp1=Head->D_L;
else
break;
if(temp1!=NULL)
{
if((temp1->D_L!=NULL)||(temp->D_R!=NULL))
{
if(temp1->D_L!=NULL)
temp2=temp1->D_L;
else
temp2=temp1->D_R;
}
else
break;
}
else
break;
if(temp!=NULL)
{
if(check_subnodes(temp)!=0)
{
break;
}
}
if(temp2!=NULL)
{
if(check_subnodes(temp2)!=0)
{
break;
}
}
else
break;
return(1);
}//end of while
temp=NULL;
temp1=NULL;
temp2=NULL;
temp3=NULL;
//begining of case 2
while(1)
{
if(Head->D_L!=NULL)
temp=Head->D_L;
else
break;
if((Head->D_L1!=NULL)||(Head->D_R!=NULL))
{
if(Head->D_L1!=NULL)
temp1=Head->D_L1;
else
temp1=Head->D_R;
}
else
break;
if(temp!=NULL)
{
if(check_subnodes(temp)!=0)
{
break;
}
}
else
break;
if(temp1!=NULL)
{
if(check_subnodes(temp1)!=0)
{
break;
}
}
else
break;
return(1);
}//end of while
temp=NULL;
temp1=NULL;
temp2=NULL;
temp3=NULL;
//begining of case 3
while(1)
{
if(Head->D_R!=NULL)
temp1=Head->D_R;
else
break;
if((temp1->D_L!=NULL)||(temp1->D_R!=NULL))
{
if(temp1->D_L!=NULL)
temp2=temp1->D_L;
else
temp2=temp1->D_R;
}
else
break;
if(temp2!=NULL)
{
if(check_subnodes(temp2)!=0)
{
break;
}
}
else
break;
return(1);
}//end of while
return(0);
}
//end of the program to recognize seveb
"Jean-Baptiste Hétier" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> If I understood your idea, I don't think it will work for **handwritten**
> charaters !
> A quite easy way which I have tries myself is to use neural networks (with
> any program you can find on the net). Then just try different networks and
> train them properly (with huge databases). I managed to recognise 93% of
> another database then (and I am sure it is easy to do much better !)
>
>
> "RAMESH" <[EMAIL PROTECTED]> a écrit dans le message de
> news:[EMAIL PROTECTED]
> > hi friends,
> >
> > It's easy to recognize a handwritten character recognition easily
> > without applying complex theorems at all.
> >
> > the idea is to not to recognize the character as an image , just think
> > of a blind man how he tries the recognize a character. There lies the
> > logic.
> >
> > Just move over the character recursively in all direction, when you
> > move over it try to recgonize wheather you are in which direction.
> > Then a simple if else rule structure, where you write if I move first
> > horizontal, then vertical , then horizontal , then vertical and then
> > horizontal , then it may be zero or six.
> >
> > Here also you can distinguish from zero and six by using divide and
> > conquer rule , if it six then the first half will be different from
> > second half.
> >
> > for characters, it is more simple rules instead of saying horizontal
> > and vertical , just say he moves first in 65 degrees in down, then at
> > 20 vertical like that.
> >
> > Even little more or rule struecture can further improve the structure
> > of recognition. like characterzing the distance moved in long, medium
> > , and small.
> >
> > ex. like writing a rule that he moved a long distance from this point
> > and then small distance from here, so we can remove the significance
> > of small if needed. But only problem is there the set of rule is
> > little bit more like nearly more than 100.
> >
> > For discontinutity also there was a solution, to first recongize the
> > disconnect part and say if first half is some what like this and
> > second half is like this it may be this character.But here we tried to
> > joing all the disconnected parts if it dint match to any character and
> > then try out the permutations of it to match with the existing
> > character.
> >
> > It's really easy. It does not take more than 500 lines of code to
> > write because first part you are writing a recursive algorithm.
> >
> > RAMESH
> > for any queries or help, you can contact me at
> > [EMAIL PROTECTED]
| <-- __Chronological__ --> | <-- __Thread__ --> |
Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.