: , ,

 

 

 

: .

.

: . 97--62

..

: 97--650

: .

..

1999

 

 


.





1. :

1.1

1.2


1.3

1.4


2. :

2.1

2.2

3. - :

3.1

3.2

3.3

3.4


4. -

5.








:


, , -,

, .

, a.

. , .

, ,

c . , .

򠠠 , 3 ,

13 , 4 , 2 .

.......................................

1

1.1 .....................

1.2 ......................

1.3 .........................

1.4 ......................................

2

1.1 ....................

1.2 .........................

1.3 ......................................

.....................................

.....................................

...................................

...................................


. .

. - (n,1) .

. BMP-. ⠠ . 䠠 ꠠ .
1

1.1

, 1.1.1.


Vi Vj

 

 

 


Zi Zj

 

 

 
Xi Yj


1.1.1 -

{V, P(V)},

V ;

P(V) , :

(1.1.1)

i=1m;

m, r .

Vi Zi -.

H(Z), / :

(1.1.2)

L, :

(1.1.3)

L(Zi) , ;

P(Zi) .

H(Z)max, / Zi :

(1.1.4)

, Zi :

(1.1.5)

:

(1.1.6)

n = 3 Zi. , :

1=(0 0 0) 2=(1 1 1)

:

(1.1.7)

=0,1;

- Zi.

X , :

P10=0.2 + 0.02A (1.1.8)

P01=0.2 + 0.02B (1.1.9)

10 ;

01 ;

, .

, :

- ;

Y - .

P(Y/X) , X1 X2.

1 :

1 p01 , i = 1

P(xi,yj) = P01/3 , i = 2,3,4. (1.1.10)

0 , i = 5,6,7,8.

P(X,Y) :

P(xi,yj)=P(xi)P(yj/xi) (1.1.11)

P(X,Y), P(Y). :

P(yi)=P(x1,yi)+ P(x2,yi) (1.1.12)

, P(X/Y) :

P(xi/yj)=P(xi,yj)/P(yj) (1.1.13)

H(X), / H(Y), / :

(1.1.14)

(1.1.15)

H(X/Y), / H(Y/X), / :

(1.1.16)

(1.1.17)

H(X,Y), / :

(1.1.18)

I(X,Y), / :

(1.1.19)

V, :

V = 1000(A+1) (1.1.20)

R, / :

R = V ×I(X,Y) / 3; (1.1.21)

, / :

= (H(X) ×V ) (1.1.22)


1.2

:

m = 15;

r = 10;

.

Vi( - Zi), 1.1.1. 1.2.2.

. , . , , 1, 0. , , . . , .

1.2.1.

1.2.1 -

Vi P(Vi) Zi L(Zi)
1 0.231 11 2
2 0.183 10 2
3 0.1408 011 3
4 0.1042 0101 4
5 0.0732 01001 5
6 0.0732 01000 5
7 0.0479 00111 5
8 0.0479 00110 5
9 0.0282 00101 5
10 0.0282 00100 5
11 0.0141 00011 5
12 0.0141 00010 5
13 0.0056 000011 6
14 0.0056 000010 6
15 0.0028 000000 6

H(Z),/

1.1.2 :

H(Z) = 3.218 /

1.1.3 :

L = 3.5652

Zi 1.1.4:

H(Z)max = 3.218

1.1.5 Zi:

= 0.903

1.1.6:

= 0.176

n=3 Zi : 1 2, (1) (2) 1.1.7:

(1) = 0.4113 (2) = 0.5885

, 1.1.8 1.1.9 :

P10 = 0.3 P01 = 0.2

P(Y/X) 0 1, 1.1.10, 1.2.3. 1.2.3 . 1.2.3 .

1.2.2 - P(Y/X)

X Y
000 001 010 100 011 101 110 111
000 8000 0667 0667 0667 0000 0000 0000 0000 10000
111 0000 0000 0000 0000 1000 1000 1000 1000 10000

1.2.3 P(X,Y), 1.1.11. 1.2.3 .

