.

Программная система обработки и анализа изображений

Язык: русский
Формат: реферат
Тип документа: Word Doc
0 685
Скачать документ

Niaea?aeaiea

TOC \t “Caaieiaie 3,2,Caaieiaie ?acaeaea,1” Aaaaeaiea GOTOBUTTON
_Toc344370106 PAGEREF _Toc344370106 3

Oaoie/aneea ia?aiao?u GOTOBUTTON _Toc344370107 PAGEREF
_Toc344370107 4

Aiciiaeiinoe nenoaiu. GOTOBUTTON _Toc344370108 PAGEREF
_Toc344370108 4

Aiia?aoiia iaania/aiea. GOTOBUTTON _Toc344370109 PAGEREF
_Toc344370109 4

I?ia?aiiiia iaania/aiea. GOTOBUTTON _Toc344370110 PAGEREF
_Toc344370110 4

Iienaiea no?oeoo?u nenoaiu e i?eioeeia aa ?aaiou GOTOBUTTON
_Toc344370111 PAGEREF _Toc344370111 5

Iienaiea iaoiaea GOTOBUTTON _Toc344370112 PAGEREF _Toc344370112 6

Iienaiea i?ia?aiiu GOTOBUTTON _Toc344370113 PAGEREF _Toc344370113
7

No?oeoo?a aacu aeey o?aiaiey yoaeiiiuo neiaieia GOTOBUTTON
_Toc344370114 PAGEREF _Toc344370114 9

Oaeno i?ia?aiiu GOTOBUTTON _Toc344370115 PAGEREF _Toc344370115 12

Aaaaeaiea

A ianoiyuaa a?aiy, n ?inoii /enea ia?niiaeueiuo eiiiuethoa?ia, ia?iiiia
eiee/anoai eioi?iaoeee aaiaeeony n aoiaaeiuo iineoaeae ia iaaieoiua
aeenee eiiiuethoa?ia. ?acoiaaony yoi i/aiue ooiieoaeueiay ?aaioa. E auei
au iaieioi eiaoue a naiai ?anii?yaeaiee i?ia?aiiiia n?aaenoai, eioi?ia
auei au niiniaii aini?eieiaoue aoiaeiia ecia?aaeaiea aeieoiaioa, eioi?ia
aiiaua aiai?y yaeyaony ea?oeieie, e i?aia?aciauaaoue aai a oaeno,
ioa?anuaay i?e yoii ana eeoiee aeaoaee ecia?aaeaiey

( oaeea eae eeiee ?aciaoee, ia?aieaiey e o.i. ).

Yoio aii?in aieioao iiiaea oe?iu ii ?ac?aaioea i?ia?aiiiiai iaania/aiey
e nae/an a ie?a ?ac?aaioaii ianeieueei i?ia?aii aeey ?aniiciaaaiey
iaoeiiieniiai oaenoa. Ii yoi oieueei ia/aeueiue yoai ia iooe ?aoaiey
aeaiiie caaea/e. Aeaiiua i?ia?aiiiua i?iaeoeou ?aniiciatho oaeno n
aeiaieueii aieueoie aa?iyoiinoueth ioeaee i?e oneiaee iaea/anoaaiiiai
ecia?aaeaiey. I oii, /oiau ?aniiciaaaoue ?oeiieniue oaeno iiea aeaaea ia
i?eoiaeeony e aiai?eoue.

Oeaeueth ?ac?aaioee aeaiiie i?ia?aiiiie nenoaiu yaeyaony aeaoaeueiia
eco/aiea aeaiiiai aii?ina e nicaeaiea aeai?eoia, iicaieythuaai
i?aia?aciauaaoue a?aoe/aneia ecia?aaeaiea a oaeno. Aaeeinoaaiiia ioee/ea
aeaiiie nenoaiu io ?ac?aaioaiiuo ?aiaa yoi oi, /oi ?aniiciaaaoue
i?aaenoieo ea?iaeeou. Yoe ciaee eiatho nouanoaaiiia ioee/ea io i?eau/iie
iai ee?eeeeoeu e eaoeineeo neiaieia. Oaea iaeii oi, /oi iie ninoiyo ec
iiiaeanoaa ?acee/iuo oci?ia ioa?anuaaao eaeath no?ieoue ?aniiciaaaiea ia
ai?ieneie?iaaiee ecia?aaeaiey neiaiea n iiiiuueth eaeie eeai ooieoeee.
Oioy caeanue iiaeii iii?iaiaaoue eniieueciaaoue o?aeoaeueiua
i?aia?aciaaiey, n iiiiuueth eioi?uo iiaeii iienaoue ethaia neieue
oaiaeii neiaeiia ecia?aaeaiea. Ii oai?ey, iienuaathuay i?eiaiaiea
aeaiiuo i?aia?aciaaiee yaeyaony eiiia?/aneie oaeiie e yaeyaony
iaaeinooiiie.

Oaoie/aneea ia?aiao?u

Aiciiaeiinoe nenoaiu.

