Unsupervised Classification of a satellite image using ArcGIS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi welcome to another exist two toriel today I'm going to show you how to perform an unsuppressed image classification using ArcGIS so as you might know there are two types of image classifications that we can normally do the first one is an unsuppressed image classification which is normally calculated by the software or a supposed image classification where a human will actually do the guiding for the for the computer to do the classification so today I'm going to show you how to perform an unsuppressed image classification so as you can see over here I have loaded up the image to my arcgis interface and what i'm going to do in this tutorial is based on my knowledge of the area i'm going to classify this image using an unsupervised way that means for example i'm aware of the fact that this part of the image corresponds to a river and there are some forested areas and there are some and there are some uncultivated lands which looks like barren lands probably and also you can see some agricultural areas so probably I'm going to have and also we can notice some urban areas as well so probably by the end of this tutorial I might have around five classes five classes of land-use so after you have loaded up your image you can simply right click over here and and activate the image classification panel now after that from the image classification panel you have to make sure that you have selected your loaded up image over here and then go to classification over here and select ISO cluster unsupervised classification all right so now in this window we have to define the number of classes that we need so since I already told that I might have around five classes so let's put five over here and simply click OK and let's observe what happens all right now you can see that over here in the middle region where the river is supposed to be it's classified as it's classified in green color but you can see that green color is actually present in so many other areas as well so if I deactivate this classified layer and if I look into this other areas where we're green color is present I actually do not expect for example these areas to be classified as water bodies but that's how the system has automatically classified this image so this is actually one of the issues with using unsupervised classification because we do not really have a control over defining the areas where which it should be water bodies and areas where it should be agricultural areas and so on so actually one way to get around this problem in unsupportive lasa fication is to increase the number of classes for example if I repeat the same step and instead of putting five classes if I increase the number of classes to let's say ten now you can see that the more the number of classes that you have the more accurate the unsub voice classification gets actually so now you can see that the river got actually classified in one color which is quite accurate however now we can see actually our classification is a bit too detailed now because to my knowledge I can actually classify the region only to about five classes but here we have around ten classes so what I'm going to do is I'm going to actually sort of combine multiple classes together so for example if I consider the river you can see the river has been defined in orange color so I'm going to actually change the color of the river to the universal color that we use for water bodies which is blue so now you can see I will assign the class number three for water bodies and let's deactivate this layer and let's help have a look at this forested areas now what kind of colors have been assigned for these forested areas so you can see actually the forested areas are sort of a mixture of number four so I'm just going to go ahead and give a dark dark green color for the forested areas sorry it should be the field color all right now if i zoom into this area which probably looks like an urban area if i again activate my classified layer you can see that sort of the rooftops are getting colored in this dark purple color so I'm going to probably change that color to be let's say red and I'm going to assign that red color to be the color of the the urban areas and also there are some regions where looks sort of like barren lands over here and I'm actually going to classify urban areas and this open areas in one color so if I just activate my layer activate my classified layer you can see that those open barren lands are sort of getting classified in in a lighter red color so I'm just going to actually assign the same color to to those urban and open barren lands as well so now you can see that we still have a few colors to deal with now if I [Music] if i zoom into this region you can see actually these areas are clearly uh these areas can be clearly classified as agricultural areas looks like paddy fields to me when I activate the layer again I can clearly see that in this case the agricultural areas are also sort of getting classified as forested areas so for the class number five instead of actually classifying it as forested area I'm going to probably use a lighter green color and I'll try to see what happens when I assign a different color so now you can see actually majority of the of the lighter green colors are sort of getting attributed to the to the agricultural areas and now when looking at the yellow color you can see that actually even the yellow color is mostly has been classified over the agricultural areas so I'm also going to sort of use the same color which I used for agricultural areas for the yellow color classification as well all right if i zoom into these corners and if i zoom into this corner you can see that these dark forested areas are getting classified in purple color so what I'm going to do is I'm also going to actually assign the same color of the forest to this purple color regions as well which is the dark green color alright and the class number two I'm going to classify that also as forest ok so so far you can see that class number one two plus number one two and four corresponding to forests class number three is for water bodies five and six is for agricultural areas nine and ten is for open areas open land and urban areas and we still have to sort out number eight and number seven so let's zoom into one part where number seven is present and see from the real image what it actually is so to me actually the number seven color which is the dark blue color also looks like parts of agricultural areas so what I'm going to do is I'm also going to actually assign the same color of agricultural areas to number seven as well and finally we are left with number eight which is sort of a lighter green color now I'll try to see what that number eight would correspond to yes to me actually number eight also appears to be parts of the land curve which corresponds to probably the open areas or barren lands so what I'm going to do is for this tutorial just to keep things simpler I'm just going to assign the same color which corresponds to the open areas roads and an urban areas all right now you can see that we sort of managed to classify our image into four different classes so next what I'm going to do is I'm actually going to use the risk reclassified rule and as the input raster I'm just going to drag and drop my classified raster so what I'm going to do is I'm just going to take class number one semicolon class number two semicolon and class number four and sort of group all these three different classes together which happens to be the class of forests forested areas and the class number three is clearly going to be water bodies I'm going to assign the value of two now why do I not type let's say water bodies are something like that here because in this race reclassify option we can only put integers over here and for class number five six seven I'm going to group them together 5 semicolon 6 semicolon 7 I'm going to assign that number 3 that's the agricultural areas and class number 8 semicolon 9 semicolon 10 which is going to be or urban areas and open land and that's going to be number 4 and make sure you use value as the reclass field over here and you can simply click OK alright now you can see that actually it got reclassified into the the classes that we defined and I'm just going to deactivate this the previously reclassified roster and the new one you can now clearly see has four different classes so I'm going to now if I go to the attributes table over here you can see that it's still in the form of a roster so I'm just going to go it and convert this roster into a polygon you can go to your search panel over here and simply search roster to roster to polygon and you can use your reclassified roster as your input roster and the field you leave it as values and over here you check simplify polygons and click OK alright now after a while you'll be able to see that we managed to create a polygon now if you go to the attributes table of this reclassified polygon you can see a few columns you have the shape ID grid code shape length shape area you can see over here that this grid code is actually coming from that this grid code is actually coming from the values of this roster this one-two-three-four is actually corresponding to this these grid code believes I'm also going to create a new column and assign what actually the property of this grid code is using a small Python script so in order to do that first you go to add field and create a new column and I'm going to name that column s land use or land cover type and that's going to be in text and click OK so what I'm going to do now is I'm going to write this short Python script where it will automatically assign the real land cover type to this grid code so before doing that I have to actually familiarize myself with what this what what each of these colors mean so for example the number one is so for example number two I'm just going to again recolor this to be blue and number one which is forested areas I'm going to color that in dark green and number three which is the agricultural areas I'm going to color it in light green and number four which is the urban areas I'm going to color that in probably yeah brown color something like that now for the for the time being I'm going to leave this particular polygon layer unchecked now in order to write the Python script you have to go to the attributes table over here and just make sure that you are in the editor mode you go to editor and start editing continue and the and then you have to click on this land cover type column right click and go to and go to field calculator and in the field calculator and make sure that you have activated the parser to be Python and also check the show code block so what I'm going to do over here is first in this pre logic script code I'm going to I'm going to define a function and in this space I'm actually going to pass the pass the argument directly so first of all let's see how to write the the pre logic script code now now as you might know python is an indentation sensitive language so you have to specify so whenever you write the if-else commands you have to specify the correct indentation now in it's it's easier to do it actually a in a chord editor rather than doing it over here so what I'm going to do is I'm just going to go over here and open idle which is the default IDE that we get when we install Python and I'm going to go file a new window and the way to define a function in Python is by using de F I'm going to name this function as assign names and the name of my argument is going to be grid code and this grid code is actually coming from here this one because we are going to we are going to find different grid codes and we are going to assign different names based on the value of the grid code alright so you put a colon over here and then I'm going to pass a simple if-else command so if my grid code equals equals to 1 I would like to return a string value of forest else if my grid code is equal to 2 I would like to have a value of water bodies else if my grid code is if my grid code is number 3 I would like to return a value of [Music] agricultural areas and finally else means or you could even define if my grid code is equal to number four then return a value of urban areas keep it simple like that now what I'm going to do is I'm just going to simply copy this one control C and paste it over here alright and finally as my land-use type what I'm going to do is I'm actually going to call this function in this land-use type whenever I need the argument for LC type just going to call this function now the way to call a function in Python is basically you copy this and paste it over here yes as the grid code I'm just going to simply double click over here alright that's about it now let's click OK and see if this script works or not all right now you can see that the script worked quite successfully number one good assigned forest number two water bodies number three agricultural areas and number four urban areas as well all right so now what I'm going to do is I'm just going to deactivate these both of these rosters and now I'm going to activate this polygon and go to properties and and go to symbology and I'm going to select the value field to be land cover type and probably select different color scheme and add the values now I'm just going to again do some simple color changes over here the water bodies again should be colored in blue the agricultural areas I think we can leave this color for the first areas I'm just going to assign a dark green and the urban areas going to assign probably red color so you can see that finally we have sort of an acceptable type of a classification now it's true that this classification is by no means very perfect perfectly done classification that's why it's still called an unsupervised classification and in the next video I'll explain to you how to do a supervised classification which is obviously going to be a bit more accurate than because we are actually going to control the definition of the land cover type areas rather than letting the computer decide so thank you very much for watching this tutorial so if you have any further questions you can comment them down below and I'll see you in the next one thank you
Info
Channel: GeoDelta Labs
Views: 38,081
Rating: 4.9868422 out of 5
Keywords: Unsupervised, Classification, satellite, ArcGIS
Id: 1uMKS2uo_NI
Channel Id: undefined
Length: 22min 46sec (1366 seconds)
Published: Sun Mar 10 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.