[Qgis-user] Viewing SPOT5 imagery as pseudo-RGB in QGIS

Zoltan Szecsei zoltans at geograph.co.za
Fri Mar 7 01:25:45 PST 2014


Hi,
I've got some SPOT5 imagery that I want to convert to (close to) real 
colour, and am told that:
Band 1 is green
Band 2 is red
Band 3 is NIR
band 4 is shortwave IR

I found two different methods for creating pseudo-Blue. (or pseudo RGB)
Blue = 0.7*Green + 0.24*Red - 0.15*NIR
and the other was:
Blue = 0.85*Band 1 - 0.15*B3
Green = 0.65*Band 1 + 0.35*Band 3
Red = Band 2

so they are fairly similar (assuming the second one has the same band 
order as my image).

I use gdal_calc.py to create the 3 separate band-tif images and then 
gdal_merge.py to create my two variants of the RGB tiffs.

When I open these images in QGIS 2.0.1, they are brownish rather that 
pseudo RGB
I have set the 'style' to multiband colour, "loaded" the min/max values 
and then set contrast to "Stretch to Min/Max".
I have also tried various combinations of the 3 bands in case 
gdal_merge.py doesn't honour file-order to band order.

Can anyone offer a solution to this issue?

Thanks and regards,
Zoltan.

FYI My script is as follows:

# 20140307 - Zls do bandmath to create create synthetic RGB
TIFin="3229AA"
gdal_calc.py    -A ${TIFin}.tif --A_band=1\
                 -B ${TIFin}.tif --B_band=2\
                 -C ${TIFin}.tif --C_band=3\
                 -D ${TIFin}.tif --D_band=4\
                 --outfile=${TIFin}r.tif\
                 --overwrite\
                 --calc="B"
#
gdal_calc.py    -A ${TIFin}.tif --A_band=1\
                 -B ${TIFin}.tif --B_band=2\
                 -C ${TIFin}.tif --C_band=3\
                 -D ${TIFin}.tif --D_band=4\
                 --outfile=${TIFin}g.tif\
                 --overwrite\
                 --calc="A"
#               --calc="(A*0.65)+(C*0.35)"
#
gdal_calc.py    -A ${TIFin}.tif --A_band=1\
                 -B ${TIFin}.tif --B_band=2\
                 -C ${TIFin}.tif --C_band=3\
                 -D ${TIFin}.tif --D_band=4\
                 --outfile=${TIFin}b.tif\
                 --overwrite\
                 --calc="(A*0.7)+(B*0.24)-(C*0.14)"
#               --calc="(A*0.85)-(C*0.15)"
#
rm -f ${TIFin}rgb.tif > /dev/null 2> /dev/null
gdal_merge.py   -o ${TIFin}rgbx.tif\
                 -separate\
                 ${TIFin}r.tif\
                 ${TIFin}g.tif\
                 ${TIFin}b.tif



-- 

===========================================
Zoltan Szecsei PrGISc [PGP0031]
Geograph (Pty) Ltd.
GIS and Photogrammetric Service

P.O. Box 7, Muizenberg 7950, South Africa.

Mobile: +27-83-6004028
Fax:    +27-86-6115323     www.geograph.co.za
===========================================

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20140307/5ec39338/attachment.html>


More information about the Qgis-user mailing list