|
Программа распознавания символов
Iaienaou i?ia?aiio, niiniaio?
?aniiciaaaou a?aoe?anee i?aanoaaeaiiua neiaieu a aeaa ?ano?iaiai ecia?a?aiey e
i?aia?aciauaaou a iau?iue oaeno. o?eoo aey ?aniiciaaaiey: Arial,
16 A ea?anoaa
aeai?eoia auaaeaiey eiioo?ia aoaai eniieuciaaou aeai?eoi ?oea. Ionea?eaa?uea aeai?eoiu iniiaaiu ia oii, ?oi ia ecia?a?aiee
iouneeaaaony iauaeo (ia?aay ano?aoeaoayny oi?ea iauaeoa) e eiioo? iauaeoa
ionea?eaaaony e aaeoi?ecoaony. Ainoieinoaii aaiiuo aeai?eoiia yaeyaony eo
i?inoioa, e iaainoaoeai ii?ii ioianoe eo iineaaiaaoaeuio? ?aaeecaoe? e iaeioi?o?
nei?iinou i?e iienea e ia?aaioea aioo?aiieo eiioo?ia. I?eia? ionea?eaa?uaai
aeai?eoia - "aeai?eoia ?oea" - i?eaaaai ia ?en. 5.12. ?oe ia?eiaao aae?aiea n
aaeie iaeanoe ii iai?aaeaie? e ?a?iie, Eae oieuei ii iiiaaaao ia ?a?iue yeaiaio,
ii iiai?a?eaaao iaeaai e ia?aoiaeo e neaao?uaio yeaiaioo. Anee yoio yeaiaio
aaeue, oi ?oe iiai?a?eaaaony iai?aai, eia?a - iaeaai. I?ioaao?a iiaoi?yaony ai
oao ii?, iiea ?oe ia aa?iaony a enoiaio? oi?eo. Eii?aeiaou oi?ae ia?aoiaa n
?a?iiai ia aaeia e n aaeiai ia ?a?iia e iienuaa?o a?aieoo iauaeoa. ?en.
1. Noaia ?aaiou ionea?eaa?uaai aeai?eoia "?oea". I?e iaoi?aaiee iiaie oi?ee eiioo?a,
?ann?eouaaaony ?annoiyiea ia?ao i?aauaouae iaeaaiiie oi?eie e iiaie. Anee iii
i?aauoaao iaeioi?o? a?aieoo (ii oiie?aie? a 5 aaeieo), iia caiiieiaaony. E eiioo
iino?iaiey neaeaoiie eeiee i?ia?aiia eiaao iannea eii?aeiao aa?oei eiiaiie,
eioi?ay yaeyaony neaeaoiie eeieae iauaeoa. Iinea iino?iaiey neaeaoiie eeiee
i?iecaiaeony n?aaiaiea aa n nieneii oaaeiiia ecaanoiuo neiaieia. I?e iaoi?aaiee
niaiaaaiey, i?ia?aiia caienuaaao a no?ieo iaeaaiiue neiaie. #include <vcl.h> #include "MainFormUnit.h" //--------------
------------------------------------------------------------- //----------------------------------------
----------------------------------- //--------
------------------------------------------------------------------- 9323_1-
>Picture->LoadFromFile(FileName); AnsiString Error = "Ioeaea caa?ocee oaeea ecia?a?aiey! Ioeaea
nenoaiu: "; return false;
MessageBox(Handle,"Oaeie oi?iao oaeea iiea ia iiaa??eaaaony...", //------------------------------------------------------------------
--------- MainForm->DeleteActiveChildForm(); void __fastcall TChildForm::AverageFilter() if (AverageFilterDialogForm-
>ShowModal() == mrCancel) int Value = atoi(AverageFilterDialogForm->Edit1-
>Text.c_str()); Byte* NextLine = NULL; { for (J = 0; J <= 9323_1->Picture-
>Bitmap->Width - 1; J++)
PrevisionLine = (Byte*)9323_1->Picture->Bitmap->ScanLine[I - 1]; if (J + 1 < 9323_1->Picture->Bitmap-
>Width) Summ += CurrentLine[J]; if (I + 1 < 9323_1->Picture->Bitmap-
>Height) Summ += NextLine[J - 1]; Summ += NextLine[J + 1]; 9323_1-
>Visible = false; // ?annoiyiea ia?ao
aaoiy oi?eaie return sqrt(a*a +
b*b); void __fastcall TChildForm::OSR() // N?aa
nio?aiyaony ?acoeuoao ?aniiciiaaiey //
Iai?aaeaiey aae?aiey ?oea // Eii?aeiaou ia?aie ano?a?e n
oaeouei iauaeoii X = OSRForm->Width - OSRForm->9323_1-
>Width;
OSRForm->9323_1->Picture->Bitmap->Assign(9323_1->Picture-
>Bitmap); OSRForm->9323_1-
>Canvas->Rectangle(0, 0, OSRForm->9323_1->Width - 1, Graphics::TBitmap* To9323_ = OSRForm->9323_1-
>Picture->Bitmap; int MaxX = 0; int BeginY = 0; // A?aiaiiay no?oeoo?a
eii?aeiao oi?ee for (X = MaxX; X < From9323_-
>Width; X++) goto
FindedLabel; goto FindedLabel; if (X + 1 ==
From9323_->Width) // Anee ia iaoee ie
iaiiai ?a?iiai ieenaea, oi auoiaei ec i?ioaao?u // Nia?aea
caaa?a iaeoe iaeneiaeuiua a?aieou iaia?o?aiiie oeao?u, // Oae?a euai naio? aa?oi?? oi?eo oeao?u, aey ia?aea
iino?iaiey // Naiay aa?oiyy oi?ea // Iiai?a?eaaai
iaeaai (iiaia iai?aaeaiea - naaa?) // Iiea ia i?eaai a
enoiaio? oi?eo, auaaeyai eiioo? iauaeoa
{ if (B < 255) // Eia?a iiai?a?eaaai "iai?aai" case
East: Direct = North; if
(TopPoint.Y > cY) Direct = South; // ?a { Direct = West; //
Caiaa Direct = South; // Eia?a iiai?a?eaaai "iai?aai" // Ii?ao yoi naiay aa?oiyy
oi?ea? X = TopPoint.X; //
Iiai?a?eaaai iaeaai (iiaia iai?aaeaiea - ?a) Line = (Byte*)From9323_->ScanLine[cY]; // A caaeneiinoe io
oaeouaai iai?aaeaiey aae?aiey ?oea // Anee yeaiaio "?a?iue", iiai?a?eaaai niiaa
"iaeaai" Vertex.Y = cY; Direct = West; // Ainoie ToLine =
(Byte*)To9323_->ScanLine[cY]; if (Distance(Vertex, ShapeVector[ShapeVector.size() - 1])
>= Treshold) // Eia?a iiai?a?eaaai
"iai?aai" // ?a { if (Distance(Vertex,
ShapeVector[ShapeVector.size() - 1]) >= Treshold) { // Anee yeaiaio
"?a?iue", iiai?a?eaaai niiaa "iaeaai"
Vertex.Y = cY; Direct = South; Direct = North;
Vertex.X = X; To9323_->Canvas-
>MoveTo(ShapeVector[0].X, ShapeVector[0].Y); To9323_->Canvas->LineTo(ShapeVector[i].X,
ShapeVector[i].Y); ShapeVector[i].Y -= Y;
AnsiString FileName = ExtractFilePath(Application->ExeName) + "TPL\\"; { OutFile <<
IntToStr(ShapeVector[i].Y).c_str() << endl; } if (Template) } TTemplate* FindTemplate(TShapeVector Vec) if (Templates[i] == Template) //-----------------------------
----------------------------------------------
| |