map calculaton using grass
DESCRIPTION
Level Slicing and Map Calculation studied here. Done using GRASS GIS software, an open source resource. This is the second part of the laboratory series on GRASS GIS.TRANSCRIPT
![Page 1: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/1.jpg)
Map Calculation with GRASS
Session - II
Workshop on “Introduction to Remote Sensing”, July 7 – 11, 2014, Jawaharlal Nehru Engineering College
![Page 2: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/2.jpg)
In this session● Calculation of vegetation indices● Level slicing of images
![Page 3: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/3.jpg)
Spectral Signature of vegetation
http://ces.iisc.ernet.in/hpg/envis/Remote/introfile8_files/FIG_11.gif
High reflectance of vegetation at the Near infra-red (NIR) region
High reflectance of vegetation at the Near infra-red (NIR) region
Low reflectance of vegetation at the red (R) region
Low reflectance of vegetation at the red (R) region
![Page 4: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/4.jpg)
Vegetation Indices
RVI=NIRR
(Jordan, 1969)
NDVI=NIR−RNIR+R
(Rouse et. al, 1973)
IPVI=NIRNIR+R
(Crippen, 1990)
DVI=NIR−R (Richardson & Everitt, 1992)
Ratio Vegetation IndexRatio Vegetation Index
Normalised Difference Vegetation Index
Infrared Percentage Vegetation Index
Difference Vegetation Index
![Page 5: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/5.jpg)
In our dataset
S. No. Band Part of spectrum
Spatial Resolution
1 B1 Blue 30m
2. B2 Green 30m
3. B3 Red 30m
4. B4 Infra-red 30m
5. B5 SWIR-1 30m
6. B6 Thermal 60m
7. B7 SWIR - 2 30m
![Page 6: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/6.jpg)
Select Aurangabad and Click PERMANENT.
Select Aurangabad and Click PERMANENT.
Start GRASSStart GRASS
![Page 7: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/7.jpg)
Understanding MAPCALC
1. Go to the command console1. Go to the command console
![Page 8: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/8.jpg)
2.Type r.mapcalc
Press Enter
2.Type r.mapcalc
Press Enter
![Page 9: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/9.jpg)
3. Type the name of the new Raster Map RVI
3. Type the name of the new Raster Map RVI
4. Select double(x) from the mapcalc function list.
4. Select double(x) from the mapcalc function list.
5. Type the expression: double (B4S@PERMANENT) / double(B3S@PERMANENT)
5. Type the expression: double (B4S@PERMANENT) / double(B3S@PERMANENT)
6. Click Run6. Click Run
![Page 10: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/10.jpg)
GRASS displays command finishedGRASS displays command finished
7. Click Close.7. Click Close.
![Page 11: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/11.jpg)
8. Check on the RVI layer in Layer Manager
8. Check on the RVI layer in Layer Manager
9. RVI displayed in coloured mode. Need to change the colour table.
9. RVI displayed in coloured mode. Need to change the colour table.
![Page 12: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/12.jpg)
10. Go to the command console. Type r.colors and press Enter
10. Go to the command console. Type r.colors and press Enter
11. Select RVI@PERMANENT 11. Select RVI@PERMANENT
12. Click on the Colors panel and select grey.
12. Click on the Colors panel and select grey.
13. Click Run.13. Click Run.
![Page 13: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/13.jpg)
Computed map displayed in grey.Computed map displayed in grey.
![Page 14: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/14.jpg)
Exercise● Use r.mapcalc to compute
– DVI
– NDVI
– IPVI
● Change the colour table using r.colors
![Page 15: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/15.jpg)
Displays of DVI, NDVI, IPVI
DVIDVI NDVINDVI IPVIIPVI
![Page 16: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/16.jpg)
Segmentation methods using map calculation
Binary and n-nary segmentation / level slicing
![Page 17: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/17.jpg)
Strategy for binary segmentation● Determine a threshold (a number) for an image I● Apply the following function to the image I
newImage= f ( I )={I <τ 1I≥τ 2
How to obtain this threshold?How to obtain this threshold?
![Page 18: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/18.jpg)
The if-then-else function in r.mapcalc
if (<condition>,
<value_if_condition_is_satisfied>,
<value_if_condition_is_not_satisfied>)
● e.g.– r.mapcalc 'newImage = if(b3@PERMANENT < 56, 1, 2)'
![Page 19: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/19.jpg)
Finding the threshold
1. Add B4S@PERMANENT to the layer manager
1. Add B4S@PERMANENT to the layer manager
Water bodiesWater bodies
![Page 20: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/20.jpg)
2. Click on this button (Query raster / vector maps)
2. Click on this button (Query raster / vector maps)
3. Click on various points on the water bodies in the map layer and find the maximum value
appearing here
3. Click on various points on the water bodies in the map layer and find the maximum value
appearing here
![Page 21: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/21.jpg)
4. Go to the command console and type r.mapcalc
4. Go to the command console and type r.mapcalc
5. Enter the name of the new image
5. Enter the name of the new image
6. Type the expression
If (B4S@PERMANENT < 26, 1, 2)
6. Type the expression
If (B4S@PERMANENT < 26, 1, 2)
7. Click Run7. Click Run
![Page 22: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/22.jpg)
Binary segmented image displayed in the map
window. Water body seen here
Binary segmented image displayed in the map
window. Water body seen here
Exercise: It is seen that the second water body is not displayed in the image. Select a better threshold and re-calculate the new image
Exercise: It is seen that the second water body is not displayed in the image. Select a better threshold and re-calculate the new image
![Page 23: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/23.jpg)
Divide an image into three groups● For this, we need two thresholds● We apply the following function
newImage= f ( I )={I<τ1 1τ1≤ I<τ2 2I≥τ2 3
Find these thresholds again by using the Raster query method explained earlier.
Find these thresholds again by using the Raster query method explained earlier.
![Page 24: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/24.jpg)
Using Raster Query tool, we select two thresholds: 31 and 54Using Raster Query tool, we select two thresholds: 31 and 54
![Page 25: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/25.jpg)
1. Go to command window and type r.mapcalc
1. Go to command window and type r.mapcalc
3. Type the expression: if (B4S@PERMANENT < 31, 1, if (
B4S@PERMANENT <56,2,3)). 3. Click Run
3. Type the expression: if (B4S@PERMANENT < 31, 1, if (
B4S@PERMANENT <56,2,3)). 3. Click Run
2. Enter the name of the new raster map as
mewImage2
2. Enter the name of the new raster map as
mewImage2
Image displayed in Map WindowImage displayed in Map Window
![Page 26: Map Calculaton using GRASS](https://reader033.vdocuments.net/reader033/viewer/2022052900/555e08bad8b42a99188b488a/html5/thumbnails/26.jpg)
Questions● We are able to segment the image in two and three
parts and extract features like ROADS and LAKES● Can we extract other features also?
– Like buildings etc
– Can we make 6 different groups and develop a map?
● Exercise– Identify 5 different thresholds to divide the image into 6
groups
● Knowledge: – The process that we learned here is called LEVEL
SLICING