|
Программа фильтрации шумов
Nicaaou i?ia?aiio,
inouanoaey?uo? oeeuo?aoe? ooiia a ?ano?iauo ecia?a?aieyo iaoiaaie on?aaiy?uaai,
ii?iaiaiai e iaaeaiiiai oeeuo?ia. ?en.
? 2. Iauee aea aeaaiiai ieia i?ia?aiiu c caa?o?aiiui enoiaiui
ecia?a?aieai. oaeouai ieenaea ia n?aai?? y?einou,
au?eneaiio? ii aai 8 ie?anoiinoyi, aee??ay e nai yeaiaio. Yoio oeeuo? yaeyaony
naiui i?inoui. E iaainoaoeai aai ii?ii ioianoe naea?eaaiea nooiai?aouo e
ieeiia?aciuo ooieoee. E?iia oiai ieenaee, eia?uaa nouanoaaiii ioee?iia cia?aiea
y?einoe e yaey?ueieny ooiiauie iiaoo aiineou cia?eoaeuiue aeeaa a ?acoeuoao
ia?aaioee. Aaiiay i?ioaao?a inouanoaeyao aeai?eoi
on?aaiy?uaai oeeuo?a i?eiaieoaeuii e iauaeoo TBitmap. A iaai i?aaaa?eoaeuii
aie?ia auou caa?o?aii ecia?a?aiea (?en. ? 2). ?acoeuoao ?aaiou on?aaiy?uaai
oeeuo?a ii?ii oaeaaou ia ?en. ? 3. Ia?aiao? Value – ii?ia i?e eioi?ii
i?iecaiayony iaieioeyoee n ieenaeii. NextLine:pByteArray; for I := 0 to 9262_1.Picture.Bitmap.Height - 1 do begin if J
> 0 then if J + 1 < 9262_1.Picture.Bitmap.Width
then Summ := Summ + CurrentLine^[J - 1]; Summ := Summ + CurrentLine^[J + 1]; NextLine :=
9262_1.Picture.Bitmap.ScanLine[I + 1]; if J +
1 < 9262_1.Picture.Bitmap.Width then CurrentLine^[J] :=
Summ div 9; MessageBox(Handle,'Oaeie oi?iao
oaeea iiea ia iiaa??eaaaony...', ?en. ? 3. ?acoeuoao ?aaiou on?aaiy?uaai oeeuo?a. oii, ?oi caiaia cia?aiey y?einoe ia n?aaiaa i?iecaiaeony
oieuei a oii neo?aa, anee ?aciinou ia?ao cia?aieai y?einoe e iieo?aiiui n?aaiei
i?aauoaao onoaiiaeaiiue ii?ia. Auai? ii?iaa inouanoaeyaony a niaoeaeuiii
aeaeiaiaii ieia (?en. 4). Aey i?iecaaaaiey oeeuo?aoee eniieucoaony i?ioaao?a
AverageFilter, iieacaiiay a ioieoa 1. ?en.
? 4.Auai? eiyooeoeaioa on?aaiaiey ii?iaiaiai oeeuo?a. ?en.
? 5. ?acoeuoao ?aaiou ii?iaiaiai oeeuo?a. Iaiiia?iue
iaaeaiiue oeeuo? i?aanoaaeyao niaie neieucyuaa ieii ioaaouaa?uaa ia?aoiia ?enei
yeaiaioia ecia?a?aiey. Oaio?aeuiue yeaiaio caiaiyaony iaaeaiie yeaiaioia
ecia?a?aiey a ieia. Iaaeaiie aene?aoiie iineaaiaaoaeuiinoe I yeaiaioia i?e
ia?aoiii 1 iacuaa?o yeaiaio, aey eioi?iai nouanoaoao (I-1)/2 yeaiaioa iaiuoeo
eee ?aaiuo aio ii aaee?eia e (I-1)/2 yeaiaioia aieuoeo eee ?aaiuo aio ii
aaee?eia. Iaaeaiiue oeeuo? a iaieo neo?ayo iaania?eaaao iiaaaeaiea ooia, a a
a?oaeo - aucuaaao ia?aeaoaeuiia iiaaaeaiea neaiaea. Iaaeaiiue oeeuo? ia aeeyao
ia ieeiia?aciua e nooiai?aoua ooieoee, ?oi iau?ii yaeyaony iieaciui naienoaii,
iaiaei ii iiaaaeyao eiioeuniua neaiaeu, aeeoaeuiinou eioi?uo ninoaaeyao iaiaa
iieiaeiu oe?eiu ieia. Oeeuo? oae?a aucuaaao oieiuaiea aa?oeiu o?aoaieuiie
ooieoee. Aicii?iu ?acee?iua no?aoaaee i?eiaiaiey iaaeaiiiai oeeuo?a aey
iiaaaeaiey ooiia. Iaia ec ieo ?aeiiaiaoao ia?eiaou n iaaeaiiiai oeeuo?a, ieii
eioi?iai ioaaouaaao o?e yeaiaioa ecia?a?aiey. Anee ineaaeaiea neaiaea
iacia?eoaeuii, oi ieii ?anoe?yaony ai iyoe yeaiaioia. Oae iinooia?o ai oao ii?,
iiea iaaeaiiay oeeuo?aoey ia?iao i?eiineou aieuoa a?aaa, ?ai iieucu. A?oaay
aicii?iinou ninoieo a eaneaaiie iaaeaiiie oeeuo?aoee neaiaea n eniieuciaaieai
oeene?iaaiiie eee eciaiyaiie oe?eiu ieia. A iauai neo?aa oa iaeanoe, eioi?ua
inoa?ony aac eciaiaiey iinea iaiie?aoiie ia?aaioee, ia iaiy?ony e iinea
iiaoi?iie ia?aaioee. Iaeanoe, a eioi?uo aeeoaeuiinou eiioeuniuo neaiaeia
ninoaaeyao iaiaa iieiaeiu oe?eiu ieia, aoaoo iiaaa?aaouny eciaiaieyi iinea
ea?aiai oeeea ia?aaioee. Eiioaioe? iaaeaiiiai oeeuo?a ii?ii eaaei iaiaueou ia
aaa ecia?aiey, i?eiaiyy ieii i?yiioaieuiie eee aeeceie e e?oaiaie oi?iu. procedure
TMainForm.N16Click(Sender: TObject);
Vert,Hor:Integer; ValueForm.Caption := '?acia? ieia oeeuo?a n X n'; ValueForm.Edit1.ReadOnly := True; if 9262_1.Picture.Bitmap.PixelFormat =
pf8bit then CurrentLine := 9262_1.Picture.Bitmap.ScanLine[Vert]; Counter := 0; if (VertB >= 0) and (VertB <
9262_1.Picture.Bitmap.Height) then for HorB := (Hor - (Value div 2))
to (Hor + (Value div 2)) do (VertB <
9262_1.Picture.Bitmap.Height) then end; for HorB := VertB to Value*Value - 1 do PixelArray[VertB] := PixelArray[HorB]; // Aa?ai oi ?oi iina?aaeia e i?enaaeaaai
oaeouaio ieenae? 9262_1.Visible :=
True; 'Neaaiaao y iiea...',MB_OK or MB_ICONSTOP
or MB_APPLMODAL); ?en. ? 6. Ia?aei ?aaiou iaaeaiiiai oeeuo?a – cai?in ia ?acia? ieia
oeeuo?a. Aey oi?iuaiey aeai?eoia
neoao?uay i?ioaao?a caiieiyao a?aoe?aneea iauaeou oieuei aaeui oaaoii, iaiaei
iooai i?inoiai aiaaaeaiey aeaeiaiaiai ieia n aii?inii i oaaoa caiieiaiey ii?ii
aiaeouny caiieiaiey iauaeoia e?aui oaaoii. Shift:
TShiftState; X, Y: Integer);
NextLine:pByteArray; // Caiiieiaai
cia?aiea ieenaea ia eioi?ii uaeeioee iuoeie //
Iiea ?enei caiai ia noaiao ?aaiui 0 aaeaaainy aaa?o
CurrentLine := 9262_1.Picture.Bitmap.ScanLine[Y - YOffset]; Break; while CurrentLine^[X -
XOffset - 1] = TargetPixel do if X - XOffset - 1 < 0 then if X + 1 < 9262_1.Picture.Bitmap.Width - 1 then Inc(XOffset);
Inc(YOffset); ChangeCount := 0; CurrentLine := 9262_1.Picture.Bitmap.ScanLine[Y + YOffset]; Break; while
CurrentLine^[X - XOffset - 1] = TargetPixel do if X - XOffset - 1
< 0 then if X + 1 < 9262_1.Picture.Bitmap.Width -
1 then Inc(XOffset);
Inc(YOffset); ?acoeuoaou ?aaiou i?ia?aiiu ii?ii
oaeaaou ia ?en. ? 8 e ? 9. ?en. ? 8. Enoiaiia ecia?a?aiea aey caiieiaiey. procedure TMainForm.N7Click(Sender:
TObject); for I :=0 to 9262_1.Picture.Bitmap.Height - 1 do pf4bit:Bits := 1; end; 9262_1.Visible := False; ?en.
? 10. Enoiaiia ecia?a?aiea aey eiaa?nee. ?en.
? 11. ?acoeuoao eiaa?nee ecia?a?aiey.
| |