1.2.3 - P(X,Y)

Y
000 001 010 100 011 101 110 111
000 3292 0274 0274 0274 0000 0000 0000 0000
111 0000 0000 0000 0000 0588 0588 0588 4119

P(Y) 1.1.12. 1.2.4 . .

1.2.4 - P(Y)

Y
000 001 010 100 011 101 110 111
3292 0274 0274 0274 0588 0588 0588 4119 10000

P(X,Y) P(Y), P(X/Y) 1.1.13. P(X/Y) 1.2.6.

H(X) H(Y) 1.1.14 1.1.15 :

H(X) = 0.9777 /

H(Y) = 2.2025 /

H(X/Y) H(Y/X) , 1.1.16 1.1.17 :

H(X/Y) = 0.0000 /

H(Y/X) = 1.2244 /

1.2.5 - P(X/Y)

X Y
000 111
000 1 0 1.0000
001 1 0 1.0000
010 1 0 1.0000
100 1 0 1.0000
011 0 1 1.0000
101 0 1 1.0000
110 0 1 1.0000
111 0 1 1.0000

1.1.18 H(X,Y):

H(X,Y) = 2.2014 /

:

H(Y/X) + H(X) = 2.2025 /

H(X/Y) + H(Y) = 2.2025 /

.

I(X,Y), 1.1.19:

I(X,Y) = 0.9777 /

1.1.20:

V = 6000 /c

R, 1.1.21:

R = 1956.1 /

1.1.22 :

= 5868.3 /

n (n,1) p01 p10. , . , H(X/Y) .

, n, 20..25.

1.2.1 1.2.2.


45

,%

15

20 40 60 100

, n

1.2.1


100


,%


15


20 40 60 100

p01,p10, %

1.2.1

1.3

n. Borland Pascal 7.0.

, n . n n, 1..100 3. .

:

flag . .

ver A B, .

set_codes - .

sourse . , flag.

deranges , sourse, (n,1)-. shr shl, flag.

decoder . 8 , , ,

.

graphik n (n,1) . (x0,y0).

y %.

.

1.4

- , , , ..

- (n,1) . , 1000 n = 20..25 10 01, .

2

2.1

, .. , . () , .

, . , .

.

()

 



, . .

, .

. .

. . , ( ).

, , .

.

() . , . :

) Q=S f (xi,yj) XOR fs (xi,yj) min( );

)

R(t,z)=òx òy f (x,y) . fs (x - t, y -z) max

: (, )

: .

.

: .

: .

:

-     (, , );

-     ;

-     ;

. .

: , , , , .

. , .. , , .

2.2

Borland Pascal.

.

Init_Graph_Mode SVGA. .. svga256.bgi BGI, ꠠ InstallUserDriver. , GrayScale SetRGBPalette.

ShowList . 9 , .. 3*3 . x y - , .

Init_Data : , .

Deranges .

20% . - . , .. , .

Filter . 16 : , , , , . .

Ramka . , x. flag .

. . . , , . , x y, . . , , .

. . .

1. / .. .- .:, 1971

2. .., .. . - .:.., 1976

3. .. - :, 1975

4. ..

- .: , 1967.

2.3

, . . 100% 40%. , , .

.

Program final_of_work;

uses crt,graph;

const a=5;

b=0;

m=10+(a mod 6); {15}

r=trunc((m+a-b)/2); {10}

var

n, {n (n,1) - }

temp,ent,out,symb,decode:byte; { }

p:array[1..m] of real; {}

p01,p10:real; {p }

z,dl:array[1..m] of byte; {, }

mask: array[1..8] of byte; { }

data_n,data_p

:array[1..100] of integer; { }

i,j, {}

count_of_errors, { }

dlina,sh, { }

count:integer; { }

range,c,s,l:byte;

fl:boolean;

function flag(px:real):boolean;

{--- p---}

var ww,wq : word;

begin

ww := round(px * 100);

wq := random(100);

if ww > wq then flag := true else flag := false;

end;

procedure ver; {------------ ---------}

