home *** CD-ROM | disk | FTP | other *** search
- /* Suppression du bruit par la methode de la variance minimum :
- determiner k tel que sigma2(image-k.bruit) minimum, kE[0,1] */
-
- SIGNAL on ERROR
- SIGNAL on SYNTAX
- SIGNAL on BREAK_C
-
- ADDRESS 'Lynx'
- options results
- kkmin = 0.05
- kkmax = 0.5
- step = 0.025
-
- say "kmin ?"
- pull kkmin
- say "kmax ?"
- pull kkmax
- say "step ?"
- pull step
-
- MaskStatus var masque
- Mask ON
-
- CurrentImageName var nom
-
- do k=kkmin to kkmax by step
- SelectImage 'Bruit'
- Mult k
- drop knoise
- AddrCurrentImage var knoise
- SelectImage nom
- Subimage knoise
- drop image_bruit
- AddrCurrentImage var image_bruit
- drop ecart
- Sigma var ecart
- DeleteBuffer knoise
- DeleteBuffer image_bruit
- say "k : " k ",sigma :" ecart
- if k=kkmin then
- do
- kmin = k
- sigmamin = ecart
- end
- if ecart < sigmamin then
- do
- kmin = k
- sigmamin = ecart
- say "* k : " k ",sigma :" ecart
- end
- end
-
- Mask OFF
-
- SelectImage 'Bruit'
- Mult kmin
- drop knoise
- AddrCurrentImage var knoise
- SelectImage nom
- Subimage knoise
- drop image_bruit
- AddrCurrentImage var image_bruit
- DeleteBuffer knoise
-
- Mask masque
-
- LynxEnd
-
- exit
-
- /* Gestion des erreurs */
-
- ERROR:
- Select
- when RC = 3 then say "*** Error" RC" on line "SIGL": Process Failed"
- when RC = 2 then say "*** Error" RC" on line "SIGL": Invalid entries"
- when RC = 1 then say "*** Error" RC" on line "SIGL": No image !"
- otherwise say "*** Error "RC" on line "SIGL
- end
-
- say "--> "SourceLine(SIGL)
- say
- say 'Press [RETURN]'
- pull
- LynxEnd
- exit
-
- SYNTAX:
- say "*** Syntax error (Code "RC") on line" SIGL
- say "--> "SourceLine(SIGL)
- say
- say 'Press [RETURN]'
- pull
- LynxEnd
- exit
-
- BREAK_C:
- say "User Abort"
- say "--> "SourceLine(SIGL)
- say
- say "Press [RETURN]"
- pull
- LynxEnd
- exit
-