How do I calculate area of several vegetation types in a raster (.img file type) image. They are color coded. Am using QGIS (1.8.0) and ERDAS 9.2.
You can open the raster image as a GDALDataset :
Then get the raster band containing the color codes with :
Then iterate over the raster band pixels and read each pixel color code value to count the number of pixels for a selected color code.
To read values from a raster band you should use :
I hope this helps!
you can check out Qgis Sextante Toolbox in plugins repository. it has lots of geoprocessing alagorithm in it.
and there is a good answer for classified vectorizing here from @nhopton. follow his direction to achieve what you want.
i hope it helps you...