[GRASS-user] R: Re: i.maxlik: strange classification output and reject map

umberto.minora umberto.minora at unimi.it
Sun Jan 17 04:44:38 PST 2016


I performed again the supervised maximum likelihood, and I came to the
conclusion that the rejection map is to be interpreted as the opposite as it
is stated in the manual of 'i.maxlik'.
My code is attached below, so anyone can see the steps I am doing before
calling 'i.maxlik'.
Looking at the zonal statistics of the rejection map (extracted with
'v.rast.stats' and then 'db.out.ogr'), the rejection is very high all over
my training areas. Moreover, in the attached images you can see 1) the rgb
of my area, 2) the area without the masked regions, and 3) the rejection map
with the training areas (the rock glaciers, in red). This last was obtained
by running 'i.maxlik' against the unmasked image. Surprisingly, the dark
areas (which are supposed to be low rejkection areas) fit well with the
masked area. Interpreting this results, I think I can choose a high
threshold of rejection to classify the image the way I want.
I would be happy if somebody would like to share some opinions on this, I am
completely available also at re-doing the work and add more details.
Following, the lines of code I ran, the signature file, the zonal stats, and
the three images.

*CODE*
## Supervised classification using GRASS70
# import the raster maps
r.in.gdal /path/to/band4_refl.tif output=band4_refl
r.in.gdal /path/to/cumRAD_152-259.tif output=cumRAD_152-259
r.in.gdal /path/to/dem.tif output=dem

# import the training areas (vector)
v.in.ogr /path/to/rg_visible.shp output=rg_visible

# add a column with the ID of the class to be found by the maximumLikelihood
# algorithm (only one class in this case, the "rock glacier" class, code 1)
v.db.addcolumn rg_visible columns="IDmaxlik integer"
v.db.update rg_visible column=IDmaxlik value=1

# align the region of the vector RG to one of the raster maps, and convert
it to raster using
# column "IDmaxlik" as pixel value
g.region vector=rg_visible align=band4_refl -p
v.to.rast in=rg_visible out=rg_visible use=attr attribute_column=IDmaxlik

# group the raster maps for 'i.gensig' and 'i.maxlik' to work
i.group group=perma_max subgroup=perma_max
input=band4_refl,cumRAD_152-259,dem

# generate signature file for supervised 'i.maxlik'
i.gensig trainingmap=rg_visible group=perma_max subgroup=perma_max
signaturefile=perma_sig

# perform the supervised classification
i.maxlik group=perma_max subgroup=perma_max signaturefile=perma_sig
output=classification01 reject=reject01

*SIGNATURE FILE*
#
#
2667
0.143949 822710 2716.71 
0.00189715 
1025.75 6.24661e+09 
1.04109 5.55462e+06 23980.3 

*ZONAL STATS*
reject_zonal_stats.csv
<http://osgeo-org.1560.x6.nabble.com/file/n5245700/reject_zonal_stats.csv>  

*IMAGES*
<http://osgeo-org.1560.x6.nabble.com/file/n5245700/RGB543.jpg> 
<http://osgeo-org.1560.x6.nabble.com/file/n5245700/RGB543_masked.jpg> 
<http://osgeo-org.1560.x6.nabble.com/file/n5245700/reject_map.jpg> 



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/i-maxlik-strange-classification-output-and-reject-map-tp5242179p5245700.html
Sent from the Grass - Users mailing list archive at Nabble.com.


More information about the grass-user mailing list