<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6714775518593018180</id><updated>2026-03-28T14:08:33.041+05:30</updated><category term="Removing Image noise"/><category term="GUI Components in MATLAB"/><category term="Image Conversion"/><category term="Edge detection"/><category term="Image transformation"/><category term="Photoshop effects in MATLAB"/><category term="MATLAB BUILT_IN FUNCTIONS"/><category term="Morphological Image Processing"/><category term="Video Processing"/><category term="Array functions in MATLAB"/><category term="Machine Learning"/><category term="Files"/><category term="Histogram equalization"/><category term="Image Compression"/><category term="Image coding"/><category term="Object Identification"/><category term="Optical illusion"/><category term="Shapes"/><category term="Templates"/><category term="frequency domain"/><category term="image processing with python"/><category term="interpolation"/><category term="GLCM"/><category term="Image Geometry"/><category term="Textures"/><category term="clustering"/><category term="color image processing"/><category term="Computer Vision System"/><category term="Image Arithmetic"/><category term="Image comparison"/><category term="Python Imaging Library"/><category term="anaconda"/><category term="despeckling"/><category term="python"/><category term="skimage"/><category term="spyder"/><title type='text'>IMAGE PROCESSING</title><subtitle type='html'>Lets Learn together... Happy Reading&#xa;&lt;br&gt;&lt;br&gt;&#xa;&quot; Two roads diverged in a wood, and I,  &#xa;&lt;br&gt;&#xa;I took the one less traveled by,  &#xa;&lt;br&gt;&#xa;And that has made all the difference &quot;-Robert Frost</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.imageeprocessing.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714775518593018180/posts/default?max-results=4&amp;redirect=false'/><link rel='alternate' type='text/html' href='http://www.imageeprocessing.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6714775518593018180/posts/default?start-index=5&amp;max-results=4&amp;redirect=false'/><author><name>Aaron Angel</name><uri>http://www.blogger.com/profile/02358906964252196081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgirLgdbfLRDpPYjYn1-diL1GZ6uIQvGkBN4BnbSDwEwDB3VWjH06_dsu_5OTB3dEzItQaNNrlMr_pzueWE01Rbbs6H40ZQ0hJbL8v01TEP09oRCNsXPsDloG5QDO5SvG0/s220/angel.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>124</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>4</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6714775518593018180.post-1627267697707905331</id><published>2020-07-16T20:26:00.000+05:30</published><updated>2020-07-16T20:26:58.945+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="despeckling"/><category scheme="http://www.blogger.com/atom/ns#" term="Removing Image noise"/><title type='text'>Lee filter using MATLAB</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 18.6667px; text-align: justify; text-indent: -24px;&quot;&gt;Lee filter for speckle reduction has been realized in MATLAB. For explanation check:&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;https://www.imageeprocessing.com/2014/08/lee-filter.html&quot;&gt;https://www.imageeprocessing.com/2014/08/lee-filter.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;line-height: 17.12px;&quot;&gt;&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;MATLAB code:&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-size: 28pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;line-height: 17.12px;&quot;&gt;&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;courier new&amp;quot;; font-size: 10pt;&quot;&gt;%Read an Image&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10pt;&quot;&gt;I = imread(&lt;/span&gt;&lt;span style=&quot;color: #a020f0; font-family: &amp;quot;courier new&amp;quot;; font-size: 10pt;&quot;&gt;&#39;coins.png&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10pt;&quot;&gt;);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;courier new&amp;quot;; font-size: 10pt;&quot;&gt;%Add multiplicative noise to the image&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10pt;&quot;&gt;J = imnoise(I,&lt;/span&gt;&lt;span style=&quot;color: #a020f0; font-family: &amp;quot;courier new&amp;quot;; font-size: 10pt;&quot;&gt;&#39;speckle&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10pt;&quot;&gt;,0.01);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;courier new&amp;quot;; font-size: 10pt;&quot;&gt;%Apply Lee filter&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10pt;&quot;&gt;K = Lee_filter(I,J,[5 5]);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10pt;&quot;&gt;figure,subplot(121),imshow(J);title(&#39;Noisy Image&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10pt;&quot;&gt;subplot(122),imshow(uint8(K));title(&#39;Despeckled Image&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9Rhteo3HuEVG3lwNMjpaNYCs-PeMGg-JuJnCVUGMKzMgBNXHSw6RmtAUZiu0yhaMV7Oe-G4eejzZRKnI1U8giHGOHObrBtZzWF2FyApD1n8iLXA0RQ5TYRBR3Qk8-QWD0G7oG5OBMtCY/s1600/lee_mat.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;629&quot; data-original-width=&quot;1509&quot; height=&quot;266&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9Rhteo3HuEVG3lwNMjpaNYCs-PeMGg-JuJnCVUGMKzMgBNXHSw6RmtAUZiu0yhaMV7Oe-G4eejzZRKnI1U8giHGOHObrBtZzWF2FyApD1n8iLXA0RQ5TYRBR3Qk8-QWD0G7oG5OBMtCY/s640/lee_mat.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;MATLAB Function:&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;
&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/u&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt; Y =
Lee_filter(R,E,sz)&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%R is the Reference Image&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%E is the Error or Noisy
Image&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%K is the Kernel or Window&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%Y is the Output Image&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;% Y = mean(K)+W*(C-mean(K);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;% W =
variance(K)/(variance(K)+variance(R))&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%Define the type&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;R = double(R);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;E = double(E);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%Preallocate the Output
Matrix&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;Y = zeros(size(R));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;mn = round((sz-1)/2);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;Tot = sz(1,1)*sz(1,2);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;EImg = padarray(E,mn);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%Variance of the reference
Image&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;Rvar = var(R(:));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;Indx = floor(median(1:Tot));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt; i = 1:size(R,1)&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt; j = 1:size(R,2)&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;K = EImg(i:i+sz(1,1)-1,j:j+sz(1,2)-1);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;varK = var(K(:));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;meanK = mean(K(:));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;W = varK./(varK+Rvar);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Y(i,j) = meanK + W * (K(Indx)-meanK);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;EXPLANATION:&lt;/span&gt;&lt;/b&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 18.6667px; text-align: justify; text-indent: -24px;&quot;&gt;Save the function Lee-filter.m in separate file&lt;/span&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://www.imageeprocessing.com/feeds/1627267697707905331/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.imageeprocessing.com/2020/07/lee-filter-using-matlab_16.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6714775518593018180/posts/default/1627267697707905331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714775518593018180/posts/default/1627267697707905331'/><link rel='alternate' type='text/html' href='http://www.imageeprocessing.com/2020/07/lee-filter-using-matlab_16.html' title='Lee filter using MATLAB'/><author><name>Aaron Angel</name><uri>http://www.blogger.com/profile/02358906964252196081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgirLgdbfLRDpPYjYn1-diL1GZ6uIQvGkBN4BnbSDwEwDB3VWjH06_dsu_5OTB3dEzItQaNNrlMr_pzueWE01Rbbs6H40ZQ0hJbL8v01TEP09oRCNsXPsDloG5QDO5SvG0/s220/angel.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9Rhteo3HuEVG3lwNMjpaNYCs-PeMGg-JuJnCVUGMKzMgBNXHSw6RmtAUZiu0yhaMV7Oe-G4eejzZRKnI1U8giHGOHObrBtZzWF2FyApD1n8iLXA0RQ5TYRBR3Qk8-QWD0G7oG5OBMtCY/s72-c/lee_mat.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6714775518593018180.post-8679547095409350692</id><published>2019-04-28T00:28:00.000+05:30</published><updated>2019-05-12T18:51:02.020+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="GLCM"/><category scheme="http://www.blogger.com/atom/ns#" term="Textures"/><title type='text'>Texture Measures from GLCM – MATLAB CODE</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;We have seen &lt;a href=&quot;https://www.imageeprocessing.com/2019/04/grey-level-co-occurrence-matrix-glcm-in.html&quot;&gt;how to generate the GLCM matrix&lt;/a&gt; and as a continuation, we will focus on the different measures
that can be obtained from the GLCM matrix. These measures are broadly
classified into three different groups.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;Contrast
Group:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l2 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt;&quot;&gt;Contrast
     (Con)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l2 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt;&quot;&gt;Dissimilarity
     (Diss) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l2 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt;&quot;&gt;Homogeneity
     (Hom) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt;&quot;&gt;&lt;br /&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Orderliness Group:&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l1 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt;&quot;&gt;Angular
     Second Moment (Asm) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l1 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt;&quot;&gt;Maximum
     Probability (Max) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l1 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt;&quot;&gt;Entropy
     (Entropy) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt;&quot;&gt;&lt;br /&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Statistics Group:&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l0 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt;&quot;&gt;GLCM
     Mean &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l0 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt;&quot;&gt;GLCM
     Variance &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l0 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt;&quot;&gt;GLCM
     Correlation &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;GLCM matrix contains the number of occurrences of two
grey levels and let’s perform normalization to measure the probability of occurrence
of these two pixels.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;NORMALIZATION:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;Divide the GLCM matrix by total counts of the pixel occurrences.
Sum of the values in GLCM matrix = 20&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;MATLAB
CODE:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;GProb = glcm./sum(glcm(:));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdhL93daLHTYvL0S-dfkwCx8ol3nNYKb0N-qk0AIRegurSirNKahiXfCSm25ubszbItJWOsNPjXQ4FF-sBprG8ycQK2bwJajTnF7T5X4LKj2dNoJEAx1VRrkRyhhoL8PSXxu2jnbTVVLM/s1600/GLCM_mat.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;274&quot; data-original-width=&quot;417&quot; height=&quot;262&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdhL93daLHTYvL0S-dfkwCx8ol3nNYKb0N-qk0AIRegurSirNKahiXfCSm25ubszbItJWOsNPjXQ4FF-sBprG8ycQK2bwJajTnF7T5X4LKj2dNoJEAx1VRrkRyhhoL8PSXxu2jnbTVVLM/s400/GLCM_mat.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgispEXhKAuGqXLQR565bGW8qJWEaLRcfMcaF8BDrTJbJjY-jGRxp7EcLYDe10fu-GIAXtxt8_iFKwUUY_WjqILzXG5WUj4lITaCecX3onId_javd-TlEufIhhpXivIeqjw8_Mlp_i1fNU/s1600/GLCM06.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;251&quot; data-original-width=&quot;702&quot; height=&quot;227&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgispEXhKAuGqXLQR565bGW8qJWEaLRcfMcaF8BDrTJbJjY-jGRxp7EcLYDe10fu-GIAXtxt8_iFKwUUY_WjqILzXG5WUj4lITaCecX3onId_javd-TlEufIhhpXivIeqjw8_Mlp_i1fNU/s640/GLCM06.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmRiKiCAd3hdJQ4QlqeOSPQQrDsnPBYI_ZYFKKjXCd2jLHN4xSsG1j-b6FGDV2HsZ_C1d52fNGiygUVKuOk6xi77tWW0ZIE36xUa84gK4dNtmCZYOdVDKsDHE5B6EywuKcgyImSADonAQ/s1600/Cgroup.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;413&quot; data-original-width=&quot;725&quot; height=&quot;364&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmRiKiCAd3hdJQ4QlqeOSPQQrDsnPBYI_ZYFKKjXCd2jLHN4xSsG1j-b6FGDV2HsZ_C1d52fNGiygUVKuOk6xi77tWW0ZIE36xUa84gK4dNtmCZYOdVDKsDHE5B6EywuKcgyImSADonAQ/s640/Cgroup.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsrlyRG3OYNW2ztpY5rcDQgVZW6ob8piZDFU64h1gd8u7gCnHkzKAdtE-5MHUq5m_HnBj6-2G2rGvGJMptyJakkrRvse4za9AHcgehl2w9UVtJUucv-d9DiiEl56EhTEPklfmjhWgnevE/s1600/OG.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;375&quot; data-original-width=&quot;729&quot; height=&quot;328&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsrlyRG3OYNW2ztpY5rcDQgVZW6ob8piZDFU64h1gd8u7gCnHkzKAdtE-5MHUq5m_HnBj6-2G2rGvGJMptyJakkrRvse4za9AHcgehl2w9UVtJUucv-d9DiiEl56EhTEPklfmjhWgnevE/s640/OG.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;MATLAB
CODE:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;%INITIALIZE THE VARIABLES&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;Con=0;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;Diss=0;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;Hom=0;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;Asm=0;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;Meanx=0;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;Meany=0;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;Varx=0;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;Vary=0;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;GLCMCorrelation=0;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;%NORMALIZATION&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;GProb = glcm./sum(glcm(:));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt; i = 1:size(glcm,1)&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt; j = 1:size(glcm,2)&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ij = (i-j);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Con = Con +(GProb(i,j).*(ij).^2);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Diss = Diss +(GProb(i,j).*abs(ij));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hom = Hom +(GProb(i,j)/(1 + ij * ij));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Asm = Asm+(GProb(i,j).^2);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Meanx = Meanx + (GProb(i,j)*i);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Meany = Meany + (GProb(i,j)*j);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;Energy = sqrt(Asm);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;MaxGLCM = max(GProb(:));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;Entropy = sum(-GProb .*
log10(GProb+0.00001));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;CG=sprintf(&lt;/span&gt;&lt;span style=&quot;color: #a020f0; font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&quot;Contrast Group:\nContrast:%f\nDissimilarity:%f\nHomogeneity:%f\n&quot;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;,Con,Diss,Hom);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;OG=sprintf(&lt;/span&gt;&lt;span style=&quot;color: #a020f0; font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&quot;Orderliness Group:\nAngular Second Moment :%f\nMax Probability:%f\nEntropy:%f\nEnergy:%f\n&quot;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;,Asm,MaxGLCM,Entropy,Energy);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;display(CG);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;display(OG);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzXsmgQKbFjG935sORRphQsl2ZqWebh0tuBTohrVmeJ3Bi3w86VU_Bc5D_B8_jkx2D_mPe83pgLM_6YuwisgmVYjZ7YHcjRbEjH6M4hANd9Zr6MgcYd_BJ5GD6iJxxs655BOLQMc87py0/s1600/SGroup.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;610&quot; data-original-width=&quot;691&quot; height=&quot;564&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzXsmgQKbFjG935sORRphQsl2ZqWebh0tuBTohrVmeJ3Bi3w86VU_Bc5D_B8_jkx2D_mPe83pgLM_6YuwisgmVYjZ7YHcjRbEjH6M4hANd9Zr6MgcYd_BJ5GD6iJxxs655BOLQMc87py0/s640/SGroup.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14pt; line-height: 19.9733px;&quot;&gt;MATLAB CODE:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14pt; line-height: 19.9733px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;GLCMMean = (Meanx+Meany)/2;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;%COMPUTE VARIANCE&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt; i = 1:size(glcm,1)&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt; j = 1:size(glcm,2)&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Varx = Varx+(GProb(i,j)*(i-Meanx).^2);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Vary = Vary+(GProb(i,j)*(j-Meany).^2);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;GLCMVar = (Varx+Vary)/2; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;%COMPUTE CORRELATION&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt; i = 1:size(glcm,1)&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt; j = 1:size(glcm,2)&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GLCMCorrelation = GLCMCorrelation
+(GProb(i,j)*(i-Meanx)*(j-Meany)/sqrt(Varx*Vary));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;SG=sprintf(&lt;/span&gt;&lt;span style=&quot;color: #a020f0; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;&quot;Statistics
Group:\nGLCM Mean:%f\nGLCM Variance:%f\nGLCM Correlation:%f\n&quot;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;,GLCMMean,GLCMVar,GLCMCorrelation);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;display(SG);&lt;/span&gt;&lt;span style=&quot;text-align: center;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;EXPLANATION:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;The above listed measures are computed on the
normalized GLCM matrix. &lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;MATLAB
CODE:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;A = imread(&lt;/span&gt;&lt;span style=&quot;color: #a020f0; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;&#39;cameraman.tif&#39;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;%OFFSET AND DIRECTION&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;Displacementx = -1;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;Displacementy = 1;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;As = (A-min(A(:)))+1;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;NumQuantLevels = max(As(:));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;glcm =
zeros([NumQuantLevels,NumQuantLevels]);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt; ( Displacementx &amp;lt; 0 )&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;sx=abs(Displacementx)+1;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ex=size(As,1);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;sx=1;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ex=size(As,1)-Displacementx;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt; ( Displacementy &amp;lt; 0 )&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;sy=abs(Displacementy)+1;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ey=size(As,2);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;sy=1;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ey =size(As,2)-Displacementy;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt; i=sx:ex&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt; j=sy:ey&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;glcm(As(i,j),As(i+(1*Displacementx),j+(1*Displacementy)))=glcm(As(i,j),As(i+(1*Displacementx),j+(1*Displacementy)))+1;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;GLCMProb = glcm./sum(glcm(:));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;[jj,ii]=meshgrid(1:size(glcm,1),1:size(glcm,2));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;ij=ii-jj;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;Con =
sum(sum(GLCMProb.*(ij).^2));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;Diss =
sum(sum(GLCMProb.*abs(ij)));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;Hom =
sum(sum(GLCMProb./(1+(ij).^2)));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;Asm = sum(sum(GLCMProb.^2));&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;Meanx =
sum(sum(GLCMProb.*ii));&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;Meany = sum(sum(GLCMProb.*jj));&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;Energy = sqrt(Asm);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;MaxGLCM = max(GLCMProb(:));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;Entropy = sum(sum(-GLCMProb .*
log10(GLCMProb+0.00001)));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;GLCMMean = (Meanx+Meany)/2;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;Varx =
sum(sum(GLCMProb.*(ii-Meanx).^2));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;Vary =
sum(sum(GLCMProb.*(jj-Meany).^2));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;GLCMVar = (Varx+Vary)/2;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;GLCMCorrelation =
sum(sum(GLCMProb.*(ii-Meanx).*(jj-Meany)/sqrt(Varx*Vary)));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;CG=sprintf(&lt;/span&gt;&lt;span style=&quot;color: #a020f0; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;&quot;Contrast
Group:\nContrast:%f\nDissimilarity:%f\nHomogeneity:%f\n&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;,Con,Diss,Hom);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;OG=sprintf(&lt;/span&gt;&lt;span style=&quot;color: #a020f0; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;&quot;Orderliness
Group:\nAngular Second Moment :%f\nMax
Probability:%f\nEntropy:%f\nEnergy:%f\n&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;,Asm,MaxGLCM,Entropy,Energy);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;SG=sprintf(&lt;/span&gt;&lt;span style=&quot;color: #a020f0; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;&quot;Statistics
Group:\nGLCM Mean:%f\nGLCM Variance:%f\nGLCM Correlation:%f\n&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;,GLCMMean,GLCMVar,GLCMCorrelation);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;display(CG);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;display(OG);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;display(SG);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiNDLMrclkG3oXmT8TeGtFATNtyd9kghqPMua65kMFFld-kOenv9SO9y7LhSrt_rbJtDA6mwhgoBkU-aniA0gxo5jsgk-RJ5_RpHfG2koQNRFsfrhAAOjMG7IruATEFJutIANyEqwFYqM/s1600/matlab1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;643&quot; data-original-width=&quot;400&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiNDLMrclkG3oXmT8TeGtFATNtyd9kghqPMua65kMFFld-kOenv9SO9y7LhSrt_rbJtDA6mwhgoBkU-aniA0gxo5jsgk-RJ5_RpHfG2koQNRFsfrhAAOjMG7IruATEFJutIANyEqwFYqM/s640/matlab1.PNG&quot; width=&quot;396&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;EXPLANATION:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;The above code works also for the diagonal directions.
&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;In this example, the diagonal direction
45 is considered with displacement of 1 pixel. The minimum value of the chosen example
image, ‘cameraman.tif’ is 7 and maximum is 253 and it is scaled between 1 and
247. The quantization level is chosen as 247 so the GLCM matrix will be of size
247x247. &lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;NOTE:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;
&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: &amp;quot;symbol&amp;quot;; font-size: 14.0pt; line-height: 107%;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;Some
of the measures obtained will be different from the computing using ‘graycoprops’
in MATLAB due to some difference in the equations adopted. For more reference,
cross check with the MATLAB documentation&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMAf4v2Q8NaZnXBMxU3mjk_Bo4Ou5zmkL7H70Upl6Qu89b7y7KrFn_q6pLC9euYrkqjSmBWmiyq6QxVLxoTaOSqGMRICPy6SZsNV_qUvDkt3lMGtLcrh18DogN9zS-2Bcnnv4u9F7mG_4/s1600/matlab2.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;251&quot; data-original-width=&quot;303&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMAf4v2Q8NaZnXBMxU3mjk_Bo4Ou5zmkL7H70Upl6Qu89b7y7KrFn_q6pLC9euYrkqjSmBWmiyq6QxVLxoTaOSqGMRICPy6SZsNV_qUvDkt3lMGtLcrh18DogN9zS-2Bcnnv4u9F7mG_4/s1600/matlab2.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;
&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: &amp;quot;symbol&amp;quot;; font-size: 14.0pt; line-height: 107%;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;The
input image or matrix is scaled between 1 and the maximum pixel value of the image.
And the Quantization level is set based on it. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://www.imageeprocessing.com/feeds/8679547095409350692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.imageeprocessing.com/2019/04/texture-measures-from-glcm-matlab-code.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6714775518593018180/posts/default/8679547095409350692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714775518593018180/posts/default/8679547095409350692'/><link rel='alternate' type='text/html' href='http://www.imageeprocessing.com/2019/04/texture-measures-from-glcm-matlab-code.html' title='Texture Measures from GLCM – MATLAB CODE'/><author><name>Aaron Angel</name><uri>http://www.blogger.com/profile/02358906964252196081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgirLgdbfLRDpPYjYn1-diL1GZ6uIQvGkBN4BnbSDwEwDB3VWjH06_dsu_5OTB3dEzItQaNNrlMr_pzueWE01Rbbs6H40ZQ0hJbL8v01TEP09oRCNsXPsDloG5QDO5SvG0/s220/angel.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdhL93daLHTYvL0S-dfkwCx8ol3nNYKb0N-qk0AIRegurSirNKahiXfCSm25ubszbItJWOsNPjXQ4FF-sBprG8ycQK2bwJajTnF7T5X4LKj2dNoJEAx1VRrkRyhhoL8PSXxu2jnbTVVLM/s72-c/GLCM_mat.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6714775518593018180.post-2049488657516209320</id><published>2019-04-27T22:53:00.000+05:30</published><updated>2019-04-28T00:30:13.452+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="GLCM"/><category scheme="http://www.blogger.com/atom/ns#" term="Textures"/><title type='text'>Grey Level Co-occurrence Matrix (GLCM) in MATLAB</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;Let’s see in these series
of posts on how to extract the texture features from Grey Level Co-occurrence Matrix
(GLCM) in MATLAB.&amp;nbsp; In simple terms, GLCM gives
the spatial relationship between adjacent or neighbouring pixels. And from this
GLCM Matrix, we will measure some texture features.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;Let’s consider a simple
example and start coding the steps in terms of algorithmic as well as
programming in MATLAB. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;Procedure
to Generate GLCM Matrix:&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB93qN1PeWs1p5Df_ptynUxlAr_AeolbKN1YnTH9jXUbHgkWZIkreRYcTeMfDBCsuF1lo-To4FMIBUOGxR1RJ8N1WzpOoOQJBS_7_FU6Yb1qxQbRaWdKJqFJI9VXTfwXynNO7gGIOIOWY/s1600/Generate_GLCM01.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;839&quot; data-original-width=&quot;860&quot; height=&quot;624&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB93qN1PeWs1p5Df_ptynUxlAr_AeolbKN1YnTH9jXUbHgkWZIkreRYcTeMfDBCsuF1lo-To4FMIBUOGxR1RJ8N1WzpOoOQJBS_7_FU6Yb1qxQbRaWdKJqFJI9VXTfwXynNO7gGIOIOWY/s640/Generate_GLCM01.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_g1e3aZkeDD9WBbVfTbQpuJyW9io3urN9-iPANYWSrOdss1yxD9zRuc_U1cZ8vUTGErX2kgMsRqrfe9h6xZDEnBt_5qIS13CHYx6HirfNXPaE29Sqfgxi18w91cwSyfQFs0omzmmSaE/s1600/Generate_GLCM02.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;888&quot; data-original-width=&quot;864&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_g1e3aZkeDD9WBbVfTbQpuJyW9io3urN9-iPANYWSrOdss1yxD9zRuc_U1cZ8vUTGErX2kgMsRqrfe9h6xZDEnBt_5qIS13CHYx6HirfNXPaE29Sqfgxi18w91cwSyfQFs0omzmmSaE/s640/Generate_GLCM02.PNG&quot; width=&quot;622&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEil-jPpyF0AqlEA4HUKNg8F4wURLDtrzHmDvpN8LSi7w_RjFe1GBgldNHX-vqH7KHGIu1vfFtU2Y0HtPjjJzI-6NpI_QSrvmqkKe31uK81107BmuPSHfC6x2vPx57GpW1KT1CqNwmHXgZI/s1600/Generate_GLCM03.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;620&quot; data-original-width=&quot;838&quot; height=&quot;472&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEil-jPpyF0AqlEA4HUKNg8F4wURLDtrzHmDvpN8LSi7w_RjFe1GBgldNHX-vqH7KHGIu1vfFtU2Y0HtPjjJzI-6NpI_QSrvmqkKe31uK81107BmuPSHfC6x2vPx57GpW1KT1CqNwmHXgZI/s640/Generate_GLCM03.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipDgfCi7DJoYPCgAU-cE4R_vBekL6pgOqn6ttiJJsizaruWC2kAKi3LzIBQbaVsBJbwmgE5m1f4nTHuwtPjnQ-OxOiPWQbrGFR0T8DmdJzj1zIAv_0K6mNO0KrwucFklHVASPyngbrLAo/s1600/Generate_GLCM05.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;855&quot; data-original-width=&quot;853&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipDgfCi7DJoYPCgAU-cE4R_vBekL6pgOqn6ttiJJsizaruWC2kAKi3LzIBQbaVsBJbwmgE5m1f4nTHuwtPjnQ-OxOiPWQbrGFR0T8DmdJzj1zIAv_0K6mNO0KrwucFklHVASPyngbrLAo/s640/Generate_GLCM05.PNG&quot; width=&quot;638&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 12.0pt; line-height: 107%;&quot;&gt;MATLAB
CODE:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;clear &lt;/span&gt;&lt;span style=&quot;color: #a020f0; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;all&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;%GLCM MATRIX&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;A=[1 2 3 2 3; 1 2 3 4 5; 4 4 1 1
4; 6 7 6 7 6; 1 8 1 8 8];&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;Displacement = 1; &lt;/span&gt;&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;%NUMBER OF
STEPS BETWEEN TWO PIXELS&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;NumQuantLevels = 8; &lt;/span&gt;&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;%QUANTIZATION
LEVEL&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;glcm =
zeros([NumQuantLevels,NumQuantLevels]); &lt;/span&gt;&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;%PREALLOCATE GLCM MATRIX&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt; i = 1:size(A,1)&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt; j = 1 :size(A,2)-1&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; glcm(A(i,j),A(i,j+1))=glcm(A(i,j),A(i,j+1))+1;
&lt;/span&gt;&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;%INCREMENT
BY 1&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;courier new&amp;quot;; font-size: 13.0pt;&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;EXPLANATION:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;The number of occurrences
of a pixel and its neighboring pixel is calculated. The offset is 1 and it can
be incremented based on the requirement. Here the direction of the pixel
movement is towards the right. The maximum value of the pixel in the matrix A
is 8 so the quantization level is fixed to 8. For instance, in the example
given above, the pixel 2 and its neighbor 3 occurs 3 times in matrix A and it
is updated in the GLCM matrix at the position (2,3) as 3.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-size: large;&quot;&gt;Continue Reading: &lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;a href=&quot;https://www.imageeprocessing.com/2019/04/texture-measures-from-glcm-matlab-code.html&quot;&gt;Texture Measures from GLCM - MATLAB CODE&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;h3 class=&quot;post-title entry-title&quot; style=&quot;background-color: white; color: #3778cd; font-family: &amp;quot;Times New Roman&amp;quot;, Times, FreeSerif, serif; font-size: 22px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px; position: relative; text-align: start;&quot;&gt;
&lt;br /&gt;&lt;/h3&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://www.imageeprocessing.com/feeds/2049488657516209320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.imageeprocessing.com/2019/04/grey-level-co-occurrence-matrix-glcm-in.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6714775518593018180/posts/default/2049488657516209320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714775518593018180/posts/default/2049488657516209320'/><link rel='alternate' type='text/html' href='http://www.imageeprocessing.com/2019/04/grey-level-co-occurrence-matrix-glcm-in.html' title='Grey Level Co-occurrence Matrix (GLCM) in MATLAB'/><author><name>Aaron Angel</name><uri>http://www.blogger.com/profile/02358906964252196081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgirLgdbfLRDpPYjYn1-diL1GZ6uIQvGkBN4BnbSDwEwDB3VWjH06_dsu_5OTB3dEzItQaNNrlMr_pzueWE01Rbbs6H40ZQ0hJbL8v01TEP09oRCNsXPsDloG5QDO5SvG0/s220/angel.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB93qN1PeWs1p5Df_ptynUxlAr_AeolbKN1YnTH9jXUbHgkWZIkreRYcTeMfDBCsuF1lo-To4FMIBUOGxR1RJ8N1WzpOoOQJBS_7_FU6Yb1qxQbRaWdKJqFJI9VXTfwXynNO7gGIOIOWY/s72-c/Generate_GLCM01.PNG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6714775518593018180.post-8254262697034826528</id><published>2018-06-29T23:23:00.003+05:30</published><updated>2018-06-29T23:23:32.291+05:30</updated><title type='text'>RGB Image clustering using Mahalanobis distance</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;The Mahalanobis distance
classification is&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 18.6667px;&quot;&gt;widely&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 14pt;&quot;&gt;used in clustering. The equation has a covariance
matrix that works on the variation of the classes to create similarity.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;In Matlab, we have the
function ‘mahal’ that can calculate the distance between a point and a sample
subset.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;Let’s use the Mahal()
function to cluster a RGB image,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;Let’s make four clusters,
for the image ‘flower8.jpg’ based on the colors(ie. RGB components).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;Take a small subset of the
yellow color flower as shown in the picture.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUQCa_E5LD_HHTRoICe9BLTYl3EOqmUm1cEUvSvuzuixQXG2ffAnJzQDRfo71YjDxEA1z0_qKrIw366KDVOmVwRi7IQcK4lUzbLmPUgzuQ87SfMV-Tgg2j9Hzm3JMwxETVYuo66QIBwEA/s1600/colors_yellow.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;676&quot; data-original-width=&quot;990&quot; height=&quot;218&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUQCa_E5LD_HHTRoICe9BLTYl3EOqmUm1cEUvSvuzuixQXG2ffAnJzQDRfo71YjDxEA1z0_qKrIw366KDVOmVwRi7IQcK4lUzbLmPUgzuQ87SfMV-Tgg2j9Hzm3JMwxETVYuo66QIBwEA/s320/colors_yellow.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;We will use the Red,
Green and Blue components of this subset as the sample. The mean and the
covariance of this subset is calculated.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;Now the distance of each
pixels in the image is computed from the sample subset.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;The figure below shows the
distance of each pixels in the image computed from the subset(yellow color).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9SzGYYAxmSxAohysySEMzAf848RsG7izkZXHswu6KWUdN6884T0y3huJBF3GSejNMCj2s0MWHeScEvheCEveIgOXqNp5MlzVxxctDDLgfjo6xqlH5MMCOg9CoYNffz-Xou0_P3qk6p18/s1600/mahal_yellow.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;525&quot; data-original-width=&quot;700&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9SzGYYAxmSxAohysySEMzAf848RsG7izkZXHswu6KWUdN6884T0y3huJBF3GSejNMCj2s0MWHeScEvheCEveIgOXqNp5MlzVxxctDDLgfjo6xqlH5MMCOg9CoYNffz-Xou0_P3qk6p18/s320/mahal_yellow.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;Note that the distance is
minimal for the yellow color and it is high for other colors.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;Likewise, the subset of
the blue and pink color is also considered as samples and the computation is
done accordingly.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;The minimum distance with
respect to the subsets is generated and the corresponding pixel position is
updated with a unique cluster number.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 16.0pt; line-height: 107%;&quot;&gt;MATLAB CODE:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;clear &lt;/span&gt;&lt;span style=&quot;color: #a020f0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;all&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;clc&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%READ AN RGB IMAGE&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;A = imread(&lt;/span&gt;&lt;span style=&quot;color: #a020f0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;&#39;flower8.jpg&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;R = A(:,:,1); &lt;/span&gt;&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%RED
COMPONENT&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;G = A(:,:,2); &lt;/span&gt;&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%GREEN
COMPONENT&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;B = A(:,:,3); &lt;/span&gt;&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%BLUE
COMPONENT&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%PREALLOCATE THE VECTOR&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;mahal_dist&amp;nbsp; = zeros([numel(B),4]);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%CROP THE SMALL SUBSET OF
THE YELLOW FLOWER&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;A1 = imcrop(A,[824.5 203.5 33
22]);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;subset_R = A1(:,:,1); &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;subset_G = A1(:,:,2);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;subset_B = A1(:,:,3);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%CALCULATE MAHALANOBIS
DISTANCE FOR THE RED, BLUE AND GREEN COMPONENTS OF THE WHOLE IMAGE AND ALSO THE&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%RED,GREEN AND BLUE
COMPONENTS OF THE SMALL SUBSET&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;mahal_dist(:,1) =
mahal(double([R(:),G(:),B(:)]),double([subset_R(:),subset_G(:),subset_B(:)])); &lt;/span&gt;&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%Yellow&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%CROP THE SMALL SUBSET OF
THE BLUE FLOWER&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;A1 = imcrop(A,[449.5 44.5 49
33]);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;subset_R = A1(:,:,1);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;subset_G = A1(:,:,2);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;subset_B = A1(:,:,3);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;mahal_dist(:,2) =
mahal(double([R(:),G(:),B(:)]),double([subset_R(:),subset_G(:),subset_B(:)])); &lt;/span&gt;&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%Blue&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%CROP THE SMALL PORTION OF
THE PINK FLOWER&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;A1 = imcrop(A,[765.5 243.5 60
50]);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;subset_R = A1(:,:,1);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;subset_G = A1(:,:,2);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;subset_B = A1(:,:,3);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%CALCULATE MAHALANOBIS
DISTANCE FOR THE RED, BLUE AND GREEN COMPONENTS OF THE WHOLE IMAGE AND ALSO THE&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%RED,GREEN AND BLUE
COMPONENTS OF THE SMALL SUBSET&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;mahal_dist(:,3) =
mahal(double([R(:),G(:),B(:)]),double([subset_R(:),subset_G(:),subset_B(:)])); &lt;/span&gt;&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%Pink&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%CROP THE SMALL SUBSET OF
THE OTHER PARTS &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;A1 = imcrop(A,[505.5 389.5 49
33]);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;subset_R = A1(:,:,1);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;subset_G = A1(:,:,2);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;subset_B = A1(:,:,3);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%CALCULATE MAHALANOBIS
DISTANCE FOR THE RED, BLUE AND GREEN COMPONENTS OF THE WHOLE IMAGE AND ALSO THE&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%RED,GREEN AND BLUE
COMPONENTS OF THE SMALL SUBSET&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;mahal_dist(:,4) =
mahal(double([R(:),G(:),B(:)]),double([subset_R(:),subset_G(:),subset_B(:)])); &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: forestgreen; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;%FIND THE MINIMUM VALUE AND GIVE A CLUSTER NUMBER&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;[val,ind]=min(mahal_dist,[],2);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;mask = zeros(size(B));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt; k=1:size(mahal_dist,2)&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mask(ind(:)==k)=k;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;figure, subplot(121),imagesc(A);
title(&lt;/span&gt;&lt;span style=&quot;color: #a020f0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;&#39;RGB IMAGE&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;);
subplot(122),imagesc(mask);colormap(jet);colorbar;title(&lt;/span&gt;&lt;span style=&quot;color: #a020f0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;&#39;CLUSTERS&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgP_OznUFv3qeFkoYjGaysWFVuBPyM3pqdogP8-PbEEuBbryWClxOb2cD9XIclL_iNMnwHLnQiVMITxCOi_WXxz_Y3xWH2eddJwqmleGByUuEovHdKpXDgN48L_HXIOEm7BqkuTyv3WyEI/s1600/RGB_CLUSTER.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;835&quot; data-original-width=&quot;1540&quot; height=&quot;345&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgP_OznUFv3qeFkoYjGaysWFVuBPyM3pqdogP8-PbEEuBbryWClxOb2cD9XIclL_iNMnwHLnQiVMITxCOi_WXxz_Y3xWH2eddJwqmleGByUuEovHdKpXDgN48L_HXIOEm7BqkuTyv3WyEI/s640/RGB_CLUSTER.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;figure,&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt; k=1:size(mahal_dist,2)&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; subplot(2,2,k);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; imshow(uint8(double(A).*logical(mask==k)));&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.0pt;&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaC-3lS0lvVohaATM5nts_Vn0OESVudtWIBzPVaqdxjDKqdLYvJUk_dPNRdKRXO8AaA1euu0PYvW0ViPw0rfAhKFW6q-4KLFEQfAJcnUOUv37qKY-Mw2CAF065r1bSbehqS_qMg4HpouM/s1600/clusters_mahalanobis.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;777&quot; data-original-width=&quot;1278&quot; height=&quot;388&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaC-3lS0lvVohaATM5nts_Vn0OESVudtWIBzPVaqdxjDKqdLYvJUk_dPNRdKRXO8AaA1euu0PYvW0ViPw0rfAhKFW6q-4KLFEQfAJcnUOUv37qKY-Mw2CAF065r1bSbehqS_qMg4HpouM/s640/clusters_mahalanobis.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 14.0pt; line-height: 107%;&quot;&gt;&amp;nbsp;You can also
revisit ‘&lt;a href=&quot;http://www.imageeprocessing.com/2017/12/k-means-clustering-on-rgb-image.html&quot;&gt;K_means Clustering for RGB image&lt;/a&gt;’ and compare both the methods.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://www.imageeprocessing.com/feeds/8254262697034826528/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.imageeprocessing.com/2018/06/rgb-image-clustering-using-mahalanobis.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6714775518593018180/posts/default/8254262697034826528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6714775518593018180/posts/default/8254262697034826528'/><link rel='alternate' type='text/html' href='http://www.imageeprocessing.com/2018/06/rgb-image-clustering-using-mahalanobis.html' title='RGB Image clustering using Mahalanobis distance'/><author><name>Aaron Angel</name><uri>http://www.blogger.com/profile/02358906964252196081</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgirLgdbfLRDpPYjYn1-diL1GZ6uIQvGkBN4BnbSDwEwDB3VWjH06_dsu_5OTB3dEzItQaNNrlMr_pzueWE01Rbbs6H40ZQ0hJbL8v01TEP09oRCNsXPsDloG5QDO5SvG0/s220/angel.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUQCa_E5LD_HHTRoICe9BLTYl3EOqmUm1cEUvSvuzuixQXG2ffAnJzQDRfo71YjDxEA1z0_qKrIw366KDVOmVwRi7IQcK4lUzbLmPUgzuQ87SfMV-Tgg2j9Hzm3JMwxETVYuo66QIBwEA/s72-c/colors_yellow.jpg" height="72" width="72"/><thr:total>0</thr:total></entry></feed>