var s,i3,j3: integer;

tmp,s1:real;

begin

s:=0;tmp:=0; { }

for j3:=1 to m do

s:=s+sqr(j3-r);

s:=s+m;

for i3:=1 to m do

p[i3]:=(1+sqr(i3-r))/s;

{------- --------}

for i3:=1 to m-1 do { }

begin

tmp := p[i3]; { }

for j3:=i3 to m do

if p[j3] >= tmp then

begin

tmp := p[j3]; { i }

s:=j3 { }

end;

p[s] := p[i3]; {}

p[i3] := tmp

end;

end;

procedure deranges; {---------- ------------}

var tmp : byte;

c0,c1 : integer; { 0 1 }

begin

out := 0; { }

for i := 0 to 7 do { }

begin

c0 := 0; { }

c1 := 0;

tmp := (z[ent] shr i) and 1; { }

for j := 1 to n do { (n,1)-}

case tmp of { }

0 : if flag(p01) then inc(c1) else inc(c0);

1 : if flag(p10) then inc(c0) else inc(c1)

end;

if c1 > c0 then out := out or (1 shl i)

end; { }

end;

procedure set_codes; {----- - -----}

var i3,j2 : byte;

function numb(v:real):byte;{ , }

var i2 : byte; {"" , }

begin

for i2 := 1 to m do { }

if(v >= p[i2 + 1]) and (v <= p[i2]){ }

then

numb := i2; { ""}

end;

begin {-------------of procedure------------}

for i := 1 to m do { }

begin

z[i] := 0;

dl[i] := 0

end;

range := 8; { - }

c := 0; { "" - }

repeat { ......}

if c = 0 { ...}

then

dec(range); {... }

inc(c); { }

if (z[c] = z[c + 1]) and (c <= m)

{ ...}

then

begin {... }

fl := false; { }

i := c; {"" }

j := c + 1; {"" }

if (z[j] = z[j + 1]) or (j + 1 < m)

{ ...}

then

fl := true; {... }

while fl do { ...}

begin

inc(j); {... }

if (z[j] <> z[j - 1]) or (j > m - 1) then

fl := false

end;

if((j - i) > 1) and (j < m)

{ > 2 ...}

then

dec(j); {... }

s := numb((p[i] + p[j])/2); {}

if p[i] = p[j] { ...}

then

s := i; { - ""}

if j <= m { ...}

then

for l := i to j do {... }

if l <= s then { }

begin

z[l] := z[l] or (1 shl range);

dl[l] := dl[l] + 1

end

else

dl[l] := dl[l] + 1;

if j < m then { }

c := j

else

c := 0

end

else if c = m then c := 0;

until range = 0;{... }

{-------------- --------------}

temp := 0;

for i := 1 to 8 do

begin

temp := temp or (1 shl (7 - (i - 1)));

mask[i] := temp

end

end;

function sourse:byte; {----- 1..15-----}

var cou : byte;

tu,ttu : real;

begin

cou := 1; { }

ttu := p[cou]; { 0..1}

tu := random;

while ttu < tu do begin { random...}

inc(cou);

ttu := ttu + p[cou]; { }

end;

sourse := cou; { 1..15}

end;

procedure decoder; {--- ---}

var

code:byte;

begin

code:=out;

for i:=1 to 8 do { }

begin

temp:=code and mask[i]; { }

for j:=1 to m do

if (temp=z[j]) and (i=dl[j]){ }

then

decode:=j; {...}

end;

end;

procedure graphiki; {----------- ----------}

const x0=250; { }

y0=400;

var nn,ss,ii:integer;

sr:string;

driver,mode,errcode:integer;

begin

driver:=detect;

initgraph(driver, mode,''); { }

errcode:=graphResult;

if errcode<>grOk then

begin

Writeln(' . ');

writeln(GraphErrorMSG(Errcode));

halt

end;

setcolor(white); { }

line(x0,y0,x0,y0-300); {------ y-----}

line(x0,y0,x0+200,y0); {------ x-----}