Nenoaia iaania/eaaao aaiae neaie?iaaiiiai ecia?aaeaiey oaenoa ec
a?aoe/aneiai oaeea, caienaiiiai a iaeiii ec oi?iaoia: PCX, BMP, WMF,
JPEG, GIF. ?acia? ecia?aaeaiey ia aeieaeai i?aauoaoue 3000 o 3000 oi/ae.
?aaeei neaie?iaaiey aeieaeai auoue aua?ai oae, /oiau ?acia?u
ioaeaeueiiai neiaiea (ea?iaeeoa) ia i?aauoae 30 ieenaeia e aue ia iaiaa
5 ieenaeia. Aeiioneaaony iaeeii no?ie e ai?eciioaee ia aieaa /ai ia 6°.
?annoiyiea iaaeaeo ioaeaeueiuie no?ieaie oaenoa ia aeieaeii auoue
iaiueoa 1/5 iaeneiaeueiie auniou ea?iaeeoa. Nenoaia iaania/eaaao
?acaeaeaiea aaaaeaiiiai oaenoa ia ioaeaeueiua no?iee e ia ioaeaeueiua
neiaieu. ?acoeueoaoii ?aaiou yaeyaony aecoaeueiia ?acaeaeaiea oaenoa ia
no?iee e neiaieu, a oaeaea oaenoiaue oaee, niaea?aeauee eii?aeeiaou
eaaeaeiai auaeaeaiiiai neiaiea oaenoa a ii?yaeea auaeaeaiey. I?e
?acaeaeaiee neiaieia nenoaia eniieuecoao i?aaeei ia/a?oaiey ea?iaeeoia,
a niioaaonoaee n eioi?ui ioaeaeueiue ea?iaeeo aienuaaaony a aieaa eee
iaiaa i?aaeeueiue eaaae?ao. Neaaeiaaoaeueii, ia aa?aioe?oaony, /oi
oaenou, ia/a?oaiea neiaieia eioi?uo ia niioaaonoaotho aeaiiiio i?aaeeo,
aoaeoo ?acaeaaoueny ia neiaieu ei??aeoii.

Oaeaea a ea/anoaa aeiiieiaiey e ia?aaioea ecia?aaeaiey nenoaia niiniaia
auaeaeyoue ioaeaeueii aa?oeeaeueiua e ai?eciioaeueiua eeiee. Aeaiiay
aiciiaeiinoue iiaeao auoue eniieueciaaia aeey aiaeeca ecia?aaeaiey ii
ioaeaeueiui eeieyi.

Naeaeaiu i?iaiua yenia?eiaiou ii aoeiiui i?aia?aciaaieyi. Yoe
i?aia?aciaaiey a aoaeouai iaauatho aeaoue iiiai iieaciiai a iaeanoe
ia?aaioee ecia?aaeaiee.

Aiia?aoiia iaania/aiea.

Aeey ?aaiou nenoaiu o?aaoaony:

IBM – niaianoeiue ia?niiaeueiue eiiiuethoa? n i?ioeanni?ii ia ieaea
Intel80486sx33, iauaiii ICO ia iaiaa 4 Ia.

Neaia? ethaiai oeia.

I?ia?aiiiia iaania/aiea.

Iia?aoeeiiiay iaiei/ea Windows 95, eeai Windows NT eee Windows aa?nee
3.1 eee 3.11 a eiiieaeoa n MS-DOS aa?nee ia ieaea 3.30.

I?ia?aiiiia iaania/aiea aeey neaia?a, iaania/eaathuaa aiciiaeiinoue
nio?aiaiey neaie?iaaiiiai ecia?aaeaiey a iaeiii ec oi?iaoia PCX, JPG,
BMP, WMF.

Iienaiea no?oeoo?u nenoaiu e i?eioeeia aa ?aaiou

A ea/anoaa n?aaeu aeey ?ac?aaioee aeaiiie nenoaiu aua?aia iia?aoeeiiiay
iaiei/ea Microsoft Windows. Yoi iaoneiaeaii oai, /oi Windows
iiaeaea?aeeaaao ?aaioo n a?aoe/aneeie ecia?aaeaieyie ia o?iaia
?ac?aaio/eea i?eeiaeaiee. Oai naiui ec ?aaiou eneeth/aaony aii?in i
eiaee?iaaiee naieo n?aaenoa ii ?aaioa n a?aoeeie. Anoanoaaiii nei?inoue
?aaiou nenoaiu ni noaiaea?oiuie a?aoe/aneeie n?aaenoaaie iiiai ieaea,
/ai iaiin?aaenoaaiiay caienue a aeaeaiiaiyoue, ii ia aeaiiii yoaia
?aaiou aii?in oie?aaony ia a nei?inoue.

Aeey ?ac?aaioee nenoaiu auea aua?aia n?aaea i?ia?aiie?iaaiey Borland
Delphi i?iecaiaenoaa oe?iu Borland International® USA, California.
Delphi i?aaenoaaeyao niaie n?aaeo, iiaeaea?aeeaathuoth aecoaeueiia
i?iaeoe?iaaiea i?eeiaeaiee aeey Windows. I?e yoii eioa?oaen
iieueciaaoaey nicaeaaony iooai eiiaeie?iaaiey e ?aaeaeoe?iaaiey
noaiaea?oiuo eiiiiiaioia (oi?i (ieii), iaith, iieae aaiaea, noaoe/aneeo
oaenoia, nieneia ?acee/iie oi?iu, ye?aiiuo eiiiie e o.i.), eiathueony a
noaiaea?oiie aeaeeioaea aecoaeueiiai eiino?oeoi?a. N?aaea aecoaeueiiai
i?ia?aiie?iaaiey aua?aia iioiio, /oi iia iaania/eaaao aiciiaeiinoue
iaeneiaeueii i?inoiai, auno?iai e ea/anoaaiiiai nicaeaiey noaiaea?oiuo
o?aaiaioia i?ia?aiiu.

