| 1 |
<!-- meta page description: Image processing in GRASS --> |
| 2 |
<!-- meta page index: imagery --> |
| 3 |
<h3>Image processing in general</h3> |
| 4 |
|
| 5 |
GRASS provides a powerful suite of tools for the processing and |
| 6 |
analysis of geospatial raster data, including satellite imagery and |
| 7 |
aerial photography. Its image processing capabilities encompass a broad |
| 8 |
range of preprocessing operations, such as data import, georeferencing, |
| 9 |
radiometric calibration, and atmospheric correction. It is particularly |
| 10 |
suited for handling Earth observation data, enabling the analysis of |
| 11 |
multispectral and temporal datasets. GRASS supports advanced |
| 12 |
functionalities such as image classification, sensor fusion, and point |
| 13 |
cloud statistics. The calculation of vegetation indices further enables |
| 14 |
analyses of environmental, agricultural, and land cover dynamics. An |
| 15 |
extensive collection of |
| 16 |
<a href="https://grass.osgeo.org/grass8/manuals/addons/#i">addons</a> |
| 17 |
further enhances its image processing capabilities, particularly in the |
| 18 |
context of Earth observation and remote sensing applications. |
| 19 |
|
| 20 |
<b>Digital numbers and physical values (reflection/radiance-at-sensor):</b> |
| 21 |
<p> |
| 22 |
Satellite imagery is commonly stored in Digital Numbers (DN) for |
| 23 |
minimizing the storage volume, i.e. the originally sampled analog |
| 24 |
physical value (color, temperature, etc) is stored a discrete |
| 25 |
representation in 8-16 bits. For example, Landsat data are stored in |
| 26 |
8bit values (i.e., ranging from 0 to 255); other satellite data may |
| 27 |
be stored in 10 or 16 bits. Having data stored in DN, it implies |
| 28 |
that these data are not yet the observed ground reality. Such data |
| 29 |
are called "at-satellite", for example the amount of energy sensed |
| 30 |
by the sensor of the satellite platform is encoded in 8 or more |
| 31 |
bits. This energy is called radiance-at-sensor. To obtain physical |
| 32 |
values from DNs, satellite image providers use a linear transform |
| 33 |
equation <code>(y = a * x + b)</code> to encode the radiance-at-sensor |
| 34 |
in 8 to 16 bits. DNs can be turned back into physical values by |
| 35 |
applying the reverse formula <code>(x = (y - b) / a)</code>. |
| 36 |
<p> |
| 37 |
The GRASS module <a href="i.landsat.toar.html">i.landsat.toar</a> |
| 38 |
easily transforms Landsat DN to radiance-at-sensor (top of atmosphere, |
| 39 |
TOA). The equivalent module for ASTER data is |
| 40 |
<a href="i.aster.toar.html">i.aster.toar</a>. |
| 41 |
For other satellites, <a href="r.mapcalc.html">r.mapcalc</a> can |
| 42 |
be employed. |
| 43 |
<p> |
| 44 |
<b>Reflection/radiance-at-sensor and surface reflectance</b> |
| 45 |
<p> |
| 46 |
When radiance-at-sensor has been obtained, still the atmosphere |
| 47 |
influences the signal as recorded at the sensor. This atmospheric |
| 48 |
interaction with the sun energy reflected back into space by |
| 49 |
ground/vegetation/soil needs to be corrected. The need of |
| 50 |
removing atmospheric artifacts stems from the fact that the |
| 51 |
atmospheric conditions are changing over time. Hence, to gain |
| 52 |
comparability between Earth surface images taken at different |
| 53 |
times, atmospheric need to be removed converting at-sensor values |
| 54 |
which are top of atmosphere to surface reflectance values. |
| 55 |
<p> |
| 56 |
In GRASS, there are two ways to apply atmospheric correction for |
| 57 |
satellite imagery. A simple, less accurate way for Landsat is with |
| 58 |
<a href="i.landsat.toar.html">i.landsat.toar</a>, |
| 59 |
using the DOS correction method. The more accurate way is using |
| 60 |
<a href="i.atcorr.html">i.atcorr</a> (which supports many satellite |
| 61 |
sensors). The atmospherically corrected sensor data represent |
| 62 |
surface <a href="https://en.wikipedia.org/wiki/reflectance">reflectance</a>, |
| 63 |
which ranges theoretically from 0% to 100%. Note that this level of |
| 64 |
data correction is the proper level of correction to calculate |
| 65 |
vegetation indices. |
| 66 |
<p> |
| 67 |
In GRASS, image data are identical to <a href="rasterintro.html">raster data</a>. |
| 68 |
However, a couple of commands are explicitly dedicated to image |
| 69 |
processing. The geographic boundaries of the raster/imagery file are |
| 70 |
described by the north, south, east, and west fields. These values |
| 71 |
describe the lines which bound the map at its edges. These lines do |
| 72 |
NOT pass through the center of the grid cells at the edge of the |
| 73 |
map, but along the edge of the map itself. |
| 74 |
|
| 75 |
<p> |
| 76 |
As a general rule in GRASS: |
| 77 |
<ol> |
| 78 |
<li> Raster/imagery output maps have their bounds and resolution equal |
| 79 |
to those of the current region.</li> |
| 80 |
<li> Raster/imagery input maps are automatically cropped/padded and |
| 81 |
rescaled (using nearest-neighbor resampling) to match the current |
| 82 |
region.</li> |
| 83 |
</ol> |
| 84 |
|
| 85 |
|
| 86 |
<h3>Imagery import</h3> |
| 87 |
|
| 88 |
The module <a href="r.in.gdal.html">r.in.gdal</a> offers a common |
| 89 |
interface for many different raster and satellite image |
| 90 |
formats. Additionally, it also offers options such as on-the-fly |
| 91 |
project creation or extension of the default region to match the |
| 92 |
extent of the imported raster map. For special cases, other import |
| 93 |
modules are available. Always the full map is imported. Imagery data |
| 94 |
can be group (e.g. channel-wise) with <a href="i.group.html">i.group</a>. |
| 95 |
|
| 96 |
<p> |
| 97 |
For importing scanned maps, the user will need to create a |
| 98 |
x,y-project, scan the map in the desired resolution and save it into |
| 99 |
an appropriate raster format (e.g. tiff, jpeg, png, pbm) and then use |
| 100 |
<a href="r.in.gdal.html">r.in.gdal</a> to import it. Based on |
| 101 |
reference points the scanned map can be rectified to obtain geocoded |
| 102 |
data. |
| 103 |
|
| 104 |
<h3>Semantic label information</h3> |
| 105 |
|
| 106 |
Semantic labels are a description which can be stored as metadata. |
| 107 |
To print available semantic labels relevant for multispectral satellite |
| 108 |
data, use <a href="i.band.library.html">i.band.library</a>. |
| 109 |
<a href="r.semantic.label.html">r.semantic.label</a> allows assigning of |
| 110 |
these satellite imagery band references as defined in |
| 111 |
<a href="i.band.library.html">i.band.library</a>. Semantic labels are |
| 112 |
also used in signature files of imagery classification tools. Therefore, |
| 113 |
signature files of one imagery or raster group can be used to classify |
| 114 |
a different group with identical semantic labels. |
| 115 |
|
| 116 |
<div align="center" style="margin: 10px"> |
| 117 |
<img src="band_references_scheme.png" alt="GRASS band references scheme" width="600" height="435" border="0"><br> |
| 118 |
<i> |
| 119 |
New enhanced classification workflow involving semantic labels. |
| 120 |
</i> |
| 121 |
</div> |
| 122 |
|
| 123 |
With <a href="r.support.html">r.support</a> any sort of semantic label |
| 124 |
the user wishes may be added (i.e., not only those registered in |
| 125 |
<em>i.band.library</em>). Semantic labels are supported also by the |
| 126 |
<a href="temporalintro.html">temporal</a> GRASS modules. |
| 127 |
|
| 128 |
<h3>Image processing operations</h3> |
| 129 |
|
| 130 |
GRASS raster/imagery map processing is always performed in the current |
| 131 |
region settings (see <a href="g.region.html">g.region</a>), i.e. the |
| 132 |
current region extent and current raster resolution is used. If the |
| 133 |
resolution differs from that of the input raster map(s), on-the-fly |
| 134 |
resampling is performed (nearest neighbor resampling). If this is not |
| 135 |
desired, the input map(s) has/have to be resampled beforehand with one |
| 136 |
of the dedicated modules. |
| 137 |
|
| 138 |
<h3>Geocoding of imagery data</h3> |
| 139 |
|
| 140 |
GRASS is able to geocode raster and image data of various types: |
| 141 |
|
| 142 |
<ul> |
| 143 |
<li>unreferenced scanned maps by defining four corner points |
| 144 |
(<a href="i.group.html">i.group</a>, <a href="i.target.html">i.target</a>, |
| 145 |
<a href="g.gui.gcp.html">g.gui.gcp</a>, <a href="i.rectify.html">i.rectify</a>)</li> |
| 146 |
<li>unreferenced satellite data from optical and Radar sensors by |
| 147 |
defining a certain number of ground control points |
| 148 |
(<a href="i.group.html">i.group</a>, <a href="i.target.html">i.target</a>, |
| 149 |
<a href="g.gui.gcp.html">g.gui.gcp</a>, <a href="i.rectify.html">i.rectify</a>)</li> |
| 150 |
<li>interactive graphical <a href="wxGUI.gcp.html">Ground Control Point (GCP) manager</a></li> |
| 151 |
<li>orthophoto generation based on DEM: <a href="i.ortho.photo.html">i.ortho.photo</a></li> |
| 152 |
<li>digital handheld camera geocoding: modified procedure for |
| 153 |
<a href="i.ortho.photo.html">i.ortho.photo</a></li> |
| 154 |
</ul> |
| 155 |
|
| 156 |
|
| 157 |
<h3>Visualizing (true) color composites</h3> |
| 158 |
|
| 159 |
To quickly combine the first three channels to a near natural color |
| 160 |
image, the GRASS command <a href="d.rgb.html">d.rgb</a> can be used or |
| 161 |
the graphical GIS manager (<a href="wxGUI.html">wxGUI</a>). It assigns |
| 162 |
each channel to a color which is then mixed while displayed. With a |
| 163 |
bit more work of tuning the grey scales of the channels, nearly |
| 164 |
perfect colors can be achieved. Channel histograms can be shown with |
| 165 |
<a href="d.histogram.html">d.histogram</a>. |
| 166 |
|
| 167 |
<h3>Calculation of vegetation indices</h3> |
| 168 |
|
| 169 |
An example for indices derived from multispectral data is the NDVI |
| 170 |
(normalized difference vegetation index). To study the vegetation |
| 171 |
status with NDVI, the Red and the Near Infrared channels (NIR) are |
| 172 |
taken as used as input for simple map algebra in the GRASS command |
| 173 |
<a href="r.mapcalc.html">r.mapcalc</a> |
| 174 |
(<code>ndvi = 1.0 * (nir - red)/(nir + red)</code>). With |
| 175 |
<a href="r.colors.html">r.colors</a> an optimized "ndvi" color table |
| 176 |
can be assigned afterward. Also other vegetation indices can be |
| 177 |
generated likewise. |
| 178 |
|
| 179 |
|
| 180 |
<h3>Calibration of thermal channel</h3> |
| 181 |
|
| 182 |
The encoded digital numbers of a thermal infrared channel can be |
| 183 |
transformed to degree Celsius (or other temperature units) which |
| 184 |
represent the temperature of the observed land surface. This requires |
| 185 |
a few algebraic steps with <a href="r.mapcalc.html">r.mapcalc</a> |
| 186 |
which are outlined in the literature to apply gain and bias values |
| 187 |
from the image metadata. |
| 188 |
|
| 189 |
<h3>Image classification</h3> |
| 190 |
|
| 191 |
Single and multispectral data can be classified to user defined land |
| 192 |
use/land cover classes. In case of a single channel, segmentation will |
| 193 |
be used. |
| 194 |
|
| 195 |
GRASS supports the following methods: |
| 196 |
|
| 197 |
<ul> |
| 198 |
<li> Radiometric classification: |
| 199 |
<ul> |
| 200 |
<li> Unsupervised classification (<a href="i.cluster.html">i.cluster</a>, |
| 201 |
<a href="i.maxlik.html">i.maxlik</a>) using the Maximum Likelihood |
| 202 |
classification method</li> |
| 203 |
<li> Supervised classification (<a href="i.gensig.html">i.gensig</a> |
| 204 |
or <a href="g.gui.iclass.html">g.gui.iclass</a>, <a href="i.maxlik.html">i.maxlik</a>) |
| 205 |
using the Maximum Likelihood classification method</li> |
| 206 |
</ul> |
| 207 |
</li> |
| 208 |
<li> Combined radiometric/geometric (segmentation based) classification: |
| 209 |
<ul> |
| 210 |
<li> Supervised classification (<a href="i.gensigset.html">i.gensigset</a>, |
| 211 |
<a href="i.smap.html">i.smap</a>)</li> |
| 212 |
</ul> |
| 213 |
</li> |
| 214 |
<li> Object-oriented classification: |
| 215 |
<ul> |
| 216 |
<li> Unsupervised classification (segmentation based: |
| 217 |
<a href="i.segment.html">i.segment</a>)</li> |
| 218 |
</ul> |
| 219 |
</li> |
| 220 |
</ul> |
| 221 |
|
| 222 |
Kappa statistic can be calculated to validate the results |
| 223 |
(<a href="r.kappa.html">r.kappa</a>). Covariance/correlation matrices can be |
| 224 |
calculated with <a href="r.covar.html">r.covar</a>. |
| 225 |
|
| 226 |
<p> |
| 227 |
Note - signatures generated for one scene are suitable for classification |
| 228 |
of other scenes as long as they consist of same raster bands |
| 229 |
(semantic labels match). This comes handy when classifying multiple scenes |
| 230 |
from a single sensor taken in different areas or different times. |
| 231 |
|
| 232 |
<h3>Image fusion</h3> |
| 233 |
|
| 234 |
In case of using multispectral data, improvements of the resolution |
| 235 |
can be gained by merging the panchromatic channel with color |
| 236 |
channels. GRASS provides the HIS (<a href="i.rgb.his.html">i.rgb.his</a>, |
| 237 |
<a href="i.his.rgb.html">i.his.rgb</a>) and the Brovey and PCA transform |
| 238 |
(<a href="i.pansharpen.html">i.pansharpen</a>) methods. |
| 239 |
|
| 240 |
<h3>Radiometric corrections</h3> |
| 241 |
|
| 242 |
Atmospheric effects can be removed with <a href="i.atcorr.html">i.atcorr</a>. |
| 243 |
Correction for topographic/terrain effects is offered in <a href="i.topo.corr.html">i.topo.corr</a>. |
| 244 |
Clouds in LANDSAT data can be identified and removed with |
| 245 |
<a href="i.landsat.acca.html">i.landsat.acca</a>. |
| 246 |
Calibrated digital numbers of LANDSAT and ASTER imagery may be converted to |
| 247 |
top-of-atmosphere radiance or reflectance and temperature (<a href="i.aster.toar.html">i.aster.toar</a>, |
| 248 |
<a href="i.landsat.toar.html">i.landsat.toar</a>). |
| 249 |
|
| 250 |
<h3>Time series processing</h3> |
| 251 |
|
| 252 |
GRASS also offers support for time series processing |
| 253 |
(<a href="r.series.html">r.series</a>). Statistics can be derived from a |
| 254 |
set of coregistered input maps such as multitemporal satellite |
| 255 |
data. The common univariate statistics and also linear regression can |
| 256 |
be calculated. |
| 257 |
|
| 258 |
<h3>Evapotranspiration modeling</h3> |
| 259 |
|
| 260 |
In GRASS, several types of evapotranspiration (ET) modeling methods |
| 261 |
are available: |
| 262 |
|
| 263 |
<ul> |
| 264 |
<li> Reference ET: Hargreaves (<a href="i.evapo.mh.html">i.evapo.mh</a>), |
| 265 |
Penman-Monteith (<a href="i.evapo.pm.html">i.evapo.pm</a>);</li> |
| 266 |
<li> Potential ET: Priestley-Taylor (<a href="i.evapo.pt.html">i.evapo.pt</a>);</li> |
| 267 |
<li> Actual ET: <a href="i.evapo.time.html">i.evapo.time</a>.</li> |
| 268 |
</ul> |
| 269 |
|
| 270 |
Evaporative fraction: <a href="i.eb.evapfr.html">i.eb.evapfr</a>, |
| 271 |
<a href="i.eb.hsebal01.html">i.eb.hsebal01</a>. |
| 272 |
|
| 273 |
<h3>Energy balance</h3> |
| 274 |
|
| 275 |
Emissivity can be calculated with <a href="i.emissivity.html">i.emissivity</a>. |
| 276 |
|
| 277 |
Several modules support the calculation of the energy balance: |
| 278 |
<ul> |
| 279 |
<li> Actual evapotranspiration for diurnal period (<a href="i.eb.eta.html">i.eb.eta</a>);</li> |
| 280 |
<li> Evaporative fraction and root zone soil moisture (<a href="i.eb.evapfr.html">i.eb.evapfr</a>);</li> |
| 281 |
<li> Sensible heat flux iteration (<a href="i.eb.hsebal01.html">i.eb.hsebal01</a>);</li> |
| 282 |
<li> Net radiation approximation (<a href="i.eb.netrad.html">i.eb.netrad</a>);</li> |
| 283 |
<li> Soil heat flux approximation (<a href="i.eb.soilheatflux.html">i.eb.soilheatflux</a>).</li> |
| 284 |
</ul> |
| 285 |
|
| 286 |
<h3>See also</h3> |
| 287 |
|
| 288 |
<ul> |
| 289 |
<li> GRASS Wiki page: <a href="https://grasswiki.osgeo.org/wiki/Image_processing">Image processing</a></li> |
| 290 |
<li>The GRASS 4 |
| 291 |
<em><a href="https://grass.osgeo.org/gdp/imagery/grass4_image_processing.pdf">Image |
| 292 |
Processing manual</a></em></li> |
| 293 |
<li><a href="rasterintro.html">Introduction into raster data processing</a></li> |
| 294 |
<li><a href="raster3dintro.html">Introduction into 3D raster data (voxel) processing</a></li> |
| 295 |
<li><a href="vectorintro.html">Introduction into vector data processing</a></li> |
| 296 |
<li><a href="temporalintro.html">Introduction into temporal data processing</a></li> |
| 297 |
<li><a href="databaseintro.html">Database management</a></li> |
| 298 |
<li><a href="projectionintro.html">Projections and spatial transformations</a></li> |
| 299 |
</ul> |