SetTextStyle(DefaultFont, HorizDir, 1); { }

OutTextXY(x0,y0+40,' , n');

SetTextStyle(DefaultFont, VertDir, 1);

SetTextJustify(LeftText,TopText);{-- --}

OutTextXY(x0-50,180,' , %');

SetTextStyle(DefaultFont, HorizDir, 1);

for i:=1 to 5 do

line(x0+i*35,y0,x0+i*35,y0-5);{ x}

outtextxy(x0+35,y0+10,'20');

outtextxy(x0+5*35,y0+10,'100');

for i:=1 to 4 do

line(x0,y0-i*65,x0+5,y0-i*65);{ y}

outtextxy(x0-20,y0-65,'15');

outtextxy(x0-20,y0-3*65,'45');

for nn:=1 to 33 do

begin { }

setcolor(2);

line(x0+(nn+1)*5,round((y0-data_n[nn])),

x0+(nn+2)*5,round((y0-data_n[nn+1])));

end;

setcolor(15);

outtextxy(50,460,'Press any key...');

readkey;

ClearViewPort;

line(x0,y0,x0,y0-360); {------ y-----}

line(x0,y0,x0+200,y0); {------ x-----}

SetTextStyle(SmallFont, HorizDir, 5); {--- --}

OutTextXY(x0,y0+40,' p01 p10 , %');

SetTextStyle(SmallFont, VertDir, 5);

SetTextJustify(LeftText,TopText); {----- -----}

OutTextXY(x0-50,140,' , %');

SetTextStyle(DefaultFont, HorizDir, 1);

for i:=1 to 5 do

line(x0+i*35,y0,x0+i*35,y0-5); {---- x---}

outtextxy(x0+35,y0+5,'20');

outtextxy(x0+5*35,y0+5,'100');

for i:=1 to 4 do

line(x0,y0-i*75,x0+5,y0-i*75); {---- y---}

outtextxy(x0-25,y0-75,'25');

outtextxy(x0-25,y0-2*75,'50');

outtextxy(x0-25,y0-3*75,'75');

outtextxy(x0-25,y0-4*75,'100');

{line(x0,y0-4*75,x0+200,y0-4*75);}

setcolor(2);

for nn:=1 to 13 do

{ }

line(x0+(nn+1)*12,round((y0-data_p[nn])),

x0+(nn+2)*12,round((y0-data_p[nn+1])));

end;

{===================== =======================}

Begin

clrscr;

p10:=0.2+0.02*a;

p01:=0.2+0.02*b;

randomize; {-- --}

ver; { }

set_codes; {-------- ---------}

TextColor(15);

gotoxy(10,1);

write(' :');

gotoxy(1,2);write(' :');

gotoxy(3,5);write(' : ',p01:4:3);

gotoxy(3,6);write(' : ',p10:4:3);

gotoxy(40,1);write(' : ');

for i := 1 to m do {-------- --------}

begin

gotoxy(45,1+i);

write(' z(',i,') = ');

gotoxy(55,1+i);

for j := 1 to dl[i] do

write((z[i] shr (8 - j)) and 1); {}

end;

gotoxy(10,19);

write(' : ');

read(dlina);

write(' n (n,1) - : ');

read(n);

count_of_errors := 0;

for sh := 1 to dlina do

begin {-------- ----------}

ent := sourse; {-- ---}

deranges; {----------- -----------}

decoder; {---- ----}

if ent <> decode then inc(count_of_errors);

end;

gotoxy(10,23);

write(' : ');

TextColor(12);

write( ' = ',count_of_errors);

TextColor(15);

gotoxy(10,24);

write('Please wait...');

{--------- count_of_errors n-----------}

n := 0;count := 0;dlina := 100;

repeat

n := n + 3;

inc(count);

count_of_errors := 0;

for sh := 1 to dlina do

begin

ent := sourse;

deranges;

decoder;

if ent <> decode then inc(count_of_errors);

end;

data_n[count] := round(count_of_errors*3) ;

until n >= 96;

