Author Topic: POW image mosaic using GDAL and Qgis error  (Read 3108 times)

vijayansiva

  • Osiris (Active Member)
  • **
  • Posts: 21
POW image mosaic using GDAL and Qgis error
« on: May 20, 2014, 10:21:29 PM »
hi,

   from astro cloud i downloaded few mars ctx images,

1) when i tried to mosaic those images using gdal_merge the mosaiced images are overlaid one another. Can you suggest how POW images can be mosaiced using gdal with background eliminated from each image.

2) same problem with qgis also , it shows no projection and all images are overlaid one above another, how can i load the POW images in qgis with correct projection




thanks
« Last Edit: May 20, 2014, 10:24:33 PM by vijayansiva »

thare

  • GIS Support Team
  • Isis (Extreme Power Member)
  • *****
  • Posts: 1217
    • http://webgis.wr.usgs.gov
    • Email
Re: POW image mosaic using GDAL and Qgis error
« Reply #1 on: May 21, 2014, 06:20:45 PM »
For gdal_merge (or gdalbuildvrt), make sure to force the same projection for all images. The resolution can be different but it doesn't hurt to set them all the same (for CTX you might use 6m/p). For the projection, near the equator I might pick:
Projection: Simple Cylindrical
Central Longitude: 0
Longitude System = -180 to 180

For a latitude area at 45 South I would pick:
Projection: Equirectangular
Central Longitude: 0
Central Latitude: -45
Longitude System = -180 to 180

For a latitude area at 80 North I would pick:
Projection: Polar Stereographic
Central Longitude: 0
Central Latitude: 90
Longitude System = -180 to 180


QGIS 2.x, should recognize the projection for all the images from POW (make sure to download all "auxiliary" (.aux) files). Now if they are different projections then you have to turn on "Enable on-the-fly Transformations" under the project properties. It generally sets the projection of the project to the first image loaded. The other images will project on-the-fly to that projection (which can be slow so it's not ideal).


Let us know if that helps,
Trent


vijayansiva

  • Osiris (Active Member)
  • **
  • Posts: 21
Re: POW image mosaic using GDAL and Qgis error
« Reply #2 on: May 22, 2014, 06:22:28 AM »
hi,

   the qgis works fine, but the problem persist with the GDAL merge.

  I tried gdal merge within qgis but all the images are overlaid one over another. I am giving POW derived georef. Tiff file for gdal_merge, but mosaic is not at all done.  Also suggest me how to normalize/colour balance the images during mosaic.

thank you



thare

  • GIS Support Team
  • Isis (Extreme Power Member)
  • *****
  • Posts: 1217
    • http://webgis.wr.usgs.gov
    • Email
Re: POW image mosaic using GDAL and Qgis error
« Reply #3 on: May 22, 2014, 12:35:07 PM »
I would assume gdal_merge inside QGIS works as (or is the same as) the commandline app and would need all the images to be the same projection first. Using GDAL tools (gdalwarp) or perhaps QGIS you can take the map projected images and run gdalwarp on the images so that they all match. I would just run POW again using the same projection.

So image and/or color balancing is one of those million dollar questions. ISIS has some capability using "equalizer" but prior to that generally some filters are run to get them closer to each other. It can really depend on the image set also to what filter is used and also thought more of an art than science. POW, which uses ISIS, currently doesn't have tonal balancing as an option in our pipeline but it is something we would like to add in next year.

So some options I can think of.
(1) manual balancing each image using QGIS/GDAL to get them close. Calculated stats can help "gdalinfo -stats image.tif". "gdal_translate" using -scale can stretch the images independently once you get good numbers. Can be a labor intensive process.

(2) Try histogram matching in apps like OSSIM:
http://gis.stackexchange.com/questions/95435/color-balance-and-publish-large-amount-of-high-resolution-imagery-in-geoserver

(3) Process or have POW process to ISIS format and try ISIS to balance "equalize" the images. You can also mosaic in ISIS but then you MUST set the same projection and same resolution on all images. Here is a tutorial for some filtering tips in ISIS but can be used in other packages: http://isis.astrogeology.usgs.gov/IsisWorkshop/index.php/The_Power_of_Spatial_Filters

(4) Try filters like running std dev by line using Pystretch or perhaps ASU's Devinci
PyStretch is soon due out for a new version (and perhaps incorporation into POW): https://github.com/jlaura/PyStretch

(5) Commercial apps like Er Mapper and maybe ArcGIS has tonal matching built in.

(6) Outside of the geospatial world there are apps like Hugin which might help?
others: http://www.techsupportalert.com/best-free-digital-image-stitcher.htm

If I get any tips from inside the building I will pass them on.

-Trent

« Last Edit: May 22, 2014, 12:40:51 PM by thare »

thare

  • GIS Support Team
  • Isis (Extreme Power Member)
  • *****
  • Posts: 1217
    • http://webgis.wr.usgs.gov
    • Email
Re: POW image mosaic using GDAL and Qgis error
« Reply #4 on: June 02, 2014, 02:08:48 PM »
Here are some brief tips from one of our ISIS processors, Janet, for tonal balancing in ISIS prior to exporting or mosaicking.

Tone Matching (case study: CTX or THEMIS IR Images)


0.) All images must be processed in ISIS (or POW) to the same projection and resolution for these ISIS tools to work.

1.) Run Equalizer
1.1.)       For either CTX or THEMIS data, select a few images from the list of images intended for the mosaic that represent a good range of dn values. Otherwise, the images you select will have as many tones as possible that range from shades of whites to grays to black gradations.  Use the selected images as the hold image in ISIS’ equalizer program.

1.2.)       After you have run equalizer on the images you plan to mosaic, create a quick mosaic with automos to check the tones. If after running equalizer the tones are not satisfactory, go to the next step.

2.) Run Sigmastretch - run sigmastretch on all equalized images. 

2.1.) Try automos again, if after you have run sigmastretch on the equalized images, and you would like the images toned more, go to the next step.

3.) Run Noseam - run noseam on all sigmastretch images (automos no longer needed).

4.) Stretch to 8bit for mapping on.
« Last Edit: June 13, 2014, 03:03:47 PM by thare »