Ii n?aaiaieth n ae?oaeie nenoaiaie aecoaeueiiai i?ia?aiie?iaaiey (Visual
FoxPro, DBase for Windows, Microsoft Visual Basic, Microsoft Visual C++,
Gupta SQLWindows e i?.) Delphi eiaao neaaeothuea i?aeiouanoaa.

Ana auoaia?a/eneaiiua nenoaiu yaeythony eioa?i?aoaoi?aie, oi anoue aeey
auiieiaiey nicaeaiiuo a ieo i?ia?aii o?aaoaony caa?ocea iiaeoey
eioa?i?aoaoi?a ycuea, eeai inaaaeieiiieeyoi?aie, eioi?ua oi?ie?otho
i?ia?aiio a aeaea EXE-iiaeoey, niaea?aeauaai inaaaeieiae i?ia?aiiu
(ii?aaeaeaiiui ia?acii caeiaee?iaaiiue oaeno) e iiaeoeue eioa?i?aoaoeee,
auiieiythuaai yoio inaaaeieiae. A Delphi™ ?acoeueoaoii aaia?aoeee
i?iaeoa yaeyaony i?ia?aiia ia ycuea Object Pascal™, eioi?ue
eiiieee?oaony eiiieeyoi?ii Borland Pascal 8.0™ a EXE – iiaeoeue, eeai
DLL – aeaeeioaeo. EXE – iiaeoeue niaea?aeeo i?ioeanni?iue eiae e iiaeao
auoue caiouai iaiin?aaenoaaiii ec Windows™. DLL-aeaeeioaeo iiaeao
eniieueciaaoue ethaia Windows™ – i?eeiaeaiea, a oii /enea iaienaiiia ia
ae?oaii ycuea. Aeaenoaeoaeueiay eiiieeyoeey iaania/eaaao cia/eoaeueii
aieueoaa auno?iaeaenoaea e aeaao auea?uo ii iaiyoe e aeeneiaiio
i?ino?ainoao (anee o/eouaaoue ?ano?nu, iio?aaeyaiua iiaeoeai
eioa?i?aoaoeee a eioa?i?aoe?othueo nenoaiao).

A ioee/ea io ?yaea nenoai (Visual FoxPro™, DBase for Windows™,
Microsoft® Visual Basic™) Delphi™ iaania/eaaao aiciiaeiinoue
aecoaeueiiai eiino?oe?iaaiey ia oieueei eioa?oaena, ii e ?yaea
noaiaea?oiuo iiaeoeae i?ia?aiiu, ia ioia?aaeaaiuo ia ye?aia. E?iia oiai,
Delphi™ eiaao noaiaea?oiua n?aaenoaa nicaeaiey nianoaaiiuo ye?aiiuo e
iaaeaeeiuo eiiiiiaioia, /oi iicaieyao iaia?aie/aiii ?anoe?youe iaai?
iauaeoia, eniieueciaaiea eioi?uo aiciiaeii a ethaii i?iaeoa e ie/ai ia
ioee/aaony io eniieueciaaiey noaiaea?oiuo iauaeoia aeaeeioaee Delphi™.

A Delphi™ aeinooiiu oaenou i?ia?aiiu, ii?iaeaeaiiie aecoaeueiui
eiino?oeoi?ii, i?e/ai eciaiaiey a ieo ia aeeytho ia aiciiaeiinoue
aeaeueiaeoae ia?aaioee eo eiino?oeoi?ii. Yoi aeaao aiciiaeiinoue
i?iecaiaeeoue o?aaoaioth ei??aeoeeth ?aaiou iauaeoia i?ia?aiiu, anee iia
ia iaania/eaaaony aecoaeueiui eiino?oeoi?ii.

Oaeei ia?acii, Delphi oaeiaeaoai?yao o?aaiaaieyi oaeianoaa, auno?iou e
ea/anoaa ?ac?aaioee. E?iia oiai, eniieueciaaiea ycuea Pascal iicaieyao
iaania/eoue i?eaieaioth nei?inoue auiieiaiey i?aia?aciaaiee, o?aaothueo
aieueoiai iauaia au/eneaiee ca n/ao aeaenoaeoaeueiie eiiieeyoeee e
aiciiaeiinoe iaiin?aaenoaaiiie ?aaiou n iaiyoueth eiiiuethoa?a.

Ia?aiia/aeueii ieaie?iaaeinue nicaeaoue aeai?eoi eiaee?iaaiey neiaiea,
eioi?ue au iicaieye inouanaeyoue aai iaeiicia/ioth eaeaioeoeeaoeeth (
?en. 1 ).

?en. 1

Oae a iai ieaie?iaaeinue aaeua ieenaeu eiaee?iaaoue 0, a /a?iua – 1 e
?anniao?eaaoue eo ie eae ioaeaeueiua a a?oiiie, o.a. a?oiia aaeuo
ieenaeia – yoi 0, aeaeaa a?oiia /a?iuo – 1 e o.ae. A ?acoeueoaoa,
neiaie, caeeth/aiiue a i?yiioaieueioth ( ?en. 1 ) ?aieo aeaao
neaaeothuee eiae:

