remicres / otb-mosaic

An application for mosaicing remote sensing images 🛰️ [Project definitively moved in OTB the 06/2019]
Other
32 stars 18 forks source link

Mosaic of Sentinel2 images #12

Closed igeofr closed 5 years ago

igeofr commented 5 years ago

Hi, I’m trying to use otbcli_mosaic (OTB 6.6.1 for MacOS) in order to generate an mosaic of Sentinel2 images. The problem is that the result is not as expected, especially when the same tile is composed of two images.

Code : OTB_MAX_RAM_HINT=6144 GDAL_CACHEMAX=10240 otbcli_Mosaic -il /img1b1.tif /img2b1.tif -vdcut /img1b1.shp /img2b1.shp -harmo.method band -out /Mosaic.tif float -ram 6144

This is the result that I’m getting:

image

Do you have a solution for me?

Edit : The mosaic only works if : -harmo.method none

Thanks. Regards,

remicres commented 5 years ago

Your preview shows a lot of images (more than 2). Can you show the output image of the following command? otbcli_Mosaic -il img1b1.tif img2b1.tif -out Mosaic.tif

Please also note that radiometric/color harmonization only works on valid (i.e. different than do-data value), overlapping pixels of input images: if images do not overlap, the harmonization wont't work. If you want to mosaic several scenes, with some non-overlapping scenes that have the same radiometry, you can first mosaic these scenes together withharmo.method none then mosaic these resulting mosaics using harmo.method band

igeofr commented 5 years ago

Thank you for your feedback. Here is the corresponding output image - otbcli_Mosaic -il img1b1.tif img2b1.tif -out Mosaic.tif :

image
igeofr commented 5 years ago

If I test with the first two lines of images :

image

harmo.method band

  1. otbcli_Mosaic -il img1b1.tif img2b1.tif -out Mosaic.tif -harmo.method band -harmo.cost rmse

    image
  2. otbcli_Mosaic -il img1b1.tif img2b1.tif -vdcut img1b1.shp img2b1.shp -out Mosaic.tif -harmo.method band -harmo.cost rmse

    image

harmo.method none

  1. otbcli_Mosaic -il img1b1.tif img2b1.tif -vdcut img1b1.shp img2b1.shp -out Mosaic.tif -harmo.method none

    image
  2. otbcli_Mosaic -il img1b1.tif img2b1.tif -out Mosaic.tif -harmo.method none

    image
remicres commented 5 years ago

I think that the problem comes from the nodata (i.e. Background) value: the app does not seem to use it, and the result looks good only when you use vector data....

In Mosaic, default nodata value is 0. Can you check that the background values in your images are 0? (In incoming version of Mosaic, you will be able to use another value than 0).

igeofr commented 5 years ago

I confirm the problem came from the no-data values. I restarted all the steps with no-data at 0 and it works.

image

Thank you.