Is there a way to permanently stretch a histogram of a raster within QGIS or gdal? I would like to stretch a satellite image with a Standard Deviation 2.5 stretch. I would prefer to use QGIS or FWTools, but I am open to other open source tools.
Thanks…
Best Answer
A great and easy way to stretch the histogram of a raster seems to be gdal_contrast_stretch:
https://github.com/gina-alaska/dans-gdal-scripts/wiki/Gdal-contrast-stretch
Installation guide: https://github.com/gina-alaska/dans-gdal-scripts
Then you can use it as
That is, you also have to indicate the target average value. Supposing you only have one band, a (not so elegant but working) way on Unix to find out the mean (saved in a variable $mean) is:
Hope this helps!