Tutorial: Land Cover Classification and Mosaic of Several Landsat images

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi I'm Luca congedo and you're watching from GIS to remote sensing this tutorial is about the length our classification mosaic of several density in particular we are going to classify the area of Costa Rica which is a country of about 51,000 square kilometers so let's see a summary of this tutorial first we are going to install the same at American citizen plug-in into Jes then we are going to download and pre-processing density images then we are going to classify these lens images and enhance the classification using the NDVI vegetation index then we are going to remove clouds and mosaic discuss if occations and finally we are going to perform the accuracy assessment and the pacification report calculating the area of each land cover class so let's start and open UGS in plugins manage install plugins you can search for the same as Amanda classification again type in semi in the search box then we can create in South again and after a few seconds the booking would be invalid successfully and we can close this window and as you can see the plug-in allows and the interface with the main toolbar and the education and the recreation tasks first it is usable to set some of the options of the a plug-in settings window so in semi-automatic crucification button menu go to settings and processing new window of the main interface will open and we are interested in the available run option it is important to set that a half of the available around in the system so for instance if the system has two gigabytes of RAM we set the 1024 megabytes here so the first step of this tutorial is the download of Landsat images semi-automatic classification plug-in is a specific tool and for downloading Landsat images so this window the main interface the first step is to set a directory where the lancet edit things is downloaded so click select database directory and create a new folder for instance you hold your name and Landsat the DB here the last debate database will be eaten loaded which is mainly a list of the available Landsat images in the USGS ok so now we can click update database click yes of this question and the database download will start and after a few minutes will be completed so I recommend styling if you haven't yet the openlayers plugin which allows for showing some maps left like a OpenStreetMap in you jes so we can load up a street map so we can zoom to the area of Costa Rica and now in the main interface we can select the upper-left coordinates and the lower-right coordinates where we are going to search for length of images so clicking the map you can see the coordinates here of the upper left corner then we click the map setting the lower right corner we can set several options for searching images like the satellite acquisition date start and you also we can set the maximum cloud cover allow the image and we can also find images by using the image ID of the Landsat image ID which is contained in the metadata file so for this tutorial I have already selected these three images which is a image ID so we can copy and paste the image idea here and click find images so the searching will start so after the search is completed we'll have these three Landsat images listed in the image list we can highlight these three images and click display image preview and after a few seconds we'll have a preview in UJS loaded you can see our the Landsat 7 a Landsat 7 image and the Landsat 8 covering is central area of Costa Rica and another Landsat 8 image here we can also see that there is a cloud cover all over the images that we are going to remove before downloading the images we go to the pre-processing Landsat tab and set some of the options the processing automatic pre-processing like brightness then producing cells using the apply this one atmospheric correction these are options used for the conversion of lands advanced from digital number to reflect them the plug-in allows also for the upon sharpening of Landsat bands and seven last eight but we are not going to use this option in this tutorial so we uncheck the create band set the option here then we can come back to the download Landsat tab and we uncheck these options leaving checked these two process images and check all Saudis and now we can start the loading the images so click the download image from this you can select the directory where a length of the images are downloaded for instance transit the image click OK so that a lot process will start and of course images are quite big so it will take some time to download all the images and after the download is completed we'll have these directories created in the lancet images we can see that each directory contains the lens band and the metadata file and the directories ending with converted contains the bands automatically converted to reflectance so now we can remove these previews from TGS and we can start the reciprocation of the first Landsat 8 image so we load the bands from 2 to 7 in QGIS this first image is a Landsat 8 images acquired in 2014 so we can hide all the layers because we are now going to create advanced set the plugin density is the input to the pacification input begin which will be based on the Lance advance so in the bestit tab you can click select all so you can select all the lensman's loaded into GS then click Add roster set you can see that the bands are loaded in the band set definition then we click sort by name so the advanced are ordered automatically by event number then we select lesser to aid in the queue length settings and now we are ready to create a RGB composite face color company so for instance we can slide the 42 and automatically built for roster is created and loaded t.j.s and we can see here a color composite where vegetation is highlighted in red you killed an ear in front man so in order to announce the display of the image you can click one of these two buttons for stretching the display advance we can see better the futures the image and now we can create the input files or the classification so the training shapefile here clicking the button in shape we can create a new shape file containing the required fields here for instance Roy and click Save then we need to create a signature of this file in the classification of look so click Save and create a new file priest and see if it's a so we are going to create education identifying these link our classes the tap vegetation soil and water with a macro class from 1 to 4 so let's see an example of macro class macro class like vegetation is a set of classes like has grass or cast trees which is using the plugin for automatically classifying the futures that aren't pixel in the image using the macro class code this is convenient for classifying different futures which belong to a macro fats so now we need to create a region of interest ROI we can draw ROI the image which is a polygon with a flat click for defined vertices and right click close the polygon so now for instance we have created a ROI of the View tab so we need to define the macro class information and the class information here then we can click Save broy so the temporary right we have created is saved in the training shapefile and the signature list is calculated in the signature list we can see that the number over the cursor in the image which shows the NDVI the VI is the ratio between the near-infrared - the red band and near-infrared plus the red band and so we can see that vegetation it has a very high values in the near infrared band so this value can be useful for identifying vegetation image so for instance we can create our ROI over this area of trees here and then we need to change the macro class ID - for vegetation the class ID which must be unique for each row then we can click Save ROI and now we should change the colors of the spectral signatures in the signatories to distance red for the two top green for the vegetation so let's have a look at the spectral signatures here we can highlight the signatures in the signal released then click the button here for showing the spectral signature plot we can see the vegetation which has a very high value in the band the near-infrared band we can see the signature details with the actual values of the spectral signature we can also see their spectral distances between these two spectral signatures for instance the Jeff is meta see the distance is very useful for the maximum likelihood algorithm because it shows if two rows are similar so if the jeffery metadata is near - then the rows are you because they are different so now we're going to create other region of interest for the other classes for instance we can create the one region for the soil class you can see here the NDVI values are quite low I recommend the changing frequently the RGB color composite and and stretching the image because we can identify the objects in the image more clearly so here in this part of the image world in the very view is very low you can create a new polygon for the soil class so we can change the macro class id3 the macro class information soil the class ID and the class information so we could click Save ROI but now I'm going to disable the ads unit release the option and click Save wrong so as you can see the right is the ROI is saved in the right list but it is not calculated in the signatories so now we can highlight this ROI in the released and click Add to signature so now the signature is calculated and added to the signatories here we can change the color so it can be useful if you have rows that are not saved so have a look also at these a signature you can see the distances between the spectral signatures and their plot you can see the differences in the plot and now we are going to create another ROI for the class water so we are moving the image over an area where similar Teresa for instance a river so here we have a river we change the color composite you can see it more clearly and now we are going to create a region of interest using the automatic region growing tool so click the battle here you can see the very low-end DVI Daria's and clicking the image our right polygons is created according to the values of the range radius that we can increase the Princeton's freaking again you can see a larger polygon you can click the redo button and then when we are satisfied we can set the macro class at d4 and the macro pass information water the same from the class Sydney and the class information and we can click Save Roy after enabling a signature list so the spectral signature of the water is calculated you can see it in the spectra signature plot you can see their water as a very low spectral signature you can also navigate in the plot here and zoom you can also see the standard deviation of the spectral signatures so now going back to the spectral distances we can see we can for instance compare the beat up to vegetation you can see that there are very wide spectral distances but if we compare the built up with the soil we can see that these two spectral signatures are more similar so now we are ready and we can create a preview of the specification we are going to use the maximum the maximum like without rhythm we can unchecked they use my capacity here we set a precise of 500 pixels let me click the button the pointer here and click the map there are a few seconds the preview of the classification is loaded tjs we can zoom to the preview it may also see the preview in transparency over the image with this tool so we can see that there are several errors of classification if we click the pointer the preview pointer and right click instead of the left click in the right click in the image we get the algorithm raster which is a raster representing the distance of each pixel two spectral signatures so white areas represent pixels that are close to spectral signatures where dark areas represent pixels that are distant from spectral signatures so probably is our errors so in this dark area we are going to create a new row here we have forests so we are going to create a new region of interest here where the DVI value is very high can increase the range radius so we can create a larger ROI okay so here we can see that the raw polygon covers the dark area so we can set the macro class ad and the class ID of vegetation here vegetation and we can click save right now we set the color of these spectral signature green and we can perform a preview again we can see that the algorithm raster here is white you can see that these previews are in the layers of TTS our raster files so now we can create a new preview and we should notice that the results are better than before because we are created because we have created a new spectral signature we can compare the two vegetation spectral signatures we can see that the Geoffrey's meta Sita distance is good while the spectra angle is very low so if we use the span triangle mapping algorithm we could have errors and as we can see in the plot that we are going to use the maximum lag to the algorithm so we check use microphones ad have a click redo again we can see that vegetation here is classified correctly show in transparency over the image now we are going to create a region of interest over clouds we can see that if we create a preview over clouds these are classified as the top which is of course is a narrow so we are going to create a simple mask now click the recreation model and right click over a cloud pixel automatically the spectral signature of the pixel is it's played in the plot and we can compare the this pixel with the built up spectral signature so we can see these are different so we are going to create a region of interest over clouds in particular we are going to create a mask for clouds so using the polygon tool we are going to create a polygon here and right click to close then we set the macro class the value of 0 which is used for by the plugin for unclassified pixels so setting the macro class CD 0 you and we set a new class ad house and we click Save right now we change the color of the spectral signature and we can perform a preview again as we can see this black area is unclassified it means that plows are masking from the classification of course there are several areas in the darkness still classified as built up over cloud but we are going to use more efficient tool for masking clouds later so after the creation of several rows more is better you can perform a preview again so when the results are good we can save the signature list file we can use all these spectral signatures for creating the classification of the whole last image so click the button perform classification select a select a name for the new pacification file tip file after a few minutes of processing you can see the result is a lenka excitation of the whole image of course we can see the clouds are still classified as will tap here and we have the border the black border of the image you can see fide has been tap and we are going to mask these errors later so we can close this tjs project and now we can start the dissipation of the second Landsat 8 image so again load the band's from vertical reflectance in QGIS again I know layers so we can create dance set set throw the bands and add the rosters to set then click sort by name and set it Landsat 8 so again we can create a color composite here here we have this other lanceolate image acquired fired in 2014 again we need to create a new training shapefile and a new signature list file and after the collection of several rows can perform the classification of this second Landsat 8 image again select the output click Save at the end we have the classification of these Landsat 8 image and of course we have the problem of clouds and also the black border which is classified as soil in this case we are going of course mask these later so we can close the TJ's project and start a new one for the excitation of the third image is the Landsat 7 image so we can load the band's from 1 to 5 and then 7 in CGS again we can hide the layers and create a new band set against alcohol addresses to set and salt my name and now we choose a Landsat 7 and now we can create a new color composite here you can see that this image covers the same area of the first men's at 8 image and unfortunately the last 7 images are affected by these black stripes of the data however we are going to mask these later as usual create a training shapefile and the signatories file and collect several regions of interest and perform the classification so we have classified these lenses have an image you can see that the black stripes are classified as beat up so now in a new QGIS project let the bands and the classification of the first lanceolate image we are going to enhance the classification using the NDVI so open the tool vent calc of the blue team click the button refresh list so we have the list of all the rosters loaded into bas now we are going to write the expression for the calculation of the NDVI so then 5 minus then 4 divided then 5 plus and 4 then close so this is the expression for the calculation of the NDVI click calculate select the output the output name of the NDVI raster and click Save after a few minutes the calculation will be completed so have a look at the NDVI raster you can set a proper symbology here and we can see that of course vegetation has a higher values while soil and urban areas have lower rates here we are going to use this NDVI raster and in order to enhance the pacification of vegetation the been talked to and cleared expression and click fresh list now we have the NDVI raster we are going to create a conditional expression with the NP where so empty where NDVI is greater than 0.6 comma 2 comma situation 1 and of course closed this means that the word the NDVI values are greater than 0.6 we are going to set a value of 2 which is the macro class vegetation otherwise we are going to leave the values of classification 1 so click calculate and select the output of this new classification for instance classification 1 and VI after the calculation de the new classification is loading eqj yes we can copy the style from the old kosa fication to the new one style a style so we have the same colors you can compare the two classifications you can see that the vegetation hasn't risen and particularly over the soil areas so we have increased the area classified as vegetation we can do the same also for the other two classifications using the NDVI and we can see that there are still clouds classified as built up above soil that we need to mask so now we're going to use the quality seismic band of the Landsat 8 in order to mask out cover each value of this particular raster present a condition of the surface or the atmosphere and in particular certain values allow for the identification of clouds so if we use the tool identified we can see the values represent clouds like for instance this one so we can use these values for the masking of thousand liters if occasion we're going to use the bank calc tool and the conditional statement and beware so copy and paste this expression I'm going to explain so the first part of this expression and represent the values of in the quality assessment band that they identify clouds so with the first part of this expression we are selecting all the cloud pixels and we are setting a value of zero that is classified this if ocation and the last part of the expression classification 1 and vvi represent all the other pixels so the pixels that are not covered the quality sessemann band are classified as the regional value of the classification 1 so we click on calculate and we select the excitation output for instance classification 1 cloud and click Save after the calculation we get the new Civic ation we copy and paste the style and we can see that most part of Klaus is masculine however we can see that there are still pixels classified as built-up especially in the border of Klaus and we are going to use another metal for masking loads of these pixels so in the case of the Landsat 7 classification that doesn't have a quite assessment man and we're going to use the properties of clouds which are cold and why so we are using the term early for a tan and they do ban for creating a mask so learn all the bands lots of seven bands in QGIS so we can hide all the layers and show just the blue in determining for man we can see this band converted to temperature particularly cold clouds we can see with a tool identify that cloud pixels have very low temperature and high value the blue band which is been one you here also for these other pixels and see the same so what we are doing to do is to create an expression in the mental tool which allows for the selection of pixels that have low temperature and high reflectance value in the Bluebell so copy and paste this expression that I'm going to explain so the first part of the expression represents the selection of the temperature lower than 53 degrees Celsius the second part represents the selection of pixels with the values with the reflectance values greater than 0.1 in the blue band and the other part of the expression represent the selection of pixels no data pixels that are present in the Landsat 7 bands with the scan line corrector failure so all these pixels out we Excel and other pixel are set to zero the value of zero and classified no the other pixels are set as the original values classification three so uncheck intersection and click calculate and set the output name for instance consideration three cows so at the end of the process so we get the new classification with a cloud mask copy and paste as usual the style from the original classification to the new one we can see that the clouds are completely masked here we can see the difference with the previous classification we also mask the border of course the threshold that we have used for the temperature and the blue band have to be assigned basing on the image so different images should have different thresholds and here we can see the results of the three classification with a cloud mask using this method based on temperature and the blue band and we can see that all the clouds are completely masked now we are going to create a mosaic of these deviations we are going to create a conditional statement with an e where we select classification one clouds equal to zero here we are going to put another conditional statement with the classification three equals zero then we put classification two basically this means that if classification 3 equals zero then we get the classification to the values otherwise we get excitation 3 then we close and put classification 1 clouds this means that when consideration 1 is not equal to 0 we get the classification 1 base so now that we have completed the expression we can check intersection and click calculate so we select the output name for instance classification like and we click Save there are a few minutes the pacification was like be completed as usual we copy and paste the style of data syndication and we can see the result here we can see that we have filled several no data values so now we can assess the accuracy of the conciliation one simple but not very rigorous method is to compare the education to the training ship file so load the traineeship file in QGIS and open the post processing tools in the accuracy tab select the classification mosaic and the traineeship file as input in particular select the macro class ideas check ID field and click calculate error metrics we select a output file name this tool will create a raster of the accuracy where the fixes of the classification are compared to the traineeship file and each value represents a a code of comparison between the traineeship file the reference and the classification here we can see the summary and error matrix and it also calculates several statistics like the overall accuracy the producer and user actresses and the Kappa hat of course I recommend reading the user manual for more information about the accuracy okay so now we can click the classification to the study area which is Costa Rica and we can go to this website of the Food and Agriculture Organization the United Nations which allows for the download of the shapefile of Costa Rica so click download and again download here download the zip file which is which contains the shapefile we are going to extract this archive here and load the ship file in t.j.s now we can see that it is missing the coordinate system so select the wgs84 and now we are going to also to define the projection of this shape file before clicking so in vector data management tools define current projection select the ship v of costa rica and choose a wgs84 here and click OK again ok II okay now that we have defined the projection we can increase the education with this shapefile so raster extraction quicker select the classification was I in truster with hand a output resistance classification crib and click Save then we are going to select the mask layer which is the Costa Rica shapefile here we set the no data value equals zero and click OK there are a few minutes the process will be completed and we'll have the classification trip to the study area now we copy and paste the style lettuce education and we can see there is a here is the classification of Costa Rica of course there are no data values due to the clouds we would need several Landsat images more Landsat images for filling these gaps okay now in the plug-in menu go to the post-processing to education wrapper and we are going to calculate the statistics the densification so select the classification clip as input and check use no data value equals zero then click calculate classification wrapper at the end of the calculation we'll get the statistics for additional cover class like the pixel some the percentage and the area well that's all for this edition if you have any comment or question please join the Facebook group or the Google+ community thank you for watching Oh
Info
Channel: Luca Congedo
Views: 56,282
Rating: 4.961165 out of 5
Keywords: QGIS, Supervised Classification, Tutorial, Landsat, Land Cover
Id: acxmIrM-Qns
Channel Id: undefined
Length: 52min 5sec (3125 seconds)
Published: Mon Oct 05 2015
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.