Supervised and unsupervised classification, Sentinel 2

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.

You need to resample the bands to a common size. The processor can’t handle the data when the dimension of the source bands is different.
You can either use the generic Resampling operator in Raster / Geometric Operation which is faster or the S2 specific one in Optical / Geometric which is slower but handles the view angles more accurate.

1 Like

@andy , @ABraun I have exact problem after running RF classification I got a blank raster image and question mark in frequency. I saw our member mention about projection.

(maybe the solution) Then I try to reprojection but I left everything is default particularly the projection is Geographic Lat/Lon (WG84) [Dont choose UTM / WGS84 (Automatic)]. Then the classifier work well. (I dont know what happend next if we export into QGIS)

1 Like

It’s kind of a bug. The data must be projected into geographic coordinates first.

Doesn’t matter for the later use of QGIS. You can still open it there and overlay it with other data in UTM projection. Maybe you need to reproject the result back into UTM if you want to intersect this data with other rasters/vectors in QGIS.

2 Likes

Thanks brother ABraun! I already tried I have to reprojection the result back into UTM otherwise it is not overlay with other shapefile which has UTM/WGS84.
I have one more question. As show in image below (red rectangle), the surrounding lake was incorrectly classified as Mangrove. How to improve this situation? I found on QGIS, we can directly edit raster. But does anybody have other options?

Thank very much!!!

change the Mangrove training data.

2 Likes

Dear All,

I would like to export the KNN classification results (shown in red below ) in a text file, however I can’t do it with the export masks tool. Is there any other way pls?