{--- count_of_errors p01 p10---}

n:=3;count:=0;dlina := 100;p01:=0;p10:=0;

repeat

p01:=p01+0.07;

p10:=p10+0.07;

inc(count);

count_of_errors := 0;

for sh := 1 to dlina do

begin

ent := sourse;

deranges;;

decoder;

if ent <> decode then inc(count_of_errors);

end;

data_p[count] := round(count_of_errors*3) ;

until p01 >= 0.98;

gotoxy(10,24);

writeln('Press any key to continue...');

readkey;

graphiki;

readkey;

closegraph;

End.

Program Final_of_work;

uses graph;

const BiH=50; {------- ------}

BiW=160; {------- ------}

stroka:array[1..10] of char=

('I','h','i','G','F','k','H','g','J','j');

{----- -----}

type arr=array[1..BiW,1..BiH] of byte; { -}

const

path0='work.bmp'; { bmp- }

var file0,file1:file of byte; { }

counter, { }

rasp:byte; { }

f0, { }

f:arr; { , }

x,y, { }

xmin, ymin,xmax, ymax , { }

xt, { x }

xsav,{ x }

i,j, { }

xm,xk,ym,yk,

{ ... }

k,{ }

di,dj : integer;

{ x y }

flag :boolean; { }

kfmax, { }

max, { }

kf, { }

smin:longint; { }

Procedure Init_Graph_Mode; {----- -----}

var

Driver, { }

Mode, { }

TestDriver, { BGI}

ErrCode: Integer; { }

function TestDetect: Integer; far;

{ }

{ , .. = +}

begin

TestDetect := 3; { 800*600 }

end;

begin

TestDriver := InstallUserDriver('svga256', @TestDetect);

{ BGI}

if GraphResult <> grOk then

begin

Writeln(' :',

GraphErrorMSG(ErrCode));

Halt(1);

end;

Driver := Detect;{ -SVGA}

InitGraph(Driver, Mode, '');

{ ;}

{ - }

ErrCode := GraphResult;

if ErrCode <> grOk then

begin

Writeln(' :',

GraphErrorMSG(ErrCode));

Halt(1);

end;

SetTextStyle(DefaultFont, HorizDir, 1); { }

OutTextXY(120,20,' ...');

for x := 0 to 255 do { grayscale}

SetRGBPalette(x,x,x,x);

OutTextXY(450,20,'Ok.');

end;

Procedure showlist(xn,yn:integer);

{--- c 9 ---}

{xn,yn- }

begin

x := 1; { - }

y := 1;

repeat { - }

for i := -1 to 1 do

for j := -1 to 1 do { - 3*3}

PutPixel((3*x+i)+xn,(3*BiH-3*y+j)+yn,f[x,y]);

x := x + 1; { x}

if x = BiW then { ...}

begin

x := 1; {... }

y := y + 1

end;

until y = BiH; { }

end;

procedure Init_Data; {----- -----}

var t:byte;

begin

assign(file0,path0);

reset(file0);

seek(file0,$436);

for y:=1 to BiH do

for x:=1 to BiW do

begin

read(file0,t); { }

f0[x,y]:=t;

end;

for x := 1 to BiW do{ }

for y := 1 to BiH do

f[x,y]:=f0[x,y];

end;

Procedure Deranges; {----------- -----------}

const u=20; {--- % ---}

var count, { }

w : integer; { }

begin

count := 0;

w:=0;

randomize; { }

for x := 1 to BiW do { }

for y := 1 to BiH do

if f[x,y] = 0 then w:= w+1;

repeat {------ ...------}

x := random(BiW); { }

y := random(BiH);

if (x in [3..BiW-2]) and (y in [3..BiH-2]) then

begin

if (f[x,y] = 255) then { ...}

f[x,y] := 1; {... }

if (f[x,y] = 0) then { ...}

f[x,y] := 255 {... }

end;

count := count + 1; {. }

until 100*count >= u * w; { }

for x := 1 to BiW do { 0- }

for y := 1 to BiH do

