Supervised and unsupervised classification, Sentinel 2

ok thanks! It worked

4 posts were split to a new topic: Classification: How to use saved classifier on another product

A post was merged into an existing topic: Classification: How to use saved classifier on another product

Hi, could the people of SNAP clarify why the supervised classification (I’m using MLC) does not work if a reprojection step is not included? According to the previous posts and my experience the process works when:

Resample (and save product)
Subset (if necessary) (and save product)
Reproject (and save product)
Run classification (training areas created before)

Why do we have to reproject if the S2 1c has already a reference system? Is this a software bug? It doesn’t look logical to reproject a product that is already projected

Thanks for the clarification
M

I haven’t heard of this before, can you please provide links to posts where it is stated that data should be reprojected?

The only think about Sentinel-2 is that it is a multi-size product so resampling is needed before most steps. The thing is that the resampling operator only writes a logical product in most cases (when resampling only takes 1 second). It is physically written on your hard drive only when you save the product as a dim file or perform another operation on it which writes a product to a new file. So maybe this step is needed for classification but I don’t think it must be reprojection in special.

It is mentioned in this post

But this is a bug. And @junlu already said that they will have a look at it.

what do we input apart from the one image we want to classify ? plz specify in detail.

what did u input in product set reader? which images do i need to take, the one needs to be classified and what about the second one? please give details

what files do i need to take as input in product set reader for supervised knn or random forest classifier? plz specify in detail

I would suggest reading some of the basics first. Otherwise you would just press buttons without knowing what is happening :slight_smile:


http://www.iiste.org/Journals/index.php/JEES/article/viewFile/7807/7873
http://www.nrcan.gc.ca/node/9361

3 Likes

Dear @ABraun ,
I have same error.
I want to do classification on Tandem-x image but first of all, I tried on S2 product. I resampled it from 60 m to 20 meters and then I subseted a small area and created a container with the right name. Then I selected it by clicking on the corresponding class under Vector Data and use one of the digitizing tools: Rectangle, polygon or circle. You can see my steps in below but polygon does not have information.
What can I do now?

what error exactly do you mean? Hard to find under the 75 posts in this topic :wink:

haha. If you look at the image that I uploaded you can see the polygon does not have geometry information. I do not know why?

is there a chance that the geometry was inserted in another vector container - lake or vegetation for example?
If you just select your the menu “vector data” in the layer manager you are asked which container is to be digitized for every time you click in the map.

Yes. It asked me that which container is to be digitized for every time you click in the map but still the polygon is empty.
You can see it here that it asks me and I choose correct one.

pull the geometry column a bit wider with your mouse. It is stored as a WKT like

POLYGON((8.179687410593033 49.11654977356537,10.201171785593033 49.11654977356537,10.201171785593033 47.47959357730535,8.179687410593033 47.47959357730535,8.179687410593033 49.11654977356537))

Maybe you just didn’t see it in the current display mode.

15 posts were merged into an existing topic: Blank result after supervised classification. Why?

Try to decrease number of your training samples. I am not sure what is it but when I decreased on value of 20 classification run out without problems and there was no blank screen!!

I am not sure what is training samples - are they values of pixels inside your training classes (vectors)?

Hi, thanks for the response. I’ve solved this problem now. It has to do with reprojecting the image before classification. Once the reprojection (to WGS84) is done the classification works fine.

And yes - training pixels are the pixel values inside the vector polygons.

1 Like

I am having another issue with supervised classification, the feature bands selection are not visible (please refer to image), therfor I just can select which band I need. I created thenew vector containers and used to polygon tool to select the zones.

Could you kindly help.