Sentinel-2 Super-Resolution (all bands at 10m): Snap plugin now available!

Download it here:
http://nicolas.brodu.net/common/recherche/superres/superres-operator-1.0.nbm
http://nicolas.brodu.net/recherche/superres/

This plugin increases the resolution of the 20m and 60m bands of a sentinel-2 image down to 10m/pixel. You can view it as a kind of pan-sharp operator, but which extracts details from the 4 existing 10m bands instead of a (non-existent) panchromatic band. Thanks to using these 4 bands, results are improved compared to single-band pansharp, including local consistency between neighbor pixels. See the above page for details.

The plugin works for both SNAP 5.0 and 6.0beta, for both Linux and Windows. In order to install it, select the ā€œtools/pluginsā€ menu, then the ā€œdownloadedā€ tabs and select the .nbm file you just downloaded. Install it, then restart SNAP. A new entry should appear in the ā€œOpticalā€ menu. Hover the mouse on the parameter fields of the new dialog for help, if needed. The graph processing framework is supported. Extra bonus: A batch version using Python and GDAL exists for use on clusters where SNAP cannot be installed, see the web page.

The method is quite computationally intensive. Please use a small test region of interest first, and only then expand according to your needs / available computing power.

Enjoy :slight_smile:

Nicolas

20 Likes

Impressive! I will try it out.

Works perfect on my machine (technically), thank you so much.
You need a high-performance system however as it requires quite much computing capacity. But that is not a bad thing, of course. :slight_smile:

1 Like

Hi!

Thank you very much for the plugin! It works almost fine. Unfortunately, my results are not georeferenced. How can I keep the geoinformation?

Best,
Martyna

Hmm, that is strange, geocoding should be transfered. I just checked, and longitude/latitude are visible in SNAP when you hover over on each pixel of a super-resolved band, so the information is there. Could you please send me a private message (no need to bother others on the forum for debug info) as to how, exactly, you cannot read the geocoding information?

Thank you for your prompt reply!

I tried once more time with other dataset and everything worked perfectly. Afterwards I tried on the first dataset and it worked perfectly as well. I do not know what the reason of my problem was. Sorry!

Martyna

Hi,
Iā€™ve downloaded the files from the link above and got a zip file
but i didnā€™t find the ā€˜.nbmā€™ file so could anyone help me isntall the plug ?

thx,zy

A ā€œ.nbmā€ file is also a jar archive, which is also a zip file. It is possible that your download manager recognized it as a zip and messed up the extension. Try the first link above again, and be sure to save the file with the .nbm extension.

Thank you for help!
I saved the file in ā€˜zipā€™ format, so it couldnā€™t be recognized. Then I changed the extension. It works now.

This is beautiful!
Effectively computationally intenseā€¦ But you need to make use of your cores. Seems very well coded, well done for exploiting the resources properly (all my 24 virtual cores went 100%, it is quite rare).
Thanks for sharing it and well done.


Removed a question which was irrelevantā€¦ Display problem

1 Like

Shall this plug-in be included in the v6.0 of SNAP?

Hi @nicolas.brodu, does it work as well from command line? Or with gpt?

The plugin should work with GPT. A command-line version using GDAL instead of SNAP is available on my web page. It only works for Linux, and you are on your own for setting up the necessary packages (python, etc) in your own environment.

I am not sure the 6.0 build process allows for late additions. This plugin might be useful for many people and it was well tested but, at this stage of the release cycle, I suspect the main developpers are more concerned with fixing the last remaining bugs than with adding new features. I am all for it, or for listing it in the third party plugins page as fallback, but that choice belongs to the people preparing v6.0. @Fabrizio_Ramoino, what do you think ?

Cool! I re-read carefully your first post and I saw the information was there :sweat_smile: Thanks for the reply anyway.

Iā€™m trying to compile it and Iā€™m getting the following error:

$ ./setup.py install --user
( ... many compilation outputs later ... )
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/emendes/devel/src/SNAP/superres/src -I/home/emendes/devel/src/SNAP/superres/src/boost -I/usr/include/python2.7 -c src/sresjni.cpp -o build/temp.linux-x86_64-2.7/src/sresjni.o -fPIC -std=c++11 -fopenmp -O3 -DNDEBUG -DEIGEN_UNROLLING_LIMIT=0 -DEIGEN_DONT_PARALLELIZE
cc1plus: warning: command line option ā€˜-Wstrict-prototypesā€™ is valid for C/ObjC but not for C++ [enabled by default]
src/sresjni.cpp:34:17: fatal error: jni.h: No such file or directory
 #include <jni.h>
                 ^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

I see thereā€™s a jni.h inside $(src)/jni/ but Iā€™m not sure which recipe to edit in the Makefile to make the compiler find it. Would I be on my own here or could you give me a hint? :slight_smile:

Edited a clumsy anwser - Now fixed thanks to @Mellon.

All right, Iā€™ll see if I can solve this on my own.

Dear Nicolas,

In my opinion for the time being I would suggest to add your useful contribution in the ā€˜third party pluginsā€™ that will give more visibility to you as developer.
With regard to your plug in name, if you are agree, in order to avoid misunderstanding I would suggest to change it in ā€œSentinel-2 Bands Fusionā€, because it needs a reference band to resample all the others at the same resolution.

Best Regards,
Fabrizio

As far as I understood the plugin is not limited to Sentinel-2 data. At least the algorithm can also be applied to Landsat 8 and others.
In the current version, the plugin is written for S2, but maybe it can be easily generalised?

The method is not limited to Sentinel-2, it is suited for satellites with several high-resolution bands. Landsat 8 has a panchromatic band, which you can use with usual pansharp operations, so there is no need for this plugin.