010 01010

01010 0101010

010 01010

01010 0101010

010 01010

01010 0101

010 010

01010

0101

01

010

Ii ia i?aeoeea ieacaeinue, /oi aeaiiue niinia ia iiaeoiaeeo aeey
?aoaaiie caaea/e, o.e. ii i/aiue neeueii i?eaycai e ia/a?oaieth neiaiea.
I?e eciaiaiee ?acia?a neiaiea eee i?e iaiiiai ioee/iii ia/a?oaiee aai
eiae eciaiyaony i/aiue nouanoaaiii. I?e oaaee/aiee ?acia?a neiaiea
iiyaeythony aeiiieieoaeueiua no?iee, a cia/eo e aeiiieieoaeueiua neiaieu
eiaea. Neaaeiaaoaeueii iaeiicia/iia aeaeiaee?iaaiea neiaiea i?e aeaiiuo
ianoiyoaeuenoaao ia i?aaenoaaeyaony aiciiaeiui.

Ii aeaiiue iiuo ia i?ioae aea?ii. Auee naeaeaiu niioaaonoaothuea
auaiaeu, a eiaiii:

Iaeuecy i?eaycuaaoueny e ia/a?oaieth neiaiea, o.a. e ioaeaeueiui
ieenaeai.

Ioaeii aiaeece?iaaoue ecia?aaeaiea ia ii ieenaeai, a ii ioaeaeueiui
yeaiaioai, oaeei eae eeiee, e?oaei/ee, e?th/a/ee.

Aeueoa?iaoeaie i?aaeuaeouaio auaiaeo yaeyaony ii?aaeaeaiea ieioiinoe
ecia?aaeaiey a ioaeaeueiuo aai /anoyo.

Iienaiea iaoiaea

A ?ac?aaaouaaaiie nenoaia eniieuecoaony eiaiii o?aoee iaoiae, o.a.
ii?aaeaeaiea ieioiinoe ecia?aaeaiey a ioaeaeueiuo aai /anoyo.

Aai nooue caeeth/aaony a neaaeothuai:

Aia/aea ia anai ecia?aaeaiee auaeaeyaony iaeanoue, ia?aie/eaathuay
ioaeaeueiue neiaie.

Caoai yoa iaeanoue aeaeeony ia 9 ?aaiuo /anoae ( ?en. 2 ).

?en. 2

A eaaeaeii ec 9 eaaae?aoia iiaen/eouaaaony /enei /a?iuo ieenaeia e
aeaeeony ia ieiuaaeue aeaiiiai eaaae?aoa, o.a. ii?aaeaeyaony ieioiinoue
caiieiaiey a eaaeaeii eaaae?aoa.

Ana 9 ii?aaeaeaiiuo ieioiinoae i?aia?acothony a oi?iao O.OOO e aeaeaa a
no?ieo oeia O.OOO O.OOO O.OOO O.OOO O.OOO O.OOO O.OOO O.OOO
O.OOO.

I?aia?aciaaiea a no?ieo i?iecaiaeeony aeey aieaa oaeiaiiai o?aiaiey
aeaiiuo a aaca aeaiiuo ( no?oeoo?a aacu iienaia a i?eeiaeaiee ), oae eae
yoi iaiiiai oaeiaiaa, /ai aeaeaoue a aaca 9 iieae aeey o?aiaiey 9
cia/aiee ieioiinoe.

Aeaeiaee?iaaiea neiaiea i?iecaiaeeony aiaeiae/iui niiniaii, oieueei
iieo/aiiua aeaiiua n?aaieaathony ni cia/aieyie o?aieiuie a aaca aeaiiuo.

Iienaiea i?ia?aiiu

Ana iia?aoeee inouanoaeythony iin?aaenoaii aeaaiiai iaith i?ia?aiiu.
Aeaaiia iaith ninoieo ec neaaeothueo ioieoia:

Oaee

Ioe?uoue oaee

Ioe?uaaaony ieii auai?a oaeea. Aiciiaeiua ianee aeey auai?a ( BMP, PCX,
JPG ).

Anee aua?aiiue oaee yaeyaony i?aaeeueiui a?aoe/aneei oaeeii, oi o?aieiia
a iai ecia?aaeaiea auaiaeeony a ieii i?ia?aiiu.

Auaeaeeoue eeiee

Ia?aae iieueciaaoaeai iiyaeyaony aeeaeiaiaia ieii, a eioi?ii aio
i?aaeinoaaeyaony aiciiaeiinoue aua?aoue eaeea eeiee auaeaeyoue (
aa?oeeaeueiua eee ai?eciioaeueiua ).

Iia?aoeee

I/enoeoue

Oio oaee, eioi?ue aue ioe?uo ioe?uaaaony niiaa e ana eeiee iiyaeaoeany
a i?ioeanna ?aaiou oaeaeythony.

Ii?aaeaeeoue ieioiinoue ( o/aaa )

