Difference between revisions of "Image processing"
m (remove hardcoded version specific urls, use latest version) 
(various updates) 

Line 63:  Line 63:  
* see [[Importing data]]  * see [[Importing data]]  
+  
+  === Imagery groups ===  
+  
+  A multiband image may be grouped with {{cmdi.group}} (some commands actually require the input being defined as a imagery group rather than a list of map names).  
== Preprocessing ==  == Preprocessing ==  
Line 153:  Line 157:  
See [http://www.fp.ucalgary.ca/mhallbey/texture_calculations.htm here] and [http://murphylab.web.cmu.edu/publications/boland/boland_node26.html here] for the formulas to calculate texture. See also [http://wiki.landscapetoolbox.org/doku.php/remote_sensing_methods:canopy_texture_mapping canopy texture mapping].  See [http://www.fp.ucalgary.ca/mhallbey/texture_calculations.htm here] and [http://murphylab.web.cmu.edu/publications/boland/boland_node26.html here] for the formulas to calculate texture. See also [http://wiki.landscapetoolbox.org/doku.php/remote_sensing_methods:canopy_texture_mapping canopy texture mapping].  
+  
+  == Tasseled cap ==  
+  
+  * {{cmdi.tasscap}}  performs Tasseled Cap (Kauth Thomas) transformation, resulting in 'Brightness' Tasseled Cap component 1, 'Greenness' Tasseled Cap component 2, 'Greenness' Tasseled Cap component 2, 'Wetness' Tasseled Cap component 3, and 'Atmospheric haze' Tasseled Cap component 4.  
== Spectral unmixing ==  == Spectral unmixing ==  
* {{AddonCmdi.spec.unmix}} is used to perform "Spectral Unmixing"  * {{AddonCmdi.spec.unmix}} is used to perform "Spectral Unmixing"  
+  * {{cmdi.spectral}}  displays spectral response at user specified locations in group or images.  
+  
+  === Spectral unmixing ideas for processing hyperspectral image data ===  
+  
+  * Make use of the [http://spectralpython.sourceforge.net/ Spectral Python] (SPy) which is a pure Python module for processing hyperspectral image data  
+  
+  === Spectral angle mapping ===  
+  
* {{AddonCmdi.spec.sam}} is used to perform "Spectral Angle Mapping"  * {{AddonCmdi.spec.sam}} is used to perform "Spectral Angle Mapping"  
Line 185:  Line 201:  
Image fusion and Pansharpening:  Image fusion and Pansharpening:  
+  * {{cmdi.fusion.hpf}} is fusing high resolution panchromatic and low resolution multispectral data based on the HighPass Filter Addition technique (Gangkofner, 2008).  
* {{cmdi.pansharpen}}: Image fusion algorithms to sharpen multispectral with highres panchromatic channels  * {{cmdi.pansharpen}}: Image fusion algorithms to sharpen multispectral with highres panchromatic channels  
* {{cmdi.rgb.his}} and {{cmdi.his.rgb}}: can be used for image fusion  * {{cmdi.rgb.his}} and {{cmdi.his.rgb}}: can be used for image fusion  
Segmentation:  Segmentation:  
+  * {{cmdi.segment}}: Identifies segments (objects) from imagery data  
+  * {{AddonCmdi.superpixels.slic}} performs image segmentation using the SLIC segmentation method. (Addons)  
* {{AddonCmdr.smooth.seg}} which performs image segmentation and discontinuity detection (based on the MumfordShah variational model). The module generates a piecewise smooth approximation of the input raster map and a raster map of the discontinuities of the output approximation. The discontinuities of the output approximation are preserved from being smoothed. (Addons)  * {{AddonCmdr.smooth.seg}} which performs image segmentation and discontinuity detection (based on the MumfordShah variational model). The module generates a piecewise smooth approximation of the input raster map and a raster map of the discontinuities of the output approximation. The discontinuities of the output approximation are preserved from being smoothed. (Addons)  
−  
=== Optimal channel selection for color composites ===  === Optimal channel selection for color composites ===  
−  * {{cmdi.oif}}  +  * {{cmdi.oif}}: Calculates OptimumIndexFactor table for spectral bands 
== Vegetation indices ==  == Vegetation indices ==  
Line 229:  Line 247:  
* The main library is written in plain C and the transformation functions are a plain C conversion of the methods found in the QGIS (www.qgis.org) Georeferencer Plugin (projective and Helmert transformations) and Olivier Dalang's "worldfile transform" (https://gist.github.com/olivierdalang/ba97fc986ade4545068d).  * The main library is written in plain C and the transformation functions are a plain C conversion of the methods found in the QGIS (www.qgis.org) Georeferencer Plugin (projective and Helmert transformations) and Olivier Dalang's "worldfile transform" (https://gist.github.com/olivierdalang/ba97fc986ade4545068d).  
* author: B Ducke  * author: B Ducke  
−  
−  
−  
−  
−  
−  
−  
−  
=== Geocoding ideas ===  === Geocoding ideas ===  
Line 268:  Line 278:  
=== Lidar LAS format ===  === Lidar LAS format ===  
−  
−  
−  
−  
−  
−  
(see [[LIDAR]])  (see [[LIDAR]]) 
Latest revision as of 08:45, 12 February 2020
Contents
 1 Introduction
 2 Screenshots
 3 Importing
 4 Preprocessing
 5 Image classification
 6 Image segmentation
 7 Edge detection
 8 Filtering
 9 Fourier Transform
 10 Canonical Component Analysis
 11 Principal Component Analysis
 12 Texture
 13 Tasseled cap
 14 Spectral unmixing
 15 Thermal remote sensing
 16 Time series analysis
 17 Enhancements
 18 Vegetation indices
 19 Water indices
 20 Biomass indices
 21 Evapotranspiration
 22 Stereo anaglyphs
 23 Ideas collection for improving GRASS' Image processing capabilities
 24 Bibliography
Introduction
For a general overview, see "Introduction: image processing in GRASS GIS" at imageryintro.
General introduction
Digital numbers and physical values (reflection/radianceatsensor):
Satellite imagery is commonly stored in Digital Numbers (DN) for minimizing the storage volume, i.e. the originally sampled analog physical value (color, temperature, etc) is stored a discrete representation in 816 bits. For example, Landsat data are stored in 8bit values (i.e., ranging from 0 to 255); other satellite data may be stored in 10 or 16 bits. Having data stored in DN, it implies that these data are not yet the observed ground reality. Such data are called "atsatellite", for example the amount of energy sensed by the sensor of the satellite platform is encoded in 8 or more bits. This energy is called radianceatsensor. To obtain physical values from DNs, satellite image providers use a linear transform equation (y = a * x + b) to encode the radianceatsensor in 8 to 16 bits. DNs can be turned back into physical values by applying the reverse formula (x = (y  b) / a).
The GRASS GIS module i.landsat.toar easily transforms Landsat DN to radianceatsensor. The equivalent module for ASTER data is i.aster.toar. For other satellites, r.mapcalc can be employed.
Reflection/radianceatsensor and surface reflectance
When radianceatsensor has been obtained, still the atmosphere influences the signal as recorded at the sensor. This atmospheric interaction with the sun energy reflected back into space by ground/vegetation/soil needs to be corrected. There are two ways to apply atmospheric correction for satellite imagery. The simple way for Landsat is with i.landsat.toar, using the DOS correction method. The more accurate way is using i.atcorr (which works for many satellite sensors). The atmospherically corrected sensor data represent surface reflectance, which ranges theoretically from 0 % to 100 %. Note that this level of data correction is the proper level of correction to calculate vegetation indices.
Image processing in GRASS GIS
Satellite imagery and orthophotos (aerial photographs) are handled in GRASS as raster maps and specialized tasks are performed using the imagery (i.*) modules. All general operations are handled by the raster modules.
 imageryintro: A short introduction to image processing in GRASS 6
 Full GRASS 4.0 Image Processing manual (PDF, 47 pages)
 imagery: Imagery module help pages
 Data import is generally handled by the r.in.gdal module
Screenshots
 The imagery screenshots page
Importing
The wxGUI offers a convenient tool for single map and bulk import:
 see Importing data
Satellite Data
Ocean Color
Sea Surface Temperature (SST)
High Resolution Data
Commercial satellite imagery
See also,
 Spectral Response specifications for IKONOS, GeoEye, QuickBird, WorldView
 various Whitepapers on High Resolution Satellite Imagery
Orthophotos
The wxGUI offers a convenient tool for single map and bulk import:
 see Importing data
Imagery groups
A multiband image may be grouped with i.group (some commands actually require the input being defined as a imagery group rather than a list of map names).
Preprocessing
See also NASA LaRC Satellite Overpass Predictor
Geometric preprocessing/Georectification
 Georectification tool is available from the File menu in the GUI.
 i.points, i.vpoints (scanned maps, satellite images)
 i.ortho.photo (aerial images)
A multiband image may be grouped and georectified with a single set of ground control points (i.group, i.target, i.rectify).
See also the Georeferencing wiki page
Orthorectification
Radiometric preprocessing
 use r.mapcalc to apply gain/bias formula
 LANDSAT: you can also use i.landsat.toar
from GRASS AddOns(included since 6.4)
Correction for atmospheric effects
Visit the dedicated page on Atmospheric correction
Related Modules
 i.landsat.dehaze: simple darkobject/Tasseled Cap based haze minimization (from GRASS AddOns)
 i.atcorr: more complex correction but based on atmospheric models
Correction for topographic/terrain effects
In rugged terrain, such correction might be useful to minimize negative effects.
 simple "cosine correction" using r.sunmask, r.mapcalc (tends to overshoot when slopes are high)
 In i.topo.corr the following correction methods are implemented: cosine, minnaert, percent, cfactor.
 Note, that for the sun's zenith (in degrees) parameter, the equation "Sun's Zenith = 90  Sun's Elevation" is generally valid
Examples:
 Topographic correction of Landsat imagery using GRASS GIS (Blog article)
Cloud removal
 with i.landsat.acca
Image classification
See the dedicated Image classification page.
Image segmentation
 i.smap: Performs contextual image classification using sequential maximum a posteriori (SMAP) estimation
 i.segment: Image Segmentation
 r.smooth.seg: Performs image segmentation and discontinuity detection (based on the MumfordShah variational model) (addon)
 i.superpixels.slic: : Perform image segmentation using the SLIC segmentation method (addon)
Edge detection
Filtering
Fourier Transform
 i.fft, i.ifft
 see also Image destriping
 see also Fourier transforms for multitemporal analysis
Canonical Component Analysis
Principal Component Analysis
 i.pca
 see also Principal Components Analysis
Texture
A series of commonly used texture measures (derived from the Grey Level Cooccurrence Matrix, GLCM), also called Haralick's texture features are available:
 r.texture: In case of panchromatic maps or limited amount of channels, it is often recommended to generate synthetic channels through texture analysis
See here and here for the formulas to calculate texture. See also canopy texture mapping.
Tasseled cap
 i.tasscap  performs Tasseled Cap (Kauth Thomas) transformation, resulting in 'Brightness' Tasseled Cap component 1, 'Greenness' Tasseled Cap component 2, 'Greenness' Tasseled Cap component 2, 'Wetness' Tasseled Cap component 3, and 'Atmospheric haze' Tasseled Cap component 4.
Spectral unmixing
 i.spec.unmix is used to perform "Spectral Unmixing"
 i.spectral  displays spectral response at user specified locations in group or images.
Spectral unmixing ideas for processing hyperspectral image data
 Make use of the Spectral Python (SPy) which is a pure Python module for processing hyperspectral image data
Spectral angle mapping
 i.spec.sam is used to perform "Spectral Angle Mapping"
Thermal remote sensing
 r.mapcalc can be used to convert from DN (digital number) of arbitrary sensors to Kelvin/Celsius/...
 i.landsat.toar  Calculates topofatmosphere radiance or reflectance and temperature for Landsat MSS/TM/ETM+/OLI
 i.landsat8.swlst (src) Practical splitwindow algorithm estimating Land Surface Temperature from Landsat 8 OLI/TIRS imagery
 i.aster.toar  Calculates topofatmosphere radiance or reflectance and temperature for ASTER
 MODIS
Time series analysis
 r.series Makes each output cell value a function of the values assigned to the corresponding cells in the input raster map layers.
 see also Time series
 see also Time series development
 see also MODIS
Enhancements
Radiometric Enhancements
 i.landsat.rgb (GRASS 6.x)  i.colors.enhance (GRASS 7.x)
 Decorrelation stretching with r.colors or r.mapcalc
 Density slicing with r.colors
 Principal Component Analysis with i.pca
Geometric Enhancements  Image Fusion  Pansharpening  Image Segmentation
Image fusion and Pansharpening:
 i.fusion.hpf is fusing high resolution panchromatic and low resolution multispectral data based on the HighPass Filter Addition technique (Gangkofner, 2008).
 i.pansharpen: Image fusion algorithms to sharpen multispectral with highres panchromatic channels
 i.rgb.his and i.his.rgb: can be used for image fusion
Segmentation:
 i.segment: Identifies segments (objects) from imagery data
 i.superpixels.slic performs image segmentation using the SLIC segmentation method. (Addons)
 r.smooth.seg which performs image segmentation and discontinuity detection (based on the MumfordShah variational model). The module generates a piecewise smooth approximation of the input raster map and a raster map of the discontinuities of the output approximation. The discontinuities of the output approximation are preserved from being smoothed. (Addons)
Optimal channel selection for color composites
 i.oif: Calculates OptimumIndexFactor table for spectral bands
Vegetation indices
Water indices
 i.wi: Calculates different types of water indices (addon)
Biomass indices
Evapotranspiration
 i.eb.* and i.evapo.* are modules dedicated to evapotranspiration, see topic_evapotranspiration
Please look at Image_processing/Evapotranspiration for some background information.
Stereo anaglyphs
 see Stereo anaglyphs
Ideas collection for improving GRASS' Image processing capabilities
Below modules need some tuning before being added to GRASS 6. Volunteers welcome.
libCTL  Library for affine, Helmert and projective transformations in 2D
To be evaluated: plain C translation https://svn.code.sf.net/p/gvsigce/code/trunk/libraries/libCTL/
 requires GNU Scientific Library for the matrix algebra
 It is a small library that provides a handful of transformation methods from source to target (2D) coordinates. Currently, this includes affine, Helmert and projective transformations in 2D.
 The main library is written in plain C and the transformation functions are a plain C conversion of the methods found in the QGIS (www.qgis.org) Georeferencer Plugin (projective and Helmert transformations) and Olivier Dalang's "worldfile transform" (https://gist.github.com/olivierdalang/ba97fc986ade4545068d).
 author: B Ducke
Geocoding ideas
 i.homography: geocoding with lines (instead of points) with homography (as improved i.points; it was formerly called i.linespoints)
 support splines from GDAL (see GRASS_AddOns#Imagery_addons)
 New Georectifier: see also http://gama.fsv.cvut.cz/~landa/grass/swf/georect.html
Image matching ideas
 i.points.auto: automated search of GCPs based on FFT correlation (as improved i.points)
 Reference: M. Neteler, D. Grasso, I. Michelazzi, L. Miori, S. Merler, and C. Furlanello, 2005: An integrated toolbox for image registration, fusion and classification. International Journal of Geoinformatics, 1(1), pp. 5161 PDF
Image classification ideas
 pr: C code for classification problems
 GRASS implementation: i.pr.* source code is available here)
Stereo ideas
This is standalone stereo modeling software (DEM extraction etc). Waits for integration into GRASS.
Bundle block adjustment
Needed to orthorectify a series aerial images taken sequentially with overlap. "Historical" method which is nowadays interesting for UAV flights with octocopters and such.
Automatec GPC search could be done by "autosift".
Available: Octave code which prepares input to an i.ortho.photo batch job (contact Markus Neteler).
Lidar LAS format
(see LIDAR)
Improving the existing code
It might be sensible to merge the various image libraries:
 GRASS 6 standard libs:
 lib/imagery/: standard lib, in use (i.* except for i.points3, i.rectify3, see below)
 imagery/i.ortho.photo/libes/: standard lib, in use (i.ortho.photo, photo.*)
 GRASS 5 (! only) image3 lib:
 libes/image3/: never finished improvement which integrated the standard lib and the ortho lib. Seems to provide also ortho rectification for satellite data (i.points3, i.rectify3)
 GRASS 5/6 image proc commands:
 merge of i.points, i.vpoints, i.points3 (see above)
 merge of i.rectify and i.rectify3 (see above)

addition of new resampling algorithms such as bilinear, cubic convolution (take from r.proj or r.resamp.aggreg)(done 10/2010)  add other warping methods (maybe lanczos or thin splines from GDAL?): Addons#i.warp
 implement/finish linewise orthorectification of satellite data
Bibliography
 Search for "GRASS GIS Image processing"  Google Scholar
 Search for "GRASS GIS Remote Sensing"  Google Scholar