{"id":2700,"date":"2018-10-01T17:10:49","date_gmt":"2018-10-01T15:10:49","guid":{"rendered":"https:\/\/blogs.fu-berlin.de\/reseda\/?page_id=2700"},"modified":"2018-10-04T20:10:53","modified_gmt":"2018-10-04T18:10:53","slug":"texture-metrics-glcm","status":"publish","type":"page","link":"https:\/\/blogs.fu-berlin.de\/reseda\/texture-metrics-glcm\/","title":{"rendered":"Texture Metrics"},"content":{"rendered":"<p>In this section we want to derive the Grey-Level Co-occurrence Matrix (GLCM) texture measurements for a S1 VH intensity raster. However, this workflow is not exclusive for Sentinel 1 data. You can derive GLCM metrics for any given raster, i.e., optical or radat. Due to the low spectral resolution and comparably low signal-to-noise ratio of radar data, the texture metrics are predestined to extend the feature space with meaningful data, e.g., for classification or regression tasks.<\/p>\n<p>Luckily, the derivation of GLCM is done in one command in SNAP. Nevertheless, we want to create a graph file that theoretically allows you to <a href=\"https:\/\/blogs.fu-berlin.de\/reseda\/s2-bulk-preprocessing\/#1\" rel=\"noopener\" target=\"_blank\">process a lot of data easily via GPT<\/a>. Have a look at the <a href=\"https:\/\/blogs.fu-berlin.de\/reseda\/s2-bulk-preprocessing\/#1\" rel=\"noopener\" target=\"_blank\">Bulk Processing Section<\/a> of this course to learn, how to automate the process for many datasets.<br \/>\nOur workflow will contain the following sequential processing nodes: <\/p>\n<ol>\n<li><strong>Read<\/strong>: Input &#8211; import a S1 scene (or any other raster file)<\/li>\n<li><strong>GLCM<\/strong>: process all GLCM metrics of your choice<\/li>\n<li><strong>Write<\/strong>: Output &#8211; write all GLCM bands into one GeoTiff raster file<\/li>\n<\/ol>\n<p><\/br><a name=\"1\"><\/a><\/p>\n<h1>Step by Step<\/h1>\n<p>First, get a pre-processed S1 image or another raster file of your study area. In the following example, we will use the VH-intensity image of a Sentinel 1 scene, which we derived in <a href=\"https:\/\/blogs.fu-berlin.de\/reseda\/intensity-images\/\" rel=\"noopener\" target=\"_blank\">the previous section<\/a>. You can download this example dataset <a href=\"##\" rel=\"noopener\" target=\"_blank\">here<\/a>. It is not advantageous to use a speckle filter before deriving textures, as this eliminates most of the scene&#8217;s characteristics.<\/p>\n<p>Open SNAP and click on the graph builder icon <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/05\/SNAP_buttons_05.png\" alt=\"\" width=\"28\" height=\"32\" class=\"alignnone size-full wp-image-899\" \/> in the Toolbar. You will see a new window pop up, which shows a standard graph (containing one <strong>Read <\/strong>and one <strong>Write <\/strong>node) in the upper area and some options in the lower area. <\/p>\n<p><a href=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/sar_003.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/sar_003.png\" alt=\"\" width=\"300\" height=\"749\" class=\"aligncenter size-full wp-image-2740\" \/><\/a><\/p>\n<p>Right click somewhere in the white area in the upper window to add new nodes, i.e., processing steps, to the graph. Navigate to GLCM and add it:<\/p>\n<ol>\n<li><em><strong>Read<\/strong><\/em><\/li>\n<li><em>Add <\/em>&gt; <em>Raster<\/em> &gt; <em>Image Analysis<\/em> &gt; <em>Texture Analysis<\/em> &gt; <em><strong>GLCM<\/strong><\/em> <\/li>\n<li><em><strong>Write<\/strong><\/em><\/li>\n<\/ol>\n<p>Each processing step is visualized by a rectangle in the graph. You can drag those rectangles, or nodes, to whichever position you want with pressed left mouse button. Arrange the added nodes to something like this:<\/p>\n<p><a href=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/sar1_022.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/sar1_022.png\" alt=\"\" width=\"314\" height=\"48\" class=\"aligncenter size-full wp-image-2815\" srcset=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/sar1_022.png 314w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/sar1_022-300x46.png 300w\" sizes=\"auto, (max-width: 314px) 85vw, 314px\" \/><\/a><\/p>\n<p>The individual nodes are not yet linked. If you rest the mouse pointer over the right edge of a rectangle, you will see a red arrow. Drag this arrow with pressed left mouse button to the next node in the following order:<\/p>\n<p><a href=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/sar1_021.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/sar1_021.png\" alt=\"\" width=\"314\" height=\"48\" class=\"aligncenter size-full wp-image-2816\" srcset=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/sar1_021.png 314w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/sar1_021-300x46.png 300w\" sizes=\"auto, (max-width: 314px) 85vw, 314px\" \/><\/a><\/p>\n<p>Next, click on the Read Node and load your raster into the Source Product setting. This could take a short moment. <strong>Attention<\/strong>: From now on, it will always take a little while to switch back and forth between the processing nodes, as SNAP will process and read your data as virtual products in the background!<\/p>\n<p>Now either click through the tabs at the bottom of the Graph Builder window or through the node rectangles to set the following options for all the nodes. You should try to make the settings in order, because graph building in SNAP is quite &#8220;fragile&#8221; and it may sometimes lead to strange errors, if the modules are not properly build on each other.<\/p>\n<div class=\"h5p-iframe-wrapper\"><iframe id=\"h5p-iframe-13\" class=\"h5p-iframe\" data-content-id=\"13\" style=\"height:1px\" src=\"about:blank\" frameBorder=\"0\" scrolling=\"no\" title=\"sar02\"><\/iframe><\/div>\n<p><strong>Parameters of GLCM:<\/strong><br \/>\n<strong>Source Band<\/strong>: single input band of your raster, on which GLCM metrics should be derived<br \/>\n<strong>Window Size<\/strong>: moving window size for calulcating co-occurences<br \/>\n<strong>Angle<\/strong>: angle from which the neighborhood of two pixels is seen. Preferred: ALL<br \/>\n<strong>Quantizer<\/strong>: if probabilistic  is selected, your GLCM matrix is expressed as probabilities instead of counting the total number of occurrences. Preferred: probabilistic<br \/>\n<strong>Quantization Levels<\/strong>: Number of gradations in the co-occurrence matrix (e.g., 32 different grey scale values). More quantized levels, less information loss. Less quantized levels, more information loss, but faster processing. Preferred: 32 or 64 levels<br \/>\n<strong>Displacement<\/strong>: Considered distance between two pixels. Distance of &#8220;1&#8221; means one pixel to the east from your reference pixel accounts for co-occurence statistics. Preferred: 1-4<\/p>\n<p>When everything is set, you might want to save your graph. Simply click on \u201cSave\u201d on the bottom of the graph window and choose a file path. After that, start the graph via \u201cRun\u201d. Depending on the size of the study area and the processing nodes, this will take some time. <\/p>\n<p>After processing is finished, you should get one GeoTiff-file that includes all selected metrics. Open the file in SNAP and double click the band you want to visualize:<\/p>\n<p><a href=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/sar1_026.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/sar1_026.png\" alt=\"\" width=\"302\" height=\"261\" class=\"aligncenter size-full wp-image-2823\" srcset=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/sar1_026.png 302w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/sar1_026-300x259.png 300w\" sizes=\"auto, (max-width: 302px) 85vw, 302px\" \/><\/a><\/p>\n<div style=\"margin: -30px 0 20px 0;text-align: center\"><span style=\"color: #686868;font-size: small\">GLCM bands in output file<\/span><\/div>\n<p>Those are the texture metrics opened in SNAP:<\/p>\n<p><a href=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_001.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_001.png\" alt=\"\" width=\"1263\" height=\"357\" class=\"aligncenter size-full wp-image-2825\" srcset=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_001.png 1263w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_001-300x85.png 300w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_001-768x217.png 768w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_001-1024x289.png 1024w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_001-1200x339.png 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/p>\n<div style=\"margin: -30px 0 20px 0;text-align: center\"><span style=\"color: #686868;font-size: small\">Contrast<\/span><\/div>\n<p><a href=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_002.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_002.png\" alt=\"\" width=\"1263\" height=\"357\" class=\"aligncenter size-full wp-image-2826\" srcset=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_002.png 1263w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_002-300x85.png 300w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_002-768x217.png 768w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_002-1024x289.png 1024w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_002-1200x339.png 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/p>\n<div style=\"margin: -30px 0 20px 0;text-align: center\"><span style=\"color: #686868;font-size: small\">Dissimilarity<\/span><\/div>\n<p><a href=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_003.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_003.png\" alt=\"\" width=\"1263\" height=\"357\" class=\"aligncenter size-full wp-image-2827\" \/><\/a><\/p>\n<div style=\"margin: -30px 0 20px 0;text-align: center\"><span style=\"color: #686868;font-size: small\">Homogeneity<\/span><\/div>\n<p><a href=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_004.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_004.png\" alt=\"\" width=\"1263\" height=\"357\" class=\"aligncenter size-full wp-image-2828\" \/><\/a><\/p>\n<div style=\"margin: -30px 0 20px 0;text-align: center\"><span style=\"color: #686868;font-size: small\">ASM<\/span><\/div>\n<p><a href=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_005.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_005.png\" alt=\"\" width=\"1263\" height=\"357\" class=\"aligncenter size-full wp-image-2831\" srcset=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_005.png 1263w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_005-300x85.png 300w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_005-768x217.png 768w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_005-1024x289.png 1024w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_005-1200x339.png 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/p>\n<div style=\"margin: -30px 0 20px 0;text-align: center\"><span style=\"color: #686868;font-size: small\">Energy<\/span><\/div>\n<p><a href=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_006.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_006.png\" alt=\"\" width=\"1263\" height=\"357\" class=\"aligncenter size-full wp-image-2833\" srcset=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_006.png 1263w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_006-300x85.png 300w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_006-768x217.png 768w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_006-1024x289.png 1024w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_006-1200x339.png 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/p>\n<div style=\"margin: -30px 0 20px 0;text-align: center\"><span style=\"color: #686868;font-size: small\">MAX<\/span><\/div>\n<p><a href=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_007.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_007.png\" alt=\"\" width=\"1263\" height=\"357\" class=\"aligncenter size-full wp-image-2834\" srcset=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_007.png 1263w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_007-300x85.png 300w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_007-768x217.png 768w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_007-1024x289.png 1024w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_007-1200x339.png 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/p>\n<div style=\"margin: -30px 0 20px 0;text-align: center\"><span style=\"color: #686868;font-size: small\">Entropy<\/span><\/div>\n<p><a href=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_008.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_008.png\" alt=\"\" width=\"1263\" height=\"357\" class=\"aligncenter size-full wp-image-2835\" srcset=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_008.png 1263w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_008-300x85.png 300w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_008-768x217.png 768w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_008-1024x289.png 1024w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_008-1200x339.png 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/p>\n<div style=\"margin: -30px 0 20px 0;text-align: center\"><span style=\"color: #686868;font-size: small\">GLCMMean<\/span><\/div>\n<p><a href=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_009.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_009.png\" alt=\"\" width=\"1263\" height=\"357\" class=\"aligncenter size-full wp-image-2836\" srcset=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_009.png 1263w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_009-300x85.png 300w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_009-768x217.png 768w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_009-1024x289.png 1024w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_009-1200x339.png 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/p>\n<div style=\"margin: -30px 0 20px 0;text-align: center\"><span style=\"color: #686868;font-size: small\">GLCMVariance<\/span><\/div>\n<p><a href=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_010.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_010.png\" alt=\"\" width=\"1263\" height=\"357\" class=\"aligncenter size-full wp-image-2837\" srcset=\"https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_010.png 1263w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_010-300x85.png 300w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_010-768x217.png 768w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_010-1024x289.png 1024w, https:\/\/blogs.fu-berlin.de\/reseda\/files\/2018\/10\/glcm_010-1200x339.png 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/p>\n<div style=\"margin: -30px 0 20px 0;text-align: center\"><span style=\"color: #686868;font-size: small\">GLCMCorrelation<\/span><\/div>\n<p><a href=\"https:\/\/pdfs.semanticscholar.org\/5140\/f1dc83e562de0eb409385480b799e9549d54.pdf\" rel=\"noopener\" target=\"_blank\">Haralick et al. 1973<\/a> or <a href=\"https:\/\/www.researchgate.net\/publication\/315776784_GLCM_Texture_A_Tutorial_v_30_March_2017\" rel=\"noopener\" target=\"_blank\">Hall-Beyer 2005<\/a> <\/p>\n<p><\/br><\/br><\/p>\n<hr style=\"height:4px;background-color:#6b9e1f\">\n<a href=\"https:\/\/blogs.fu-berlin.de\/reseda\/visualization\/\"><br \/>\n<button style=\"width:100%;text-align:right;padding: 10 0;background-color:white;margin:-55px 0 0 0\"><\/p>\n<div style=\"font-family: 'Noto Sans',sans-serif;line-height: 1.2\">\n<span style=\"font-size: 12px;color:#bfbfbf\"><strong><em>NEXT<\/em><\/strong><\/span><br \/>\n<span style=\"font-size: 30px;color:#6b9e1f\"><strong><em>Visualization<\/em><\/strong><\/span>\n<\/div>\n<p><\/button><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this section we want to derive the Grey-Level Co-occurrence Matrix (GLCM) texture measurements for a S1 VH intensity raster. However, this workflow is not exclusive for Sentinel 1 data. You can derive GLCM metrics for any given raster, i.e., optical or radat. Due to the low spectral resolution and comparably low signal-to-noise ratio of &hellip; <a href=\"https:\/\/blogs.fu-berlin.de\/reseda\/texture-metrics-glcm\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Texture Metrics&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3237,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2700","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/blogs.fu-berlin.de\/reseda\/wp-json\/wp\/v2\/pages\/2700","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.fu-berlin.de\/reseda\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blogs.fu-berlin.de\/reseda\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.fu-berlin.de\/reseda\/wp-json\/wp\/v2\/users\/3237"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.fu-berlin.de\/reseda\/wp-json\/wp\/v2\/comments?post=2700"}],"version-history":[{"count":16,"href":"https:\/\/blogs.fu-berlin.de\/reseda\/wp-json\/wp\/v2\/pages\/2700\/revisions"}],"predecessor-version":[{"id":2838,"href":"https:\/\/blogs.fu-berlin.de\/reseda\/wp-json\/wp\/v2\/pages\/2700\/revisions\/2838"}],"wp:attachment":[{"href":"https:\/\/blogs.fu-berlin.de\/reseda\/wp-json\/wp\/v2\/media?parent=2700"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}