Yoio ioieo iaith i?aaeiacia/ai aeey iao/aiey nenoaiu. A ieia aeieaeai
iaoiaeeony yoaeiiiue oaeno. N iiiiuueth “iuoee” auaeaeyaony ioaeiue
neiaie e auae?aaony aeaiiue ioieo. Aneaae ca yoei iieueciaaoaeth
i?aaeinoaaeyaony aiciiaeiinoue oeacaoue oieeaeueiue eiae aeey aua?aiiiai
neiaiea. Ii?aaeaeaiiay ieioiinoue e eiae caienuaathony a aaco aeaiiuo.

?aniiciaoue

Yoio ioieo i?ioeaiiieiaeai i?aaeuaeouaio. N iiiiuueth “iuoee”
auaeaeyaony ioaeiue neiaie e auae?aaony aeaiiue ioieo. I?ienoiaeeo
ii?aaeaeaiea ieioiinoe aua?aiiiai neiaiea e aeaeaa a aaca inouanoaeyaony
iiene caiene, o eioi?ie iiea n yoaeiiiie no?ieie aieaa noiaeii n
ieioiinoueth auaeaeaiiiai neiaiea.

N?aaiaiea i?ienoiaeeo neaaeothuei ia?acii:

Ii?aaeaeyaony e neeaaeuaathony iaaeaeo niaie ?aciinoe iaaeaeo
ieioiinoyie yoaeiiiiai e auaeaeaiiiai neiaieaie aeey eaaeaeiai
eaaae?aoa. Oio yoaeiiiue neiaie, o eioi?iai iieo/aiiay noiia ieaaeaony
iaeiaiueoae n/eoaaony yeaeaaeaioii aeey auaeaeaiiiai.

I?aia?aciaaiey

Yoe i?aia?aciaaiey yaeythony yenia?eiaioaeueiuie e ia yaeythony
oeaeueth iinoaaeaiiie caaea/e. Iieo/aiiua ?acoeueoaou i?e aieaa aeoaieii
enneaaeiaaiee iiaoo auoue a aeaeueiaeoai eniieueciaaiu aeey ia?aaioee
ecia?aaeaiee.

Aoeiiia i?aia?aciaaiea

Oci?u

Yoe aeaa ioieoa no?iyo ecia?aaeaiea iieuecoynue aoeiiuie
i?aia?aciaaieyie n ?acee/iuie eiyooeoeeaioaie. A caaeneiinoe io yoeo
eiyooeoeeaioia ecia?aaeaiey iieo/athony ?acee/iuie.

Eeno iaii?ioieea

Iiyoue aea iniiauaaynue ia aoeiiuo i?aia?aciaaieyo no?ieony eeno
iaii?ioieea. Aeaiiia i?aia?aciaaiea eiaao ia?iiiia i?aeoe/aneia
cia/aiea, oae eae ioiineoaeueii neiaeiia ecia?aaeaiea ( eeno iaii?ioieea
) no?ieony n iiiiuueth iaeiie oi?ioeu.

Auoiae

Auoiae ec i?ia?aiiu.

I?eeiaeaiea

No?oeoo?a aacu aeey o?aiaiey yoaeiiiuo neiaieia

Eiae neiaiea Yoaeiiiay no?iea

Eiae neiaiea – iaeiicia/ii eaeaioeoeoee?oao o?aieiue neiaie. Oae eae a
aaca o?aiyony yoaeiiu ea?iaeeoia, aeey eioi?uo a ?onneii aeoaaeoa iao
i?eia?a ia/a?oaiey, oi aeey caiaiu ?aniiciaiiiai neiaiea ioaeii aua
o?aieoue e aai yoaeiiiia ecia?aaeaiea. Ii oae eae oeaeueth aeaiiie
?aaiou yaeyaony ia caiaia ?aniiciaiiuo neiaieia ia yoaeiiiua, a oieueei
niioianaiea n yoaeiiii, oi aeey yeiiiiee aeeneiaiai i?ino?ainoaa ?aoaii
o?aieoue ia yoaeiiiia ecia?aaeaiea neiaiea, a oieueei aai oieeaeueiue
eiae, n iiiiuueth eioi?iai iiaeii iaeiicia/ii eaeaioeoeoee?iaaoue
neiaie.

Yoaeiiiay no?iea – no?iea, niaea?aeauay a naaa ana 9 ieioiinoae
auaeaeaiiie iaeanoe.

Oaeno i?ia?aiiu

{$I CdBase.inc}

{$I CdComp.inc}

unit Main;

interface

uses

SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,

Forms, Dialogs, Reg_imag, Menus, Options, CmplSign, DBTables, DB;

type

TMainForm = class(TForm)

MainMenu: TMainMenu;

N1: TMenuItem;

N2: TMenuItem;

Image: TMultiImage;

N3: TMenuItem;

NFileOpen: TMenuItem;

OpenDialog: TOpenDialog;

NSelect: TMenuItem;

N4: TMenuItem;

N5: TMenuItem;

N6: TMenuItem;

N7: TMenuItem;

Onemore1: TMenuItem;

N8: TMenuItem;

N9: TMenuItem;

DataTable: TTable;

N10: TMenuItem;

DataTableOpis: TStringField;

DataTableID: TFloatField;

procedure N2Click(Sender: TObject);

procedure NFileOpenClick(Sender: TObject);

procedure NSelectClick(Sender: TObject);

procedure FormCreate(Sender: TObject);

procedure ImageMouseDown(Sender: TObject; Button: TMouseButton;

Shift: TShiftState; X, Y: Integer);

