Home > other >  Introduction to opencv digit recognition problem
Introduction to opencv digit recognition problem

Time:05-09

Learning opencv recently, use a network code for world of warcraft time digital identification test, results are identifying problems is 0, the network code is probably the process:
//load template
Vector MyTemplate;
for (int i=0; I & lt; 10; I++)
{
Char name [64].
Sprintf (name, "E: \ \ VCS \ \ number_recognition \ \ number_recognition \ \ number_recognition surprised \ \ image \ \ % jeter pg", I);
Mat temp=imread (name, 0);
MyTemplate. Push_back (temp);
}

//order take out and split the digital
Vector MyROI;
for (int i=0; I & lt; Sort_rect. The size (); I++)
{
Mat ROI;
ROI=conImage (sort_rect [I] getRect ());
Mat dstROI=Mat: : zeros (myTemplate [0]. The size (), myTemplate [0]. The type ());
The resize (ROI, dstROI myTemplate [0]. The size (), 0, 0, INTER_NEAREST);
MyROI. Push_back (dstROI);
}

//comparison, the image and template is presupposed, and then all the pixels and, and minimum said the more similar, and then complete the matching
Vector Seq.//order for identifying the results
for (int i=0; I & lt; MyROI. The size (); I++)
{
Mat subImage.
int sum=0;
Int min=100000;
Int min_seq=0;//record the smallest and the corresponding number
for (int j=0; J & lt; 10; J++)
{
//calculate two images difference
MyTemplate absdiff (myROI [I], [j], subImage);
Sum=getPiexSum (subImage);
If (sum & lt; Min)
{
Min=sum;
Min_seq=j;
}
sum=0;
}
Seq. Push_back (min_seq);
}

Actual run time difference between two pictures are more than 100000, so a few Numbers to identify for 0.


To identify the digital capture pictures of wow time, four digital + 1 of colon images only 35 * 9 pixels, I don't think too much interpolation may be to identify the picture is too small and the resolution is too low to cause, but not sure, and I don't know should how to solve what technology (use), to answer for keywords
  • Related