sen2cor scene classification

Dear all,

I have successfully processed an L1C dataset using the sen2cor cmd line. The L2A_Process was run with the --sc_only parameter since I am mostly interested in scene classification. I opened the resulting dataset in SNAP and was wondering how to visualize the scene classification? i.e. how do you arrive at the visualization shown in the attached?

With Thanks!

The scene classification is not supported by the actual version of the
Sentinel-2 Toolbox. We’ll work on it to propose it as soon as possible.

The classification result is stored as jpg2000 data in the folder …S2A_USER_PRD_MSIL2A_PDMC_20150818T101516_R022\GRANULE\S2A_USER_MSI_L2A_TL_MTI__20150813T201603_A000734_T33TUN_N01.03\IMG_DATA… .jp2. It is not georeferenced, but you can visualize it in GIS tools (QGis, …) like shown below.

Regards,
Ralf

1 Like

It is actually possible to do something similar in SNAP, you can open the jp2 file and use the Colour Manipulation panel to choose the value/colour mapping.

1 Like

Dear Ralf, Nicolas,

excellent! that answers my question. Will give it a try.
With thanks

Hi Ralf,

when I load the .jp2 file in QGIS as you mentioned I only get 2 classifications - just like in the 1st dataset in your screenshot.

Did you create the classification categories (Vegetation/bare_soils/water etc…) manually?

Cheers!

Each class has a number stored as digital number in the image. Please have a look at the L2A manual on page 15.
http://s2tbx.telespazio-vega.de/sen2cor/sen2cor-sum-2.0.pdf
In QGis I (manually) assigned each DN a colour and a label.

Excellent @ralf. Managed to do it.

many thanks for your help!

Scene classification is now read by the toolbox.
In latest 2.0.2, the colors assigned to each class are the same as in the PDD/ATBD.

You find the scene classification for the full S2-product in the SNAP product Explorer in Bands/quality/quality_scene_classification. This product is full georeferenced.

I can send you a color table assigning the colors as defined in the Sen2Cor-ATBD to the different classes. You have to load this colortable manually within SNAP 2.0, but this is much easier and faster than assigning each color individually. I understand the answer of jmalik in the way, that this color table will be loaded automatically when opening a scene classification product within SNAP 2.0.2. This would be indeed the best solution.

2 Likes

Hi @bdpg

In case it was not clear in my previous message, the 2.0.2 update is already available.
You just need to update SNAP (Tools->Plugins and Check for available updates) to install the latest 2.0.2 Sentinel-2 Toolbox and get the correct colors in the level 2A products.

1 Like

Hi @ralf . I’m trying to do this but I’m very new to GIS and can’t find the way to manually show the classification. Is there any example of this?

Thank you

@df.nino10:

1 Like

@ABraun Thank you for your help.

I was trying to see this classification file using QGIS. I found the way by inserting the image as raster and then going to the image properties and then selecting “Singleband pseudocolor” as render type. Then I created the classification classes as specified in the sen2cor docs (attached document) and hit apply. ClassificationClasses.txt (433 Bytes)

Shouldn’t it be “unique values” instead of pseudocolor? This is available since QGIS 3.4 if I recall correctly.