Смекни!
smekni.com

Інформаційний синтез системи автоматичного розпізнавання бланків документів (стр. 11 из 11)

polmassred[3,i]:=polmassred[3,i]/St;

end;

end;

procedure TForm0.Button6Click(Sender: TObject);

var i,j,kk:integer;

bit:Tbitmap;

begin

bit:=Tbitmap.Create;

bit.Width:=N;

bit.Height:=N;

for kk:=1 to 40 do

begin

bit.LoadFromFile('base\'+inttostr(kk)+'.bmp');

for i:=1 to N do

for j:=1 to N do

begin

picmas[kk,i,j]:=0;

picmas[kk,i,j]:=round(bit.Canvas.Pixels[i,j]/65536);

end;

end;

for kk:=41 to 80 do

begin

bit.LoadFromFile('base\'+inttostr(kk)+'.bmp');

for i:=1 to N do

for j:=1 to N do

begin

picmas[kk,i,j]:=0;

picmas[kk,i,j]:=round(bit.Canvas.Pixels[i,j]/65536);

end;

end;

for kk:=81 to 120 do

begin

bit.LoadFromFile('base\'+inttostr(kk)+'.bmp');

for i:=1 to N do

for j:=1 to N do

begin

picmas[kk,i,j]:=0;

picmas[kk,i,j]:=round(bit.Canvas.Pixels[i,j]/65536);

end;

end;

bit.Free;

//--------------------------------------------------------------

for kk:=1 to St do

begin

for i:=1 to N do

for j:=1 to N do

begin

sred_s[1,i,j]:=sred_s[1,i,j]+picmas[kk,i,j];

sred_s[2,i,j]:=sred_s[2,i,j]+picmas[40+kk,i,j];

sred_s[3,i,j]:=sred_s[3,i,j]+picmas[80+kk,i,j];

end;

end;

for i:=1 to N do

for j:=1 to N do

begin

sred_s[1,i,j]:=round(sred_s[1,i,j]/St);

sred_s[2,i,j]:=round(sred_s[2,i,j]/St);

sred_s[3,i,j]:=round(sred_s[3,i,j]/St);

end;

//--------------------------------------------------------------

end;

procedure TForm0.Button8Click(Sender: TObject);

var i,j:byte;

begin

if count < 120 then count:=count+1;

image1.Picture.LoadFromFile('base&bsol;'+inttostr(count)+'.bmp');

Edit3.Text:=inttostr(count);

if (count <= 40) then label3.Caption:='A'

else if ((count > 40) and (count <= 80)) then label3.Caption:='Б'

else if (count > 80) then label3.Caption:='B';

Series2.Clear;

Series1.Clear;

for i:=1 to Pol do Series2.Add(polmas[count,i]);

for j:=1 to 2*N do Series1.Add(round(evbin[count,j]/5));

end;

procedure TForm0.Button7Click(Sender: TObject);

var i,j:byte;

begin

if count > 1 then count:=count-1 else count:=1;

image1.Picture.LoadFromFile('base&bsol;'+inttostr(count)+'.bmp');

Edit3.Text:=inttostr(count);

if (count <= 40) then label3.Caption:='A'

else if ((count > 40) and (count <= 80)) then label3.Caption:='Б'

else if (count > 80) then label3.Caption:='B';

Series2.Clear;

Series1.Clear;

for i:=1 to Pol do Series2.Add(polmas[count,i]);

for j:=1 to 2*N do Series1.Add(round(evbin[count,j]/5));

end;

procedure TForm0.Button4Click(Sender: TObject);

var i,j:byte;

begin

Series2.Clear;

Series1.Clear;

for i:=1 to N do

for j:=1 to N do

image1.Canvas.Pixels[i,j]:=256-sred_s[1,i,j];

for i:=1 to Pol do Series2.Add(polmassred[1,i]);

for j:=1 to 2*N do Series1.Add(gilsred[1,j]);

end;

procedure TForm0.Button9Click(Sender: TObject);

var i,j:byte;

begin

Series2.Clear;

Series1.Clear;

for i:=1 to N do

for j:=1 to N do

image1.Canvas.Pixels[i,j]:=256-sred_s[2,i,j];

for i:=1 to Pol do Series2.Add(polmassred[2,i]);

for j:=1 to 2*N do Series1.Add(gilsred[2,j]);

end;

procedure TForm0.Button11Click(Sender: TObject);

var i,j:byte;

begin

Series2.Clear;

Series1.Clear;

for i:=1 to N do

for j:=1 to N do

image1.Canvas.Pixels[i,j]:=256-sred_s[3,i,j];

for i:=1 to Pol do Series2.Add(polmassred[3,i]);

for j:=1 to 2*N do Series1.Add(gilsred[3,j]);

end;


procedure TForm0.Button12Click(Sender: TObject);

begin

form0.Visible:=false;

form1.Show;

end;

procedure TForm0.Button13Click(Sender: TObject);

begin

form0.Visible:=false;

form11.Show;

end; end.