Image destriping: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
(generalize it)
Line 1: Line 1:
== Download of tiles ==
== Image destriping with FFT ==


See [[ASTER topography]].
In some image maps, artifacts (stripes) are visible. These can be reduced with FFT filtering.
 
== ASTER GDEM destriping with FFT ==
 
In some ASTER GDEM tiles, artifacts (stripes) are visible. These can be reduced with FFT filtering.




Line 11: Line 7:
<source lang="bash">
<source lang="bash">
# set computational region to GDEM map:
# set computational region to GDEM map:
g.region rast=ASTGTM_N53E004_num -p
g.region rast=imagemap -p
d.mon x0
d.mon x0
d.rast ASTGTM_N53E004_num
d.rast imagemap
</source>
</source>


Line 19: Line 15:
Perform '''Fast Fourier Transform''' (FFT; screenshot upper left map):
Perform '''Fast Fourier Transform''' (FFT; screenshot upper left map):
<source lang="bash">
<source lang="bash">
i.fft in=ASTGTM_N53E004_num real=ASTGTM_N53E004_num_real imag=ASTGTM_N53E004_num_imag
i.fft in=imagemap real=imagemap_real imag=imagemap_imag
d.mon x1
d.mon x1
d.rast ASTGTM_N53E004_num_imag
d.rast imagemap_imag
d.rast ASTGTM_N53E004_num_real
d.rast imagemap_real
</source>
</source>


Line 32: Line 28:
d.rast filter
d.rast filter
r.mask -i filter
r.mask -i filter
d.rast ASTGTM_N53E004_num_real
d.rast imagemap_real
</source>
</source>


Line 38: Line 34:
'''Inverse FFT''' to get filtered GDEM back (screenshot lower left map):
'''Inverse FFT''' to get filtered GDEM back (screenshot lower left map):
<source lang="bash">
<source lang="bash">
i.ifft real=ASTGTM_N53E004_num_real imag=ASTGTM_N53E004_num_imag output=ASTGTM_N53E004_num_filtered
i.ifft real=imagemap_real imag=imagemap_imag output=imagemap_filtered
r.mask -r
r.mask -r
d.mon x2
d.mon x2
d.rast ASTGTM_N53E004_num_filtered
d.rast imagemap_filtered
r.colors ASTGTM_N53E004_num_filtered color=elevation  
r.colors imagemap_filtered color=elevation  
d.rast ASTGTM_N53E004_num_filtered
d.rast imagemap_filtered
</source>
</source>


Line 49: Line 45:
Calculate the '''differences''' (screenshot lower right diagram):
Calculate the '''differences''' (screenshot lower right diagram):
<source lang="bash">
<source lang="bash">
# validade with differences map:
# validate with differences map:
r.mapcalc "diff = ASTGTM_N53E004_num - ASTGTM_N53E004_num_filtered"
r.mapcalc "diff = imagemap - imagemap_filtered"
r.colors diff color=differences
r.colors diff color=differences
d.mon x3
d.mon x3
Line 58: Line 54:
</source>
</source>


[[Image:Grass aster GDEM destriping with FFT.png‎|450px|center|thumb|Workflow of ASTER GDEM destriping with FFT]]
[[Image:Grass image destriping with FFT.png‎|450px|center|thumb|Workflow of image destriping with FFT]]


Note: If the MASK is made larger (more to the center), more aggressive destriping occurs.
Note: If the MASK is made larger (more to the center), more aggressive destriping occurs.

Revision as of 11:59, 29 July 2011

Image destriping with FFT

In some image maps, artifacts (stripes) are visible. These can be reduced with FFT filtering.


Look at the original tile (screenshot upper right map):

# set computational region to GDEM map:
g.region rast=imagemap -p
d.mon x0
d.rast imagemap


Perform Fast Fourier Transform (FFT; screenshot upper left map):

i.fft in=imagemap real=imagemap_real imag=imagemap_imag
d.mon x1
d.rast imagemap_imag
d.rast imagemap_real


Create a MASK in order to remove noise (screenshot upper left map):

# digitize filter mask to reduce noise
r.digit filter
d.rast filter
r.mask -i filter
d.rast imagemap_real


Inverse FFT to get filtered GDEM back (screenshot lower left map):

i.ifft real=imagemap_real imag=imagemap_imag output=imagemap_filtered
r.mask -r
d.mon x2
d.rast imagemap_filtered
r.colors imagemap_filtered color=elevation 
d.rast imagemap_filtered


Calculate the differences (screenshot lower right diagram):

# validate with differences map:
r.mapcalc "diff = imagemap - imagemap_filtered"
r.colors diff color=differences
d.mon x3
d.rast.leg diff

# done
Workflow of image destriping with FFT

Note: If the MASK is made larger (more to the center), more aggressive destriping occurs.