Kibor Bot Autoclicker » Kibor - Integrated development environment for bots » Textbook Kibor » Optical recognition of text for dynamic zones

Страниц (1): [1]
 

1. Kibor - 25 Июля, 2018 - 23:36:52 - перейти к сообщению
This code will find the text zones where the player names are written and recognizes the names.
Zones are defined with respect to the fragment of the label under the text. Explanation on the screen.

Download to CD C
Recognition database from the first post http://kibor-bot.com/files/basetext.sib
The search for the part of the tablet http://kibor-bot.com/files/readtext_fifa/tab.bmp

Explanation:


This image is scanned and text is recognized on it. Arrange it so that everything on the screen is displayed.





CODE:
int tab [50] [50];
int x [10], y [10];
int r=50, p=100;

int col, ex, ey;

int smX=38, smY=55;
int razmX=93, razmY=12;

int zona_text_X1, zona_text_Y1;
int zona_text_X2, zona_text_Y2;

string Text;

if (loadimage (#tab [0] [0], "C:\tab.bmp") <1) {messagebox ("no C:\tab.bmp"); goto er;}
if (loadsymbolbase ("C:\basetext.sib") <1) {messagebox ("noC:\basetext.sib"); goto er;}


getdisplay (col, ex, ey);

pause (1000);
int k=findimage (10, #tab [0] [0], 0, #x [0], #y [0], 0, 0, ex, ey, r, r, r, r, r, r, p, 1, -1);


for (int n=0; n <k; n ++)
{
zona_text_X1=x [n] -smX;
zona_text_Y1=y [n] -smY;
zona_text_X2=zona_text_X1 + razmX;
zona_text_Y2=zona_text_Y1 + razmY;

readtext (EN, #Text, 9, 1, 50, -1, -1, -1, -1, 0, 50, zona_text_X1, zona_text_Y1, zona_text_X2, zona_text_Y2, -1);
messagebox (Text);
pause (1000);
}

er:;

Powered by ExBB FM 1.0 Final