[mapserver-users] stretching imagery in MapServer

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Wed May 27 07:15:45 PDT 2015


Hi Mark,

That's how LUT works. In Mapserver 7.0 final it should be possible to set LUT and other PROCESSING options easily from the client side by using variable substitution which may be an interesting thing to test with some image interpretation tasks. It can be difficult to find details from the shadows and from light areas of the image with fixed settings of with automatic min-max stretch. It will also be possible to look at natural colour or false infrared versions from 4-band imagery be selecting the BANDS on-the-fly.

Gdalinfo can also be used for finding reasonable  values for LUT correction:

gdalinfo -stats test.tif
...
Band 1 Block=1330x2 Type=Byte, ColorInterp=Red
  Minimum=13.000, Maximum=228.000, Mean=98.964, StdDev=32.305
...
Band 2 Block=1330x2 Type=Byte, ColorInterp=Green
  Minimum=4.000, Maximum=227.000, Mean=76.644, StdDev=30.583
...
Band 3 Block=1330x2 Type=Byte, ColorInterp=Blue
  Minimum=6.000, Maximum=222.000, Mean=77.977, StdDev=30.138
...

I am not sure if anybody is using an option to make detailed correction curves with GIMP but I have tested it sometimes and it works.

-Jukka Rahkonen-



Mark Volz wrote:

Jukka, (and others)

Thank you for your reply.  I think I figured out how lut works.  If you don't mind please check and make sure I have this correct:

I can use ArcGIS to report the correct input and output values for a n=2.5 standard deviation by going to layers->symbology->stretch->histograms->Info window.  Once I have those values I can modify my map file to include for example:

PROCESSING "LUT_1=73:0,226:255" #changes red band input of 0-73 to 0, inputs of 226-255 to 255, inputs between 73-226 linearly interpolated.
PROCESSING "LUT_2=60:0,199:255" #changes green band input of 0-60 to 0, inputs of 199-255 to 255, inputs between 60-199 linearly interpolated.
PROCESSING "LUT_3=35:0,155:255" #changes blue band input of 0-35 to 0, inputs of 155-255 to 255, inputs between 35-155 linearly interpolated.

P.S.
Before I knew what the heck I was doing with LUT I noticed that I could identify wet areas, and tree cover quite easily with the following combinations:

PROCESSING "LUT=50:50,60:250,70:250" is a good way to identify tree cover.
PROCESSING "LUT=50:50,60:250,70:70"  is a good way to identify wet areas.

Thank You
Sincerely,
Mark Volz, GISP


From: Rahkonen Jukka (MML) [mailto:jukka.rahkonen at maanmittauslaitos.fi]
Sent: Monday, May 25, 2015 9:18 AM
To: Mark Volz; mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
Subject: Re: stretching imagery in MapServer

Hi,


As far as I know automatic stretch by standard deviation is not supported. You can do automatic min-max stretch with PROCESSING "SCALE=AUTO". If your source data is uniform you may reach a good result with manual scale settings or with PROCESSING "LUT=  "



-Jukka Rahkonen-


Mark Volz wrote:

Hello,

I added our new Pictometry Air Photos on our mapping site at http://geomoose.lyonco.org/geomoose2/geomoose.html.  The air photos seem somewhat washed out.  In ArcGIS I was able to get a nicer looking image by stretching the air photo using standard deviations.  Can we stretch imagery in MapServer?  If not please let me know if you have a comment regarding how I can improve the image quality.

Thanks
Sincerely,
Mark Volz, GISP


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20150527/f576d542/attachment-0001.html>


More information about the mapserver-users mailing list