procedure ImageMouseUp(Sender: TObject; Button: TMouseButton;

Shift: TShiftState; X, Y: Integer);

procedure ImageMouseMove(Sender: TObject; Shift: TShiftState; X,

Y: Integer);

procedure N4Click(Sender: TObject);

procedure N7Click(Sender: TObject);

procedure Onemore1Click(Sender: TObject);

procedure N8Click(Sender: TObject);

procedure N9Click(Sender: TObject);

procedure N5Click(Sender: TObject);

procedure N10Click(Sender: TObject);

private

DetectRectX, DetectRectY: real; { Oaie, iiae eioi?ui auaeaeyoue
eeiee }

xStart, xEnd, yStart, yEnd: word;

BegSelect: boolean;

procedure DefGradient(var Gx, Gy: real; x,y: word);

procedure SetRect;

procedure DefPlotn;

procedure AfinConvert;

procedure OneMore;

procedure Mandel;

procedure Paporotnik;

function GetDensity: string;

public

{ Public declarations }

end;

var

MainForm: TMainForm;

implementation

{$R *.DFM}

procedure TMainForm.N2Click(Sender: TObject);

begin

Application.Terminate;

end;

procedure TMainForm.NFileOpenClick(Sender: TObject);

begin

if OpenDialog.Execute then begin

Image.ImageName := OpenDialog.FileName;

NSelect.Enabled := True;

end

else NSelect.Enabled := False;

end;

procedure TMainForm.NSelectClick(Sender: TObject);

var

Result: word;

begin

OptionForm := nil;

try

OptionForm := TOptionForm.Create(Self);

with OptionForm do begin

RectXEdit.Text := FloatToStr(DetectRectX);

RectYEdit.Text := FloatToStr(DetectRectY);

X1Edit.Text := IntToStr(xStart);

X2Edit.Text := IntToStr(xEnd);

Y1Edit.Text := IntToStr(yStart);

Y2Edit.Text := IntToStr(yEnd);

Result := ShowModal;

DetectRectX := StrToInt(RectXEdit.Text);

DetectRectY := StrToInt(RectYEdit.Text);

xStart := StrToInt(X1Edit.Text);

xEnd := StrToInt(X2Edit.Text);

yStart := StrToInt(Y1Edit.Text);

yEnd := StrToInt(Y2Edit.Text);

end; { with }

finally

OptionForm.Free;

end; { try }

if Result = mrOK then SetRect;

end;

{ Ii?aaeaeaiea a?aaeeaioia Gx e Gy a oi/ea [x,y] }

procedure TMainForm.DefGradient(var Gx, Gy: real; x,y: word);

var

a, b, c, d, e, g, h, i: byte;

begin

with Image.Canvas do begin

if Pixels[x-1,y-1] = clBlack then a := 0

else a := 1;

if Pixels[x,y-1] = clBlack then b := 0

else b := 1;

if Pixels[x+1,y-1] = clBlack then c := 0

else c := 1;

if Pixels[x-1,y] = clBlack then d := 0

else d := 1;

if Pixels[x+1,y] = clBlack then e := 0

else e := 1;

if Pixels[x-1,y+1] = clBlack then g := 0

else g := 1;

if Pixels[x,y+1] = clBlack then h := 0

else h := 1;

if Pixels[x+1,y+1] = clBlack then i := 0

else i := 1;

{ A?aaeeaio ii X }

Gx := g + 2*h + i – a – 2*b – c;

if Gx < 0 then Gx := 0;if Gx = 0 then Gx := 0.000001;{ A?aaeeaio ii Y }Gy := c + 2*e + i - a - 2*d - g;if Gy < 0 then Gy := 0;end; { with Image }end;procedure TMainForm.SetRect;varx, y: word;Gx, Gy, Qx, Qy: real;OutF: TextFile;S1,S2: string;beginAssignFile(OutF, 'tangs.000');Rewrite(OutF);{ Neaie?oai ana ecia?aaeaiea }with Image.Canvas do beginfor y := yStart+1 to yEnd-1 do beginfor x := xStart+1 to xEnd-1 do beginDefGradient(Gx,Gy,x,y); { Ii?aaeaeeoue a?aaeeaio a oi/ea [x,y] }{if Gx+Gy > 0 then Pixels[x,y+200] := clRed;}

Qx := ArcTan(Gy/Gx);

Qx := Round(Qx*180/Pi);

{ Qx := Round(90*Gx/4);

Qy := Round(90*Gy/4);}

Str(Qx:2:0, S1);

{ Str(Qy:2:0, S2); }

Write(OutF, S1+{‘ ‘+S2+}’ | ‘);

{ if (Q <= -Pi/3) or (Q >= Pi/3) then Pixels[x,y+200] := clRed;}

if (Qx > { DetectRectX}80) and (Qx < 100){ and (Q >
DetectRect*Pi/180) }then

Pixels[x,y+200] := clRed;

end; { for x }

WriteLn(OutF, ‘End Line’);

end; { for y }

end; { with Image.Canvas }

CloseFile(OutF);

end;

procedure TMainForm.DefPlotn;

var

i, j, x, y, dx, dy, Range, x1, y1: word;

Count: word;

begin

x := xStart; y := yStart;

dx := Round((xEnd-xStart+1) div 3);

