lanha / DSen2

Super-Resolution of Sentinel-2 Images: Learning a Globally Applicable Deep Neural Network
GNU General Public License v3.0
235 stars 71 forks source link

fix upperleft coordinates in output #5

Closed IgnacioHeredia closed 5 years ago

IgnacioHeredia commented 5 years ago

Hi Charis,

First of all thanks for sharing the code, the work looks great! I found a bug in the test script s2_tiles_supres.py and wanted to contribute with a fix.

The problem is that when you superresolve only a part of the image (let's say roi_x_y='500,500,2500,2500') the output image has the origin upperleft coordinates equal to the ones in original image, while it should have ori_coord + (500,500).

Let me show you with some images, as it's going to be clearer.

Original code

python s2_tiles_supres.py path_to_xml output_file.tif --roi_x_y "0,0,2500,2500" image

python s2_tiles_supres.py path_to_xml output_file.tif --roi_x_y "500,500,2500,2500" image

After the changes in this pull request python s2_tiles_supres.py path_to_xml output_file.tif --roi_x_y "500,500,2500,2500" image

I just started using gdal but I hope this fixes the issue.

Thanks again,

Ignacio

lanha commented 5 years ago

Cool! thanks :)