[gdal-dev] Linux - bash script - Sentinel 1 processing - dark images

Stefan Gofferje lists at home.gofferje.net
Sat May 7 01:51:34 PDT 2022


Hi there!

I'm working on automatically processing Sentinel 1 data into 3 images: 
VV, VH and VV/VH. The images come out pretty dark though. I tried to 
mess with the exposure a little like this

MINVALUE=$(gdalinfo -mm /tmp/vva.tif | grep "Band 1" -A2 | grep Max= | 
sed  "s/.*Computed Min\/Max=\([0-9.]*\)\,.*/\1/g")
MINVALUE=$(bc <<< "${MINVALUE} * 1.2")
MAXVALUE=$(gdalinfo -mm /tmp/vva.tif | grep "Band 1" -A2 | grep Max= | 
sed "s/.*Computed Min\/Max=[0-9.]*\,\([0-9.]*\)/\1/g")
MAXVALUE=$(bc <<< "${MAXVALUE} * 0.8")
gdal_translate -colorinterp gray -ot Byte -scale ${MINVALUE} ${MAXVALUE} 
0 255 -exponent 0.5 /tmp/vva.tif ${PRODUCT}_VV_BW.png

but it doesn't help much. Unfortunately, due to time constraints, I 
haven't gotten very far with learning Python yet, so I'm somewhat stuck 
with bash and the GDAL command line tools for the moment.

Does anybody have some hints for me how to improve the exposure/contrast 
of the images? I have put a set of sample images and my current script 
to my Nextcloud here: https://cloud.gofferje.net/s/3YkgH48Lmd9kcZJ

Thanks,
Stefan

-- 
  (o_   Stefan Gofferje            | SCLT, MCP, CCSA
  //\   Reg'd Linux User #247167   | VCP #2263
  V_/_  https://www.gofferje.net   | https://www.saakeskus.fi



More information about the gdal-dev mailing list