~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to stdred/echelle/proc/necsegment.prg

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
! @(#)necsegment.prg    19.1 (ES0-DMD) 02/25/03 14:19:43
 
2
 
3
define/param P1 {ORDREF} IMA "Input image:"
 
4
define/param P2 &i       IMA "Output image:"
 
5
define/param P3 3.5      NUM "Kappa factor:"
 
6
!
 
7
define/local  segment/R/1/1 0.
 
8
define/local  thres/R/1/1   0.
 
9
!
 
10
goto meth2
 
11
 
12
! Method 1 : Defines a threshold by histogram analysis
 
13
meth1:
 
14
!
 
15
center/histo {P1}
 
16
segment = outputr(1) + {P3}*outputr(2)
 
17
replace/image {P1} {P2} <,{segment}=0.
 
18
copy/dd {P1} *,3 {P2}
 
19
return
 
20
 
21
! Method 2 : Determines the background by wavelet transform
 
22
meth2:
 
23
!
 
24
scale/twodim {P1}  &w7  2  &w1  1 
 
25
compute/image &s = {P1} - &w7
 
26
 
 
27
center/histogram &w1
 
28
thres = outputr(1) + 2.*outputr(2)
 
29
 
 
30
replace/image &s {P2} <,{thres}=0.
 
31
copy/dd {P1} *,3 {P2}
 
32
return
 
33
 
 
34