Solved

How to maintain contrast of original raster after mosaicing


Badge +1

I created a workbench which reads an ECW (which I call current imagery). I then read GeoTIFFs (which I call new imagery), mosaic the rasters together and then write to a new ECW, which becomes the new current imagery ECW.

I've noticed contrast changes in locations which are not being overwritten each time I've added new imagery and recreated the ECW.

What could be happening here?

The below image is a location which hasn't been overwritten by new imagery. I've run the new workbench 4 times now and you can see its getting darker each time.

 

 

More notes:

 

I have done some further analysis.

By using the PointOnRasterValueExtractor I was able to get the RGB band values at a location before the mosaic and after the mosaic.

Before the mosaic: 82,92,82

 

After the mosaic: 93,100,94

I also used the RasterBandMinMaxExtractor.

Before the mosaic the min max was R: 0,251 - G 0,253 - B 0,251

 

After the mosaic the min max became R: 0,254 - G 0,253 - B 0,254

 

I expected the min max to change, I just didn't expect the RGB values of the pixels to change.

Is there anyway to prevent them from changing?

TIA

icon

Best answer by takashi 7 March 2019, 12:53

View original

2 replies

Userlevel 2
Badge +17

Hi @rclarkenz, as far as I know, the ECW format adopts a lossy compression method. I suspect that the slight change could be caused through the compression process.

What happens if you save the resulting rasters with other format (e.g. GeoTIFF) that uses lossless compression method?

Badge +1

Hi @rclarkenz, as far as I know, the ECW format adopts a lossy compression method. I suspect that the slight change could be caused through the compression process.

What happens if you save the resulting rasters with other format (e.g. GeoTIFF) that uses lossless compression method?

Thanks @takashi. It was the ECW format. I changed it to save to GeoTIFF and did not get this issue. (Although it did consume a lot of diskspace!) I'm going to see if I get the same results with JPEG2000. Thank you for your help.

Reply