if f[x,y] = 1 then

f[x,y] := 0

end;

Procedure Filter; {----- -----}

{ ;}

{ ,}

{ }

const mask1:array[1..4,-1..1,-1..1] of byte =

(((1,1,0),(1,0,0),(1,1,0)),

((1,1,1),(1,0,1),(0,0,0)),

((0,1,1),(0,0,1),(0,1,1)),

((0,0,0),(1,0,1),(1,1,1)));

{ , "" }

mask2:array[5..12,-2..2,-2..2] of byte =

(((0,0,0,0,0),(0,0,0,0,0),(0,0,1,0,0),(0,1,0,0,0),(0,0,0,0,0)),

((0,0,0,0,0),(0,0,0,0,0),(0,1,1,0,0),(0,0,0,0,0),(0,0,0,0,0)),

((0,0,0,0,0),(0,1,0,0,0),(0,0,1,0,0),(0,0,0,0,0),(0,0,0,0,0)),

((0,0,0,0,0),(0,0,1,0,0),(0,0,1,0,0),(0,0,0,0,0),(0,0,0,0,0)),

((0,0,0,0,0),(0,0,0,1,0),(0,0,1,0,0),(0,0,0,0,0),(0,0,0,0,0)),

((0,0,0,0,0),(0,0,0,0,0),(0,0,1,1,0),(0,0,0,0,0),(0,0,0,0,0)),

((0,0,0,0,0),(0,0,0,0,0),(0,0,1,0,0),(0,0,0,1,0),(0,0,0,0,0)),

((0,0,0,0,0),(0,0,0,0,0),(0,0,1,0,0),(0,0,1,0,0),(0,0,0,0,0)));

{ }

mask3:array[13..14,-2..2,-1..1] of byte =

(((1,0,0),(1,0,0),(1,1,0),(1,0,0),(1,0,0)),

((0,0,1),(0,0,1),(0,1,1),(0,0,1),(0,0,1)));

mask4:array[15..16,-1..1,-2..2] of byte =

(((1,1,1,1,1),(0,0,1,0,0),(0,0,0,0,0)),

((0,0,0,0,0),(0,0,1,0,0),(1,1,1,1,1)));

{ , "" }

var m,n,l : integer; { }

flg : boolean; { }

su : array[1..16] of longint; { }

begin

for i := 3 to BiW-2 do { }

for j := 3 to BiH-2 do

begin

l := 0; { ...}

for m:=-1 to 1 do

for n:= -1 to 1 do

l := l + f[i+m,j+n];

if (l = 255) and (f[i,j] = 255) then

f[i,j] := 0; {... }

{ ...}

if (l >= 255*8) and (f[i,j] = 0) then

f[i,j] := 255; {... }

{ }

for l := 1 to 16 do

su[l] := 0;

{ }

for l := 1 to 4 do

for m:=-1 to 1 do

for n:= -1 to 1 do

su[l] := su[l] + ((not f[i+m,j+n]) xor mask1[l,m,n]) and 1;

for l := 5 to 12 do

for m:=-2 to 2 do

for n:=-2 to 2 do

su[l] := su[l] + ((not f[i+m,j+n]) xor mask2[l,m,n]) and 1;

for l := 13 to 14 do

for m:=-2 to 2 do

for n:=-1 to 1 do

su[l] := su[l] + ((not f[i+m,j+n]) xor mask3[l,m,n]) and 1;

for l := 15 to 16 do

for m:=-1 to 1 do

for n:=-2 to 2 do

su[l] := su[l] + ((not f[i+m,j+n]) xor mask4[l,m,n]) and 1;

{--- ---}

{ - }

l := 0;

flg := false;

repeat

l := l + 1;

if su[l] = 0 then

flg := true;

until (flg) or (l = 4);

if flg then

f[i,j] := 0;

{ - 3*3}

l := 4;

flg := false;

repeat

l := l + 1;

if su[l] = 0 then

flg := true;

until (flg) or (l = 12);

if flg then