dy := Round((yEnd-yStart+1) div 3);

x1 := x; y1 := y;

{ O?e eaaae?aoa ii aa?oeeaee }

for i := 1 to 3 do begin

if i = 2 then Range := (yEnd-yStart+1) – 2*dy

else Range := dy;

{ O?e eaaae?aoa ii ai?eciioaee }

for j := 1 to 3 do begin

if j = 2 then Range := (xEnd-xStart+1) – 2*dx

else Range := dx;

{ Neaie?oai aioo?e eaaae?aoa ii y }

for y := y1 to y1+Range do begin

{ Neaie?oai aioo?e eaaae?aoa ii x }

for x := x1 to x1+Range do begin

{ Iiaen/eouaaai /enei ia aaeuo ieenaeia }

if Image.Canvas.Pixels[x,y] <> clWhite then Inc(Count);

end; { for x }

end; { for y }

x1 := x1+dx; { Neaaeothuee eaaae?ao ii ai?eciioaee }

end; { for j }

y1 := y1+dy; { Neaaeothuee eaaae?ao ii aa?oeeaee }

end; { for i }

end;

procedure TMainForm.FormCreate(Sender: TObject);

begin

OpenDialog.FileName := ‘c:\delphi\mydir\diplom\pict\pict1.bmp’;

Image.ImageName := OpenDialog.FileName;

end;

procedure TMainForm.ImageMouseDown(Sender: TObject; Button:
TMouseButton;

Shift: TShiftState; X, Y: Integer);

begin

if Button = mbRight then begin

Image.ImageName := OpenDialog.FileName;

Exit;

end;

BegSelect := True;

with Image.Canvas do begin

Pen.Mode := pmXor;

Pen.Color := clGreen;

Pen.Style := psDot;

Brush.Style := bsClear;

xStart := X; yStart := Y;

xEnd := X; yEnd := Y;

end; { with }

end;

procedure TMainForm.ImageMouseUp(Sender: TObject; Button: TMouseButton;

Shift: TShiftState; X, Y: Integer);

begin

BegSelect := False;

with Image.Canvas do begin

Pen.Mode := pmCopy;

Pen.Color := clBlack;

Pen.Style := psSolid;

Brush.Style := bsSolid;

end; { with }

end;

procedure TMainForm.ImageMouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);

begin

if not BegSelect then Exit;

with Image.Canvas do begin

Rectangle(xStart, yStart, xEnd, yEnd);

xEnd := X; yEnd := Y;

Rectangle(xStart, yStart, xEnd, yEnd);

end; { with }

end;

procedure TMainForm.N4Click(Sender: TObject);

begin

Image.ImageName := OpenDialog.FileName;

end;

{ Aoeiiia i?aia?aciaaiea }

procedure TMainForm.AfinConvert;

var

dx, dy, Rand: word;

A, B, C, D, E, F: real;

x, y: word;

i: longint;

begin

A := 0.5; B := 0.5; E := 0;

C := 0.3; D := 0; F := 1;

dx := (xEnd-xStart+1) div 2; xEnd := xStart +2*dx – 1;

dy := (yEnd-yStart+1) div 2; yEnd := yStart +2*dy – 1;

x := xStart+dx; y := yStart+dy;

Randomize;

for i := 1 to 50000 do begin

Rand := Random(10);

Case Rand of

0..3: begin

x := xStart + 1 + (x-xStart+1) div 2;

y := yStart + 1 + (y-yStart+1) div 2;

end;

4: begin

x := xStart + dx + (x-xStart+1) div 2;

y := yStart + 1 + (y-yStart+1) div 2;

end;

5: begin

x := xStart + 1 + (x-xStart+1) div 2;

y := yStart + dy + (y-yStart+1) div 2;

end;

6..9: begin

x := xStart + dx + (x-xStart+1) div 2;

y := yStart + dy + (y-yStart+1) div 2;

end;

end; { Case }

Image.Canvas.Pixels[x,y] := clBlue;

end; { for i }

end;

procedure TMainForm.N7Click(Sender: TObject);

begin

AfinConvert;

end;

procedure TMainForm.OneMore;

var

dx, dy, Rand, Kx, Ky: word;

A, B, C, D, E, F: real;

x, y, K: real;

i: longint;

begin

Kx := 4; Ky := 4;

dx := (xEnd-xStart+1) div Kx; xEnd := xStart +Kx*dx – 1;

dy := (yEnd-yStart+1) div Ky; yEnd := yStart +Ky*dy – 1;

x := xStart; y := yStart;

for i := 1 to 100000 do begin

Rand := Random(Kx*Ky);

if (Rand = 0) or (Rand = 3) or (Rand = 12) or (Rand = 15) then

Continue;

K := (Rand – Kx*(Rand div Kx)) *dx;

x := K + xStart + 1 + (x-xStart+1) / Kx;

K := (Rand div Kx)*dy;

y := K + yStart + 1 + (y-yStart+1) / Ky;

Image.Canvas.Pixels[Round(x),Round(y)] := clBlue;

end; { for i }

end;

procedure TMainForm.Onemore1Click(Sender: TObject);

begin

OneMore;

end;

procedure TMainForm.Mandel;

var

Z, Z0, C: TComplex;

i, x, y: word;

begin

Z0 := TComplex.Create(0,0);

