[GIS] Color balance and publish large amount of high resolution imagery in geoserver

basemapgdalgeoserverimage-pyramids

I have a large amount of RapidEye images (+300 Gb) that I want to use as a basemap for a online application. So far I've managed to serve them as an ImagePyramid in geoserver following the steps shown in a presentation called "Geoserver on steroids". The problem is that I haven't been able to do a proper color balance so when looking at the entire dataset, the mosaic looks very poor but as I zoom in, it gets better (pictures bellow).

My process is:

  1. Convert all images to 8bits, epsg 4326, cubic interpolation using gdal
  2. Generate a gdal virtual raster with all the images (gdalbuildvrt)
  3. Generate the image pyramid (gdal_retile with compression and geotiff tilling) and publish on geoserver (using histogram stretch in the layer style)

Any tips on how to improve the process and get better color balance?

enter image description here
enter image description here
enter image description here

Best Answer

I believe I got it.

I forced a mean +-2 Standard Deviation histogram stretch in each RapidEye image during the conversion to 8bit.

I used a python script to identify the image min, max, average and SD. I then set the value of mean - 2SD (or image min, whichever was higher) to 2 and mean + 2SD (or max) to 254. And just to be safe, the original value of zero in the image was set to 1 and 2^16 set to 255. NoData was set to 0.

These are the transfer function vectors:

original image values = [0, mean-2SD, mean+2SD, 65536]
rescaled values = [1 2, 254, 255]

Below are some screen captures. The problems I have to fix now are

  1. Remove theblack border around the imagePyramid
  2. Get a better looking image when zoomed to full extent. It now looks like an old TV tunned to the wrong channel

enter image description here enter image description here enter image description here

Edit
I've now placed the code on GitHub. It's been a while since I used it. The code is a bit messy and so is the repository. But should still work.
https://github.com/dvictori/rapideye_hist2sd

Related Question