for m := -2 to 2 do

for n := -2 to 2 do

f[i+m,j+n] := 255;

{ - }

l := 12;

flg := false;

repeat

l := l + 1;

if su[l] = 0 then

flg := true;

until (flg) or (l = 16);

if flg then

f[i,j] := 255;

end

end;

{----------- ----------}

procedure ramka(zx:arr;flagx:boolean);

var

c : integer; { }

begin

xmin:=BiW;xmax:=0;ymin:=BiH;ymax:=0;

{ ...}

c:=0; { }

xt := xt + 1; { }

repeat { xt ...}

xt := xt + 1;

for y := 3 to BiH-2 do { }

if zx[xt,y] = 0 then

c:= c+1;

until (c <> 0) or (xt > BiW - 6);

{... }

c:= 0; { }

repeat { ...}

c := 0;

for y := 3 to BiH - 2 do { }

if zx[xt,y] = 0 then { ...}

begin

c:=c+1; {... . }

if xt < xmin then xmin := xt; {.....}

if xt > xmax then xmax := xt;

if y < ymin then ymin := y;

if y > ymax then ymax := y

end;

if xt <> 0 then xt := xt + 1; {. x}

until (c=0) or (xt > BiW - 2);{... }

if flagx then { ...}

begin {... ;100-}

for x:=xmin-1 to xmax+1 do f[x,ymin-1]:=100;

for x:=xmin-1 to xmax+1 do f[x,ymax+1]:=100;

for y:=ymin-1 to ymax+1 do f[xmin-1,y]:=100;

for y:=ymin-1 to ymax+1 do f[xmax+1,y]:=100

end

end;

{===================== =======================}

BEGIN

Init_Graph_Mode;

OutTextXY(120,30,' ... ');

Init_Data;

OutTextXY(345,30,'Ok.');

flag := false;

smin:=BiH*BiH; {max }

For counter := 1 to 10 do { }

begin { min }

Ramka(f0,flag);

if (xmax-xmin)*(ymax-ymin) <= smin then

smin:= (xmax-xmin)*(ymax-ymin)

end;

OutTextXY(300,50,' : ');

Deranges;

ShowList(170,70);

Filter;

OutTextXY(270,260,' : ');

xt := 2;

ShowList(170,280);

OutTextXY(120,500,' : ');

SetTextStyle(DefaultFont, HorizDir, 4);

flag := true; { }

counter := 0;

Repeat {--- ---}

counter := counter + 1;{ }

Ramka(f,flag);

{--------- ---------}

kfmax:=0; {min Kf}

xsav:=xt; { x }

xm:=xmin; { ...}

xk:=xmax;

ym:=ymin;

yk:=ymax;

xt:=2; { x - }

for k := 1 to 10 do {--- ---}

begin

Ramka(f0,not flag);

di:=0; { x}

dj:=0; { y}

max:=0; {min Kf}

if (xk-xm >= xmax-xmin) and (yk-ym >= ymax-ymin)

{ <= ...}

then {... }

repeat

kf:=0; {min temp - Kf}

{--- ---}

for i:=xmin to xmax do

for j:=ymin to ymax do

kf := kf +

(f0[i+di,j+dj] * f[i-xmin+xm,j-ymin+ym]) and 1;

if kf > max then max := kf; { max}

di:=di+1; {. x}

if xmax-xmin+di>=xk-xm { x}

then {... y}

begin

di:=0;

dj:=dj+1

end;

until (ymax-ymin+dj>=yk-ym);

{... y}

if max > kfmax { max...}

then

begin

kfmax:=max;

rasp:=k {... }

end

end;

xt:=xsav; { x}

ShowList(170,280);

if (xk-xm)*(yk-ym) >= smin{ }

then {... }

OutTextXY(190 + 35*counter,520,stroka[rasp]);

Until xt >= BiW - 15;

ShowList(170,280);

ReadLn;

CloseGraph; { }

END.


:


 
 
 
 
 
, , .
 
 
  
  
   
 
 
bigmir)net TOP 100