Z := TComplex.Create(0,0);

C := TComplex.Create(0,0);

for y := yStart to yEnd do begin

for x := xStart to xEnd do begin

C.Assign(x,y);

Z.Mul(Z0);

Z.Plus(C);

if (Z.Re < 2) and (Z.Im < 2) thenImage.Canvas.Pixels[Z.Re,Z.Im] := clBlue;Z.Assign(0,0);end; { for x }end; { for y }C.Free;Z.Free;Z0.Free;end;procedure TMainForm.N8Click(Sender: TObject);beginMandel;end;procedure TMainForm.Paporotnik;constA: array[0..3, 0..2, 0..3] of integer =(((0,0,0,0),(0,20,0,0),(0,0,0,0)),((85,0,0,0),(0,85,11,70),(0,-10,85,0)),((31,-41,0,0),(10,21,0,21),(0,0,30,0)), ((-29,40,0,0),(10,19,0,56),(0,0,30,0)));varb: array[1..15000] of word;k, n, i: word;newX, newY, z, x, y: real;Color: longint;beginx := 0; y := 0; z := 0;Randomize;for k := 1 to 15000 do beginb[k] := Random(10);if b[k] > 3 then b[k] := 1;

end; { for k }

i := 1;

{ b[i] := 1;}

for i := 1 to 10000 do begin

newX := (a[b[i],0,0]*x + a[b[i],0,1]*y + a[b[i],0,2]*z) / 100+

a[b[i],0,3];

newY := (a[b[i],1,0]*x + a[b[i],1,1]*y + a[b[i],1,2]*z) / 100+

a[b[i],1,3];

z := (a[b[i],2,0]*x + a[b[i],2,1]*y + a[b[i],2,2]*z) / 100+

a[b[i],2,3];

x := newX; y := newY;

Color := Random(65535);

Color := Color*100;

Image.Canvas.Pixels[Round(300-x+z), Round(350-y)] := clGreen;

end; { for k }

end;

procedure TMainForm.N9Click(Sender: TObject);

begin

Paporotnik;

end;

function TMainForm.GetDensity: string;

var

i, j: byte;

LenX, LenY, x, y, xOld, yOld, dx, dy: word;

BlackCnt, TotCnt: word;

P: real; { Ieioiinoue ieenaeia a eaaae?aioa
}

S, S1: string;

begin

{ Ii?aaeaeyai ieioiinoue a 9 eaaae?aioao }

{ auaeaeaiiiai aeeaiaciia }

S := ”;

LenX := xEnd-xStart+1;

LenY := yEnd-yStart+1;

xOld := xStart; yOld := yStart;

for j := 1 to 3 do begin

if j = 2 then dy := LenY-2*Round(LenY/3)

else dy := Round(LenY/3);

for i := 1 to 3 do begin

if i = 2 then dx := LenX-2*Round(LenX/3)

else dx := Round(LenX/3);

{——————————————————————}

BlackCnt := 0; { Eie-ai /a?iuo ieenaeia a eaaae?aioa }

for y := yOld to yOld+dy-1 do begin

for x := xOld to xOld+dx-1 do begin

if Image.Canvas.Pixels[x,y] <> clWhite then Inc(BlackCnt);

end; { for x }

end; { for y }

{——————————————————————}

TotCnt := dx*dy;

P := BlackCnt/TotCnt; { Ieioiinoue ieenaeia a eaaae?aioa }

Str(P:1:3, S1);

S := S+S1+’ ‘;

xOld := xOld+dx;

end; { for i }

yOld := yOld+dy;

end; { for j }

Result := S;

end; { TMainForm.GetDensity }

procedure TMainForm.N5Click(Sender: TObject);

var

S: string;

ID: word;

begin

S := GetDensity;

ID := DataTable.RecordCount;

DataTable.AppendRecord([ID+1, S]);

end;

procedure TMainForm.N10Click(Sender: TObject);

var

SValue: string[5];

S, DStr1, DStr2, OldS: string;

Value, NewValue: real;

i: byte;

ID: word;

begin

S := GetDensity;

OldS := S;

DataTable.First;

Value := 100;

ID := 0;

while not DataTable.EOF do begin

NewValue := 0;

{———————————————————–}

for i := 1 to 9 do begin

DStr1 := Copy(S, (i-1)*6+1, 5);

DStr2 := Copy(DataTableOpis.Value, (i-1)*6+1, 5);

NewValue := NewValue + Abs(StrToFloat(DStr2)-StrToFloat(DStr1));

end; { for i }

{———————————————————–}

if NewValue < Value then beginValue := NewValue;ID := DataTableID.AsInteger;end;DataTable.Next;end; { while }ShowMessage(IntToStr(ID));end;end.Ecaanoii, /oi i?e nicaeaiee iau/iuie n?aaenoaaie (”?oeaie”) eioa?oaena iieueciaaoaey aeey i?ia?aii, ?aaioathueo a a?aoe/aneeo n?aaeao, ia yoi ooiaeeo aieaa 80% a?aiaie ?ac?aaioee i?eeiaeaiey.

Нашли опечатку? Выделите и нажмите CTRL+Enter

Похожие документы
Обсуждение

Оставить комментарий

avatar
  Подписаться  
Уведомление о
Заказать реферат
UkrReferat.com. Всі права захищені. 2000-2019