<?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-2748687604404631686</id><updated>2024-10-09T10:30:08.958+08:00</updated><category term="dilate"/><category term="erode"/><category term="area estimation"/><category term="blob"/><category term="close"/><category term="convolution"/><category term="fft2()"/><category term="open"/><category term="pattern recognition"/><category term="scilab"/><category term="sivp toolbox"/><category term="ANN toolbox"/><category term="Bayes theorem"/><category term="CDF"/><category term="FFT"/><category term="FT"/><category term="GIMP"/><category term="Green&#39;s Theorem"/><category term="LDA"/><category term="NCC"/><category term="PDF"/><category term="Principal Component Analysis"/><category term="Twinkle Twinkle Little Star"/><category term="UP Diliman"/><category term="area histogram"/><category term="artificial neutral network"/><category term="atomsInstall"/><category term="cancer cells"/><category term="color segmentation"/><category term="correlation"/><category term="digital scanning"/><category term="eigenvalues"/><category term="feature vector"/><category term="fftshift()"/><category term="filter"/><category term="follow( )"/><category term="fourier transform"/><category term="fps"/><category term="frame rate"/><category term="histogram"/><category term="histogram manipulation"/><category term="image enhancement"/><category term="image format"/><category term="image type"/><category term="imagemagick"/><category term="imconv"/><category term="imcorrcoef()"/><category term="line removal"/><category term="linear discriminant analysis"/><category term="mean"/><category term="minimum distance classification"/><category term="mogrify"/><category term="musical score sheet"/><category term="non-parametric segmentation"/><category term="parametric segmentation"/><category term="pca"/><category term="ridge enhancement"/><category term="sing"/><category term="sip toolbox"/><category term="stdev"/><category term="tag cancer cells"/><category term="video processing"/><title type='text'>Scilab Playground</title><subtitle type='html'>Anything related to image processing using Scilab</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://anythingphysics.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://anythingphysics.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Jen-Jen Manuel</name><uri>http://www.blogger.com/profile/17781945162053242109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio7WYdtUaWDpY0vUR8rmhXb6vLXc_NJhfW7210lMlbkFxjcoaf31CZ38KIuNSzomRZXPSXX9zYuME75wQBlwP99KltNLXSivQIMcdocBxzVUhe4t36aIu_krVWKUOErA4/s220/49936_1530407762_2876926_n.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2748687604404631686.post-7331222132890988451</id><published>2011-10-14T03:41:00.000+08:00</published><updated>2011-10-14T03:42:07.363+08:00</updated><title type='text'>Sayonara AP 186!</title><content type='html'>&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKJWsFUuHqCkhMompEoIsFcVQ7Nvu16pBjJROmDe__FQgFd2O-F5AXr5K-XRcl_CoGNR2nd8FOgJHGCCrGhSEr_VwFkSBhrz33F3snV833DBat4eamAdZ_N1mPD0pYIiDlDHbPaZgaFFoT/s1600/1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;369&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKJWsFUuHqCkhMompEoIsFcVQ7Nvu16pBjJROmDe__FQgFd2O-F5AXr5K-XRcl_CoGNR2nd8FOgJHGCCrGhSEr_VwFkSBhrz33F3snV833DBat4eamAdZ_N1mPD0pYIiDlDHbPaZgaFFoT/s640/1.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Created using Wordle.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://anythingphysics.blogspot.com/feeds/7331222132890988451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anythingphysics.blogspot.com/2011/10/sayonara-ap-186.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/7331222132890988451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/7331222132890988451'/><link rel='alternate' type='text/html' href='http://anythingphysics.blogspot.com/2011/10/sayonara-ap-186.html' title='Sayonara AP 186!'/><author><name>Jen-Jen Manuel</name><uri>http://www.blogger.com/profile/17781945162053242109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio7WYdtUaWDpY0vUR8rmhXb6vLXc_NJhfW7210lMlbkFxjcoaf31CZ38KIuNSzomRZXPSXX9zYuME75wQBlwP99KltNLXSivQIMcdocBxzVUhe4t36aIu_krVWKUOErA4/s220/49936_1530407762_2876926_n.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKJWsFUuHqCkhMompEoIsFcVQ7Nvu16pBjJROmDe__FQgFd2O-F5AXr5K-XRcl_CoGNR2nd8FOgJHGCCrGhSEr_VwFkSBhrz33F3snV833DBat4eamAdZ_N1mPD0pYIiDlDHbPaZgaFFoT/s72-c/1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2748687604404631686.post-7710046181778628136</id><published>2011-10-14T03:21:00.000+08:00</published><updated>2011-10-14T03:22:17.438+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="fps"/><category scheme="http://www.blogger.com/atom/ns#" term="frame rate"/><category scheme="http://www.blogger.com/atom/ns#" term="video processing"/><title type='text'>Basic Video Processing</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
In this activity, we integrate all the techniques we have learned so far in image processing in order to perform video processing. A video can be considered as a series of images shown in rapid succession. The number of frames captured within a second depends on the frame rate of the camera used. For a camera with frame rate of 30&lt;i&gt;fps (frames per second)&lt;/i&gt;, 0.03 s is the interval between successive frames.&amp;nbsp;Thus, image processing can be applied on a video in order to extract necessary information from it. What is interesting in such investigation is the appearance of a variable &lt;i&gt;t&lt;/i&gt;, i.e., time,&amp;nbsp;which is important in the dynamics of a certain system.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Shown below is a video of a Christmas ball swinging in pendulum-like motion. We aim to track the position (&lt;i&gt;x&lt;/i&gt;, &lt;i&gt;y&lt;/i&gt;) of the ball (in pixel coordinates) in the whole duration of motion. This video contains 30 frames per second (30 fps).&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.blogger.com/video.g?token=AD6v5dznM-yLSCby-eJ9ZYN65u3ydmoxJyGeTbGDXOAYuh5tvqUPVuHKHXMbOG2PvwfxO-Um5In5-8FOF8zMtlFs8A&#39; class=&#39;b-hbp-video b-uploaded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&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;
The image sequences are obtained using Virtual Dub. Each image is then processed in Scilab. Some of the results after processing the images are shown below.&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/AVvXsEgkvBU_uiFFvmvAygHytcc16GZlCi1gvFwQHsJ8Q1FRBG-01mAWqQGo6SczG6cMsLwkZTiQe0Q9bQJSzELZMCESpAklRWFr8leWt0-wRyGsiBCpNdRUE0Ff9oqRaH5ijv4oZ-P8gUPAtoRi/s1600/data.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;306&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkvBU_uiFFvmvAygHytcc16GZlCi1gvFwQHsJ8Q1FRBG-01mAWqQGo6SczG6cMsLwkZTiQe0Q9bQJSzELZMCESpAklRWFr8leWt0-wRyGsiBCpNdRUE0Ff9oqRaH5ijv4oZ-P8gUPAtoRi/s400/data.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
The ball is segmented from the background by finding the value in the histogram of each image that separates the background from region of interest. It is found by looking for the dip between two peaks which correspond to the region of interest and background. In this case, it is 0.2. The results of thresholding are shown above for frame nos. 5, 20, 50 and 35 in clockwise manner. What is done next is to find for the exact coordinates (&lt;i&gt;x&lt;/i&gt;, &lt;i&gt;y&lt;/i&gt;) of the center of the ball in each frame. In finding this, the center of mass of all pixels belonging to the ball is calculated. The image below shows the location of the center of mass throughout the duration of motion. It somehow tells us about the trajectory of the ball.&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/AVvXsEgrQaVaYbzz9d30sG4h249J12nZB2II2Ihr6EwTA0ihFpeDXKzY3pnj2oju74Ku_mYpOVhvqXgHdtEm2hmEOdA8HYtv7_W18ynZ7-CrLbOjqPznE1aGqMjRE5Qfs3A5A_-SxnOK-8EcHNNs/s1600/xy.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;481&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrQaVaYbzz9d30sG4h249J12nZB2II2Ihr6EwTA0ihFpeDXKzY3pnj2oju74Ku_mYpOVhvqXgHdtEm2hmEOdA8HYtv7_W18ynZ7-CrLbOjqPznE1aGqMjRE5Qfs3A5A_-SxnOK-8EcHNNs/s640/xy.bmp&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Take note that the positions are in pixel coordinates wherein the origin is located at the uppermost left hand corner. Our world can be compared to the 4th quadrant in Cartesian coordinates system. Symmetry with respect to the &lt;i&gt;y&lt;/i&gt;-axis can be observed in the figure above. The right hand of the parabolic trajectory being longer is due to the ball being released at a high location in the beginning of its motion. &amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
In systems like this, it is important or interesting to look on the evolution of a certain variable with time &lt;i&gt;t&lt;/i&gt;. In the video shown, damped oscillation occurs. To characterize such behavior, we look on the plot of &lt;i&gt;x&lt;/i&gt;/&lt;i&gt;y&lt;/i&gt; versus frame no. (30 frames in a second) wherein 1 frame = 0.03s.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNTWuZYQWFYNisnM6YY98g2q3J8tsGtwEiFJJkQFWGlX5s1XaZDiLJh8wvKdLxjO3GZHzw8wQJUoAEh2HgEU4EGeoWDOO9FtUKCrn9DX5bo0WvypFJZjS4LkkU4rUuOw8bhkxtWOj4B45n/s1600/x+vs+t.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;481&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNTWuZYQWFYNisnM6YY98g2q3J8tsGtwEiFJJkQFWGlX5s1XaZDiLJh8wvKdLxjO3GZHzw8wQJUoAEh2HgEU4EGeoWDOO9FtUKCrn9DX5bo0WvypFJZjS4LkkU4rUuOw8bhkxtWOj4B45n/s640/x+vs+t.bmp&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Plot of &lt;i&gt;x&lt;/i&gt; versus frame no. (&lt;i&gt;t&lt;/i&gt;&amp;nbsp;= frame no. X 0.03s)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMX1BAkVXMB71Sqo5IqtXvrTIHgklmLsTSY0DVtV8_HRLQkdIWDfBnW94nLhT109oXAASvUIjt58jrSjsqMYUijtB70EKC0eaYC3L2Km6IL-lMnth2nhuyJ2Qmv2z7l0mtOXjq9shKWuCI/s1600/y+vs+t.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;481&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMX1BAkVXMB71Sqo5IqtXvrTIHgklmLsTSY0DVtV8_HRLQkdIWDfBnW94nLhT109oXAASvUIjt58jrSjsqMYUijtB70EKC0eaYC3L2Km6IL-lMnth2nhuyJ2Qmv2z7l0mtOXjq9shKWuCI/s640/y+vs+t.bmp&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Plot of&amp;nbsp;&lt;i&gt;y&lt;/i&gt;&amp;nbsp;versus frame no. (&lt;i&gt;t&lt;/i&gt;&amp;nbsp;= frame no. X 0.03s)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
The figures show that indeed the system investigated displays damped oscillation. We know that after sometime &lt;i&gt;t&lt;/i&gt;, the oscillation of the ball will stop due to some factors (e.g. frictional forces).&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
For this activity, I am giving myself a grade of 10. This is an easy yet interesting activity. Most of the time, information available are stored in videos.It is then a good thing to learn how to perform video processing.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Sayonara, AP 186!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anythingphysics.blogspot.com/feeds/7710046181778628136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anythingphysics.blogspot.com/2011/10/basic-video-processing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/7710046181778628136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/7710046181778628136'/><link rel='alternate' type='text/html' href='http://anythingphysics.blogspot.com/2011/10/basic-video-processing.html' title='Basic Video Processing'/><author><name>Jen-Jen Manuel</name><uri>http://www.blogger.com/profile/17781945162053242109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio7WYdtUaWDpY0vUR8rmhXb6vLXc_NJhfW7210lMlbkFxjcoaf31CZ38KIuNSzomRZXPSXX9zYuME75wQBlwP99KltNLXSivQIMcdocBxzVUhe4t36aIu_krVWKUOErA4/s220/49936_1530407762_2876926_n.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkvBU_uiFFvmvAygHytcc16GZlCi1gvFwQHsJ8Q1FRBG-01mAWqQGo6SczG6cMsLwkZTiQe0Q9bQJSzELZMCESpAklRWFr8leWt0-wRyGsiBCpNdRUE0Ff9oqRaH5ijv4oZ-P8gUPAtoRi/s72-c/data.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2748687604404631686.post-8691042622670276838</id><published>2011-09-28T14:05:00.001+08:00</published><updated>2011-09-28T14:13:33.246+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ANN toolbox"/><category scheme="http://www.blogger.com/atom/ns#" term="artificial neutral network"/><category scheme="http://www.blogger.com/atom/ns#" term="pattern recognition"/><title type='text'>Neural Networks</title><content type='html'>In this activity, we try using the artificial neural network or ANN toolbox for Scilab in object classification. A neural network is a computational model of how the neurons in our brain work. This is an alternative to linear discriminant analysis or LDA in pattern recognition. In neural network, a pattern is &lt;i&gt;learned&lt;/i&gt; through example. The learning process may take some time but once a pattern is learned, a faster recognition process is expected. &lt;br /&gt;
&lt;br /&gt;
Below is an example of an artificial neuron modeled by McCulloch and Pitts in 1943. A neuron receives weighted inputs&amp;nbsp;&lt;i&gt;w&lt;sub&gt;i&lt;/sub&gt;&lt;/i&gt;&lt;i&gt;x&lt;sub&gt;i&lt;/sub&gt;&lt;/i&gt;&amp;nbsp; (where &lt;i&gt;i &lt;/i&gt;= 1, 2, 3 for the example shown below)&amp;nbsp;from other neurons. These weighted inputs are then added to yield &lt;i&gt;a &lt;/i&gt;and then acts on an activation function &lt;i&gt;g. &lt;/i&gt;The output &lt;i&gt;z &lt;/i&gt;is then fired to other neurons.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEict3rtTm3Ho09XSyJndwk6mfHwZ5LPRAqsl4cgnk_UK1b4CnRS9qM2iUczv8Db2QFIqiw6ev2fxcNG5VXeL-0jdssdw1U_6IltASPqQ93bgd1vKQkmJCBdOr_8fJBhoWrBRtGyVXV_-y5Q/s1600/Figure+1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;173&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEict3rtTm3Ho09XSyJndwk6mfHwZ5LPRAqsl4cgnk_UK1b4CnRS9qM2iUczv8Db2QFIqiw6ev2fxcNG5VXeL-0jdssdw1U_6IltASPqQ93bgd1vKQkmJCBdOr_8fJBhoWrBRtGyVXV_-y5Q/s320/Figure+1.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;An artificial neuron.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
A neural network is formed by connecting many neurons. An example of this is shown below. A typical neural network consists of 3 layers: input layer, hidden layer and output layer. The input layer can be a set of features extracted from the objects to be classified. The hidden layer then acts on such set and then passes the result to the output layer.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB01gYcxBGr4iAQkWB4nN1Ao4qkOeVFZ6TyeO2e62dU01mOy03z_oSZ19wjErcRAHaw044pCdwJ05Yt_3l9nEKHPg93HcyXGwJSsq2d3Zsp9xaBnntzGOQRAZUNyxZ-xZWf1NTXavfVBYB/s1600/Figure+2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;237&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB01gYcxBGr4iAQkWB4nN1Ao4qkOeVFZ6TyeO2e62dU01mOy03z_oSZ19wjErcRAHaw044pCdwJ05Yt_3l9nEKHPg93HcyXGwJSsq2d3Zsp9xaBnntzGOQRAZUNyxZ-xZWf1NTXavfVBYB/s320/Figure+2.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;A neural network.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
We are to utilize the ANN toolbox in object classification. There are two classes of objects, &lt;i&gt;A&lt;/i&gt; and &lt;i&gt;B&lt;/i&gt;, to be classified based on two features extracted. The code used is shown below. Take note that the input training matrix &lt;i&gt;x&lt;/i&gt; consists of 12 rows with 2 columns since there are 12 objects to be classified based on 2 features. The desired output &lt;i&gt;t&lt;/i&gt; represents the class of the object classified such that a value equal to 1 means class &lt;i&gt;A&lt;/i&gt; and a value equal to 0 means class &lt;i&gt;B&lt;/i&gt;. Take note that the values for both sets of features are normalized.&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/AVvXsEilgCnEId7DsFIN-gft7m_OHK2heb0ZjFOoso8oR5zZiGy63ZyF3Ar_WUiRkmk4HStBqNInzjphlIfYiTZ01RDKoLnAq1ZZ4uQwO6LVD34iA_43jb6ie0AtyOo70fwfmknF2bawy70giHmZ/s1600/code.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilgCnEId7DsFIN-gft7m_OHK2heb0ZjFOoso8oR5zZiGy63ZyF3Ar_WUiRkmk4HStBqNInzjphlIfYiTZ01RDKoLnAq1ZZ4uQwO6LVD34iA_43jb6ie0AtyOo70fwfmknF2bawy70giHmZ/s1600/code.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
The parameters learning rate and training cycles can be tweaked. The results for different combinations of values of learning rate and training cycles.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvyrt4uniZXYi4yTmDLEhJov7W_YYmmux9dnJe1f2yi_0Wl6esBEuFRb2APYYphMYZla9HlC6Y8JpR6jZht-DegWpIGldb199cFzG_9mz9OLsg2xvDTeMcPPFgfzz2FzGGdp1oyMnbbxfv/s1600/T+%253D+400+lp+%253D+%255B0.1%252C+0%255D.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;164&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvyrt4uniZXYi4yTmDLEhJov7W_YYmmux9dnJe1f2yi_0Wl6esBEuFRb2APYYphMYZla9HlC6Y8JpR6jZht-DegWpIGldb199cFzG_9mz9OLsg2xvDTeMcPPFgfzz2FzGGdp1oyMnbbxfv/s640/T+%253D+400+lp+%253D+%255B0.1%252C+0%255D.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;learning rate = [0.1, 0], T = 400&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpUUuv65PmmIbtH4vptpqs37KSwzPpVWdRkTlkO9eT35PGGaWdAT9U89lXmuue_Ts4VNIcteVku_cKCSxI7UmiqlGMH0Ta3MytQfKeRp04mAb1MrqCVywpJZQCAlWc9YLT7Hww96_Pbwtp/s1600/T+%253D+400+lp+%253D+%255B2.5%252C+0%255D.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;154&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpUUuv65PmmIbtH4vptpqs37KSwzPpVWdRkTlkO9eT35PGGaWdAT9U89lXmuue_Ts4VNIcteVku_cKCSxI7UmiqlGMH0Ta3MytQfKeRp04mAb1MrqCVywpJZQCAlWc9YLT7Hww96_Pbwtp/s640/T+%253D+400+lp+%253D+%255B2.5%252C+0%255D.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;learning rate = [2.5, 0], T = 400&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK3DJeedxgTAIZE9WTFoItdeU_Bp5rq6R3TaK1rswskCq5qVfakUTCJanbb2FqTrVuAnPQ_m8UnoipKmWSFh6yAQPNuomGdzjCSIpg_v_GZEezX-CEmFKdR2FNwKD0cB4vMIYeHnJ858l0/s1600/T+%253D+1000+lp+%253D+%255B0.1%252C+0%255D.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;154&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK3DJeedxgTAIZE9WTFoItdeU_Bp5rq6R3TaK1rswskCq5qVfakUTCJanbb2FqTrVuAnPQ_m8UnoipKmWSFh6yAQPNuomGdzjCSIpg_v_GZEezX-CEmFKdR2FNwKD0cB4vMIYeHnJ858l0/s640/T+%253D+1000+lp+%253D+%255B0.1%252C+0%255D.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;learning rate = [0.1, 0], T = 1000&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkqXD5q_iLuM9pLwsM67hOKBRtm6xmMfCR17XqEcBsUTehSd1ATEN6j7rOmR_fAkVate_buWrokf3SkghV30oNBbqFrhknXJI7bIllsY7VBjURRYR7eOyMqCQrqXfP3YXA2GU89Wr3CJ3F/s1600/T+%253D+1000+lp+%253D+%255B2.5%252C+0%255D.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;154&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkqXD5q_iLuM9pLwsM67hOKBRtm6xmMfCR17XqEcBsUTehSd1ATEN6j7rOmR_fAkVate_buWrokf3SkghV30oNBbqFrhknXJI7bIllsY7VBjURRYR7eOyMqCQrqXfP3YXA2GU89Wr3CJ3F/s640/T+%253D+1000+lp+%253D+%255B2.5%252C+0%255D.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;learning rate = [2.5, 0], T = 1000&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
It is obvious from the results shown that as the learning rate is increased, the more closer the obtained values for the output are. Also, increasing the number of training cycles results to values for the output that are closer to the desired ones. It turns out that the predictions neural network made are 100% accurate. Using ANN toolbox in classification is easier compared to using LDA for many reasons.&lt;br /&gt;
&lt;br /&gt;
This is again an easy activity. Thanks to&amp;nbsp;J. Tugaff &amp;nbsp;for the sample code which made the activity much easier. I am giving myself a grade of 10 for this one.</content><link rel='replies' type='application/atom+xml' href='http://anythingphysics.blogspot.com/feeds/8691042622670276838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anythingphysics.blogspot.com/2011/09/neural-networks.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/8691042622670276838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/8691042622670276838'/><link rel='alternate' type='text/html' href='http://anythingphysics.blogspot.com/2011/09/neural-networks.html' title='Neural Networks'/><author><name>Jen-Jen Manuel</name><uri>http://www.blogger.com/profile/17781945162053242109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio7WYdtUaWDpY0vUR8rmhXb6vLXc_NJhfW7210lMlbkFxjcoaf31CZ38KIuNSzomRZXPSXX9zYuME75wQBlwP99KltNLXSivQIMcdocBxzVUhe4t36aIu_krVWKUOErA4/s220/49936_1530407762_2876926_n.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEict3rtTm3Ho09XSyJndwk6mfHwZ5LPRAqsl4cgnk_UK1b4CnRS9qM2iUczv8Db2QFIqiw6ev2fxcNG5VXeL-0jdssdw1U_6IltASPqQ93bgd1vKQkmJCBdOr_8fJBhoWrBRtGyVXV_-y5Q/s72-c/Figure+1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2748687604404631686.post-7583999043763046685</id><published>2011-09-20T21:58:00.001+08:00</published><updated>2011-09-20T22:00:52.264+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Bayes theorem"/><category scheme="http://www.blogger.com/atom/ns#" term="LDA"/><category scheme="http://www.blogger.com/atom/ns#" term="linear discriminant analysis"/><title type='text'>Probabilistic Classification</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
This is a continuation of the previous &lt;a href=&quot;http://anythingphysics.blogspot.com/2011/09/pattern-recognition.html&quot;&gt;activity&lt;/a&gt;. Instead of using minimum distance classification in pattern recognition, another technique called linear discriminant analysis or LDA is used. Given a pattern &lt;b&gt;&lt;i&gt;x&lt;/i&gt;&lt;/b&gt;, the probability that it belongs to class&amp;nbsp;&lt;i&gt;ω&lt;sub&gt;k&lt;/sub&gt;&lt;/i&gt;&amp;nbsp;is given by &lt;i&gt;p&lt;/i&gt;(&lt;i&gt;ω&lt;sub&gt;k&amp;nbsp;&lt;/sub&gt;&lt;/i&gt;|&amp;nbsp;&lt;b&gt;&lt;i&gt;x&lt;/i&gt;&lt;/b&gt;). In the case wherein a classifier wrongly identifies&amp;nbsp;&lt;i style=&quot;font-weight: bold;&quot;&gt;x &lt;/i&gt;to be part of class&amp;nbsp;&lt;i&gt;ω&lt;sub&gt;j&lt;/sub&gt;&lt;/i&gt;&amp;nbsp;but actually belongs to&amp;nbsp;&lt;i&gt;ω&lt;sub&gt;k&lt;/sub&gt;&lt;/i&gt;, a penalty loss&amp;nbsp;&lt;i&gt;λ&lt;sub&gt;jk&lt;/sub&gt;&lt;/i&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;is acquired for such mistake.&lt;i&gt;&amp;nbsp;&lt;/i&gt;A loss matrix &lt;i&gt;L&lt;/i&gt; stores all these penalty terms&amp;nbsp;&lt;i&gt;λ&lt;sub&gt;jk&lt;/sub&gt;&lt;/i&gt;&amp;nbsp;at their corresponding indices (&lt;i&gt;k&lt;/i&gt;, &lt;i&gt;j&lt;/i&gt;). The aim here is to minimize the risk or loss in classification given by&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&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/AVvXsEhYUSGhZg2u6uwzyRaWnfvw3C4aFn5XHg9xzeeNC5nA1RqAK0V9BqB1yefK4SNF3XZG7JLPU_lq3XsoJfnbrmjyAXjwXjgPx76cN51IMJPqY8vOLAwLLIJTNWH1ouBUFXoWZfkTtH40ENrP/s1600/Eqn1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;80&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYUSGhZg2u6uwzyRaWnfvw3C4aFn5XHg9xzeeNC5nA1RqAK0V9BqB1yefK4SNF3XZG7JLPU_lq3XsoJfnbrmjyAXjwXjgPx76cN51IMJPqY8vOLAwLLIJTNWH1ouBUFXoWZfkTtH40ENrP/s200/Eqn1.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
In LDA, the main assumption is that classes or groups of objects are linearly separable, i.e., classes are separable by linear combination of the features of these objects. Also, what we are interested in is to find the class where a test object belongs to which is represented by a so-called dependent variable &lt;i&gt;y&lt;/i&gt;. On the other hand, the independent variable &lt;i&gt;x&lt;/i&gt; pertains to any quantifiable or measurable features of the object.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
In order to minimize the total error of classification or TEC, an object is assigned to a class with highest conditional probability. To do this, there is a need to find for the conditional probability &lt;i&gt;P&lt;/i&gt;(&lt;i&gt;i&lt;/i&gt;|&lt;i&gt;x&lt;/i&gt;) that an object having a set of features &lt;i&gt;x&lt;/i&gt; belongs to &lt;i&gt;i&lt;/i&gt;. But such conditional probability is difficult to find. What is readily available instead is the conditional probability&amp;nbsp;&lt;i&gt;P&lt;/i&gt;(&lt;i&gt;x&lt;/i&gt;|&lt;i&gt;i&lt;/i&gt;) that describes the chance of obtaining a set of features &lt;i&gt;x&lt;/i&gt; given that an object belongs to &lt;i&gt;i&lt;/i&gt;. Luckily, Bayes theorem relates these two conditional probabilities and is given below.&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/AVvXsEiOqv6-UT6TXTY8gPQD_68oQmneZo4zklPJVhtfAmyL466FRHde0Ggk8LncpaBRnL-J6Go7BYtZFZ5UQeU50g935CoTAzE5N6Ki2bnI63ILLi5MdWwpARitdSZb-ESV02qZUGk8QfAwaq-D/s1600/Eqn2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOqv6-UT6TXTY8gPQD_68oQmneZo4zklPJVhtfAmyL466FRHde0Ggk8LncpaBRnL-J6Go7BYtZFZ5UQeU50g935CoTAzE5N6Ki2bnI63ILLi5MdWwpARitdSZb-ESV02qZUGk8QfAwaq-D/s1600/Eqn2.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;i&gt;P&lt;/i&gt;(&lt;i&gt;i&lt;/i&gt;) is the probability about the group &lt;i&gt;i&lt;/i&gt;. In our case, &lt;i&gt;P&lt;/i&gt;(&lt;i&gt;i&lt;/i&gt;) is based on the number of samples for each group. However, it is not advisable to use Bayes rule directly for some reasons. But if we assume that each group has multivariate normal distribution and all groups have the same covariance matrix, a so-called linear discriminant analysis formula shown below can be used in the classification.&lt;br /&gt;
&lt;br /&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/AVvXsEg5bsMNkJIOe6WWfBCcc3REP0H38lPLFPYat4QkE-YQZi_H1AVu_WlwDcLzaxbAjkNgMui6x4OuOz9Ui_HIxWsS9lWr7Mr57Sa6DtmE0LzCTKVQyL1PXYlk-JJ1RVz33fX31wmu5pHhnKO-/s1600/Eqn3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5bsMNkJIOe6WWfBCcc3REP0H38lPLFPYat4QkE-YQZi_H1AVu_WlwDcLzaxbAjkNgMui6x4OuOz9Ui_HIxWsS9lWr7Mr57Sa6DtmE0LzCTKVQyL1PXYlk-JJ1RVz33fX31wmu5pHhnKO-/s1600/Eqn3.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
We assign an object with feature vector&amp;nbsp;&lt;i&gt;x&lt;sub&gt;k&amp;nbsp;&lt;/sub&gt;&lt;/i&gt;to class &lt;i&gt;i&lt;/i&gt; with maximum&amp;nbsp;&lt;i&gt;f&lt;sub&gt;i&lt;/sub&gt;&lt;/i&gt;. The table below is the result after applying LDA on two classes of objects.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAIVqW0bn_Gmdotf3S6qCxjEyOr-Nx78E8LzXAx0YeHolZKMxM0JElZ-Ny3YQBRGDEL9rscCg7gWIB9MORvQD1YSqdx1J01vd_cv7Spnij2_J8vCMGX1HtRN63PoyCFgVWCcypM-Yl-nfH/s1600/data.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAIVqW0bn_Gmdotf3S6qCxjEyOr-Nx78E8LzXAx0YeHolZKMxM0JElZ-Ny3YQBRGDEL9rscCg7gWIB9MORvQD1YSqdx1J01vd_cv7Spnij2_J8vCMGX1HtRN63PoyCFgVWCcypM-Yl-nfH/s1600/data.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
It is clear from the table above that the results of classification using LDA is 100% accurate, i.e., it was able to classify objects correctly.The training sets used are classes of Piattos chips and 1-peso coins.&lt;br /&gt;
&lt;br /&gt;
This activity is an easy one since no more image processing were to be done. Just plain computations. And I enjoyed doing this. I learned a lot from these activities on pattern recognition. And I am planning right now to have my project based on the concepts on pattern recognition. I am, therefore, giving myself a grade of 10 for a job well done. :-)</content><link rel='replies' type='application/atom+xml' href='http://anythingphysics.blogspot.com/feeds/7583999043763046685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anythingphysics.blogspot.com/2011/09/probabilistic-classification.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/7583999043763046685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/7583999043763046685'/><link rel='alternate' type='text/html' href='http://anythingphysics.blogspot.com/2011/09/probabilistic-classification.html' title='Probabilistic Classification'/><author><name>Jen-Jen Manuel</name><uri>http://www.blogger.com/profile/17781945162053242109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio7WYdtUaWDpY0vUR8rmhXb6vLXc_NJhfW7210lMlbkFxjcoaf31CZ38KIuNSzomRZXPSXX9zYuME75wQBlwP99KltNLXSivQIMcdocBxzVUhe4t36aIu_krVWKUOErA4/s220/49936_1530407762_2876926_n.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYUSGhZg2u6uwzyRaWnfvw3C4aFn5XHg9xzeeNC5nA1RqAK0V9BqB1yefK4SNF3XZG7JLPU_lq3XsoJfnbrmjyAXjwXjgPx76cN51IMJPqY8vOLAwLLIJTNWH1ouBUFXoWZfkTtH40ENrP/s72-c/Eqn1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2748687604404631686.post-1242296974377012709</id><published>2011-09-18T22:20:00.001+08:00</published><updated>2011-09-20T21:48:13.799+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="feature vector"/><category scheme="http://www.blogger.com/atom/ns#" term="minimum distance classification"/><category scheme="http://www.blogger.com/atom/ns#" term="pattern recognition"/><title type='text'>Pattern Recognition</title><content type='html'>Humans have the ability to sort and label things according to features based on previously observed examples. We learned from &lt;i&gt;experience&lt;/i&gt; that a circle is different from a square and that red is not equal to green. Computer vision aims to mimic such ability of the human brain in pattern recognition. A set of features defines a pattern. This set of features contains information such as size, color, shape, etc. It can be represented as a vector and is called a feature vector. A certain feature vector is unique for every class of objects. The tasks in pattern recognition is to determine the features for all classes to be classified and to come up with a classifier based on these features collected.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I assembled 3 classes of objects. Each class is divided into two sets namely training set and test set. The objects are shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZnHK5W-FbFib1u9SfQvMpTIcBMkDKMTfgfDZstzKNm0ErlrxmsumNqd_53SdSFkTmdFLGFeYeb6GRoQ19aeCSVZmBWfW5_GIeD-w9AnrFYnvrXuxRynicln7NSgp_QG6mGX_tSj0VZxlo/s1600/Objects.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZnHK5W-FbFib1u9SfQvMpTIcBMkDKMTfgfDZstzKNm0ErlrxmsumNqd_53SdSFkTmdFLGFeYeb6GRoQ19aeCSVZmBWfW5_GIeD-w9AnrFYnvrXuxRynicln7NSgp_QG6mGX_tSj0VZxlo/s1600/Objects.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Left: Training sets. Right: Test sets.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
The features are extracted from these classes, i.e., both training sets and test sets, to form unique feature vectors for the 3 classes. Each class has a set of training set feature vector and test set feature vector. The training set feature vectors are then used to compute for the class representatives &lt;i&gt;m&lt;sub&gt;j&lt;/sub&gt;&lt;/i&gt;. In minimum distance classification, the class representative&amp;nbsp;&lt;i&gt;m&lt;sub&gt;j&lt;/sub&gt;&lt;/i&gt;&amp;nbsp;of class&amp;nbsp;&lt;i&gt;ω&lt;sub&gt;j&lt;/sub&gt;&lt;/i&gt;&amp;nbsp;is calculated from the ensemble of training set feature vectors using the equation below and is also called the mean feature vector. This is done for each class of objects. &amp;nbsp;&lt;i&gt;N&lt;sub&gt;j&lt;/sub&gt;&lt;/i&gt;&amp;nbsp; is the total number of objects contained in the training set of class&amp;nbsp;&lt;i&gt;ω&lt;sub&gt;j&lt;/sub&gt;&lt;/i&gt;. The calculated class representatives&lt;i&gt;&amp;nbsp;&lt;/i&gt;are shown in the table below as highlighted values wherein each color represents a certain class of objects. Note that the mean feature vector contains only two elements, i.e., mean area and mean perimeter. Also shown below are the calculated mean test set feature vector for each class.&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/AVvXsEix6enN1LnefUIF13tvtzZzXagvGMKgehyphenhyphen8CCPlm57d_CV09QvK2c9-inT2CwtLKEpwvjyqdB-yaf9EFI3VcavtMyspW7O0Fzf21QY_cB4ecf8R-SiPNx0xTTd6-pj4lYfTC-13tQhDYiib/s1600/Eqn1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEix6enN1LnefUIF13tvtzZzXagvGMKgehyphenhyphen8CCPlm57d_CV09QvK2c9-inT2CwtLKEpwvjyqdB-yaf9EFI3VcavtMyspW7O0Fzf21QY_cB4ecf8R-SiPNx0xTTd6-pj4lYfTC-13tQhDYiib/s1600/Eqn1.png&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/AVvXsEi6D0MS_yr3O95PRCeRtCLXpAid_wSLkzJSqSgaCuY6_6AIwDcLPirGPvHdtPsrbzmtUO-kQpCOPY0XXJ1j0ZUVQGdI7assRjsBA23dCKXA2h8TIzPjE33WIn_8PlSdu5B6IAcsKHYbHVRV/s1600/Data.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6D0MS_yr3O95PRCeRtCLXpAid_wSLkzJSqSgaCuY6_6AIwDcLPirGPvHdtPsrbzmtUO-kQpCOPY0XXJ1j0ZUVQGdI7assRjsBA23dCKXA2h8TIzPjE33WIn_8PlSdu5B6IAcsKHYbHVRV/s1600/Data.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
The figure below is a plot of Perimeter versus Area in pixels. 3 clusters are evident in the plot below which correspond to the 3 classes of objects investigated, i.e., 1 peso coin, Piattos Chips and 5 peso coin.&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/AVvXsEhpJNnjvDqo23GqIV39MvIxWOPA34IAEz69Nf9MDo8PewlqbusJ_f9JLcLiPZff3pVeczQS0sPNk2XReFntSHkQageTirwu6Gtzyqvi_IjZoZ2DjOqoax8Paz1hHfJU29CVnG4v6Y45lJW2/s1600/Plot.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpJNnjvDqo23GqIV39MvIxWOPA34IAEz69Nf9MDo8PewlqbusJ_f9JLcLiPZff3pVeczQS0sPNk2XReFntSHkQageTirwu6Gtzyqvi_IjZoZ2DjOqoax8Paz1hHfJU29CVnG4v6Y45lJW2/s1600/Plot.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
We are now ready to classify the calculated test set feature vectors. This is done by finding the class wherein the test set feature vector &lt;i style=&quot;font-weight: bold;&quot;&gt;x &lt;/i&gt;is closest to. The equation below is utilized for this task. The membership of a test set is determined by finding the class wherein &lt;i&gt;d&lt;/i&gt; is maximum.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&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/AVvXsEjrpx3KlCqCVx6SWgd0LTKebTLpE8Q_AzE_AdqoNdMQzOgvgxnx3y6iW4gH2UtAKjNTYoGKvGNLk8-6uG5l6FYn1JXNsNCTPYCV9eFXxeuDqtkhT8wtDW9o8tF0b9TVGzEha5QSbkqCn_3Y/s1600/Eqn2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrpx3KlCqCVx6SWgd0LTKebTLpE8Q_AzE_AdqoNdMQzOgvgxnx3y6iW4gH2UtAKjNTYoGKvGNLk8-6uG5l6FYn1JXNsNCTPYCV9eFXxeuDqtkhT8wtDW9o8tF0b9TVGzEha5QSbkqCn_3Y/s1600/Eqn2.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
The table below shows the calculated d for different combinations of test sets and training sets. The values in &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;red &lt;/span&gt;are where &lt;i&gt;d&lt;/i&gt; is maximum. The classifier outputs the correct membership for each test set as shown below.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&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/AVvXsEiUew2JXKTFcYuP9__MMrjnwGWFa4HJcdehgzFVc64fg7kfiZN3V4C9nOU0wyXt_Lz5ytu1td9_Uv14fDK2fCuvQD2jji5Cun0aN01zixL7NO2mQvsn-P-Gyyq0gAdBmL_NnV-S9UsnGzDx/s1600/data.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUew2JXKTFcYuP9__MMrjnwGWFa4HJcdehgzFVc64fg7kfiZN3V4C9nOU0wyXt_Lz5ytu1td9_Uv14fDK2fCuvQD2jji5Cun0aN01zixL7NO2mQvsn-P-Gyyq0gAdBmL_NnV-S9UsnGzDx/s1600/data.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
After applying minimum distance classification on all test sets, all objects for each test set are classified correctly which gives us a 100% accuracy for this case. Such accuracy obtained is I think due to the well clustered features we see earlier.&lt;br /&gt;
&lt;br /&gt;
There are a lot of interesting features that were not extracted and investigated in this activity. And color is one these features. I am giving myself a grade of 10 for this activity since I was able to output the necessary results.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://anythingphysics.blogspot.com/feeds/1242296974377012709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anythingphysics.blogspot.com/2011/09/pattern-recognition.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/1242296974377012709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/1242296974377012709'/><link rel='alternate' type='text/html' href='http://anythingphysics.blogspot.com/2011/09/pattern-recognition.html' title='Pattern Recognition'/><author><name>Jen-Jen Manuel</name><uri>http://www.blogger.com/profile/17781945162053242109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio7WYdtUaWDpY0vUR8rmhXb6vLXc_NJhfW7210lMlbkFxjcoaf31CZ38KIuNSzomRZXPSXX9zYuME75wQBlwP99KltNLXSivQIMcdocBxzVUhe4t36aIu_krVWKUOErA4/s220/49936_1530407762_2876926_n.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZnHK5W-FbFib1u9SfQvMpTIcBMkDKMTfgfDZstzKNm0ErlrxmsumNqd_53SdSFkTmdFLGFeYeb6GRoQ19aeCSVZmBWfW5_GIeD-w9AnrFYnvrXuxRynicln7NSgp_QG6mGX_tSj0VZxlo/s72-c/Objects.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Quezon City, Philippines</georss:featurename><georss:point>14.6760413 121.0437003</georss:point><georss:box>14.553157299999999 120.8857718 14.7989253 121.2016288</georss:box></entry><entry><id>tag:blogger.com,1999:blog-2748687604404631686.post-636384309527107071</id><published>2011-09-09T01:05:00.000+08:00</published><updated>2011-09-09T01:05:23.983+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="color segmentation"/><category scheme="http://www.blogger.com/atom/ns#" term="histogram"/><category scheme="http://www.blogger.com/atom/ns#" term="NCC"/><category scheme="http://www.blogger.com/atom/ns#" term="non-parametric segmentation"/><category scheme="http://www.blogger.com/atom/ns#" term="parametric segmentation"/><title type='text'>Color Image Segmentation</title><content type='html'>The main goal of this activity is to segment a region of interest ROI&amp;nbsp;from an image based on the color of the ROI. The easiest way to segment a region of interest is, of course, by thresholding the grayscale image. This technique, unfortunately, does not work at all times. In the case wherein the ROI cannot be segmented through thresholding alone, color image segmentation is the solution. Here, the color of the region to be segmented is used as a basis in the segmentation. But note that an image of a 3D object can have shading variations. It is then important to represent the color space in such a way that it separates brightness and chromaticity (pure color). A very useful color space is the normalized chromaticity coordinates or NCC. Per pixel, let I = R + G + B wherein R, G and B represent the relative intensity of the red, green and blue channels, respectively. R, G and B are normalized such that&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/AVvXsEhnK-ZvzFcTLtem2U8bd-5I1fYyED_EjtOLJX-Jmt1QjE2o8cYZzGuvO926Ok9gkw4tNrK_6K8YIlXSTN6jCpfRr48n-W_xAzcXZtXZUlTa2RDgE7wX4yiFuFGy-iXPYNAz0SeeYnYErnHZ/s1600/NCC1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnK-ZvzFcTLtem2U8bd-5I1fYyED_EjtOLJX-Jmt1QjE2o8cYZzGuvO926Ok9gkw4tNrK_6K8YIlXSTN6jCpfRr48n-W_xAzcXZtXZUlTa2RDgE7wX4yiFuFGy-iXPYNAz0SeeYnYErnHZ/s1600/NCC1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Take note that r + g + b = 1 which then allows us to express b in terms of r and g, i.e., b = 1 - r - g. This gives us the normalized chromaticity space shown below which is a 2D color space. In this representation, the r-g plane gives us the chromatic information. A pixel in the image can be represented as a point in the NCC space. A region of interest ROI, for example, when represented in the NCC space, occupies a small blob positioned somewhere in space depending on the color of the ROI.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzeivkal1GASvHWUfhMDpQJ3XPwcKjTJUMZ7yd4qqR0gYXnW2WZv7Gu-veoF-y3xtWU4b4qiqQbVtSYRCHx80IwLzXNKpLIHYebEUbGsQNIsg0NI5ugecgUjKm22mCP9pm6E7JkyMh_IgH/s1600/NCC.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;281&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzeivkal1GASvHWUfhMDpQJ3XPwcKjTJUMZ7yd4qqR0gYXnW2WZv7Gu-veoF-y3xtWU4b4qiqQbVtSYRCHx80IwLzXNKpLIHYebEUbGsQNIsg0NI5ugecgUjKm22mCP9pm6E7JkyMh_IgH/s320/NCC.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Normalized chromaticity space with the x and y axes representing r and g, respectively.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div&gt;
In color segmentation, determining whether a pixel belongs to the ROI can be done by looking on the probability of the pixel to belong on the color distribution of the region of interest. This probability distribution function PDF can be obtained by finding the histogram of a portion in the ROI and normalizing it by the total number of pixels of the subregion selected. There are two ways to segment ROI: parametric segmentation and non-parametric segmentation. Shown below is the image to be segmented together with the cropped ROI.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNGBW4AauWhx3KJY92k-M7aAHQe5rFjqFbq9bsP6VxPZnbbxTK1LGJQwf9KLI-ACAjaICFeHbowlbbO8ngs_Qa0b2cWdL6cji8PHt8J8SeagzN0P-uBuDJ4sNpv4FKf_HHEXg-mAIEDyhb/s1600/Object+%252B+ROI.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;356&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNGBW4AauWhx3KJY92k-M7aAHQe5rFjqFbq9bsP6VxPZnbbxTK1LGJQwf9KLI-ACAjaICFeHbowlbbO8ngs_Qa0b2cWdL6cji8PHt8J8SeagzN0P-uBuDJ4sNpv4FKf_HHEXg-mAIEDyhb/s640/Object+%252B+ROI.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;a) The image to be segmented with the yellow object as the region of interest. b) A cropped portion from the ROI.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;Parametric Segmentation&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
In parametric segmentation, a Gaussian distribution is assumed independently along r and g and a joint probability p(r)p(g) function is used to determine whether a pixel belongs to the region of interest.&amp;nbsp;&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/AVvXsEjiJKF5D4KW37Vq_y_5VsIQsdTlnBgBoIpSP_PFpqZ-Wym44M8dB21ivr6rbYh6dBGuZCGc-8aPwzQBL_VMaMeHk6McE5wmRWkQuOdiEnv4KLCz1ffNgwL_99_pO0Cz4nQm5PVUdi3AXaZu/s1600/NCC2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiJKF5D4KW37Vq_y_5VsIQsdTlnBgBoIpSP_PFpqZ-Wym44M8dB21ivr6rbYh6dBGuZCGc-8aPwzQBL_VMaMeHk6McE5wmRWkQuOdiEnv4KLCz1ffNgwL_99_pO0Cz4nQm5PVUdi3AXaZu/s1600/NCC2.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
The histogram of the subregion together with the normalized chromaticity space is shown below.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6xXOHPtZrK8kH2j9gEWU8IKUCckdtThxyI-DjTbBpwtUGWG7EPKz2-ODJhOraaHO5HDE8HZZWfeLDUieOIHfybPWU2VE_AzTOEEvM1z9xGV7s3u3SEZ4rVGY1VKK7MnudJhZezYlBxV2u/s1600/Histogram+Gaussian+%252B+Chromaticity.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;302&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6xXOHPtZrK8kH2j9gEWU8IKUCckdtThxyI-DjTbBpwtUGWG7EPKz2-ODJhOraaHO5HDE8HZZWfeLDUieOIHfybPWU2VE_AzTOEEvM1z9xGV7s3u3SEZ4rVGY1VKK7MnudJhZezYlBxV2u/s640/Histogram+Gaussian+%252B+Chromaticity.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Left: The histogram of the subregion. Right: The&amp;nbsp;normalized chromaticity space&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Note that the histogram displays a peak which corresponds to the color yellow in the&amp;nbsp;normalized chromaticity space.&amp;nbsp;Shown below is the result using parametric segmentation.&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEissVYH_njIejNANe6dPoolv4EEutqTbfaXnTJrMWIU7KaNXvXAJk_QePq3ecq9n9x-G3wr206EtY1Uw7vhZhED0n_r2fzDswNotxA19K_cpWT5m1ZOuprPGxIqeTDdECqdMVrXLdo0K-IX/s1600/Parametric+Collage.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;259&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEissVYH_njIejNANe6dPoolv4EEutqTbfaXnTJrMWIU7KaNXvXAJk_QePq3ecq9n9x-G3wr206EtY1Uw7vhZhED0n_r2fzDswNotxA19K_cpWT5m1ZOuprPGxIqeTDdECqdMVrXLdo0K-IX/s640/Parametric+Collage.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The results using parametric segmentation with the left image in binary.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;Non-parametric segmentation&lt;/span&gt;&lt;br /&gt;
In non-parametric segmentation, the 2D histogram of the subregion chosen is used in tagging whether a pixel belongs to the ROI. Moreover, histogram back projection is done in assigning a pixel a value in chromaticity space based on its value on the color histogram.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0l7Zxma-JeIuu8QZxn6kX8559Gt25PRub-9R7vrozPnLNWVNJkIBzmN4ebPV_xz5FHuAQCQaRQvBEb4_cVPVbpsEo8MVcsHX4LpMmkLwJMQJ4tuT3rPbL_wBsgzexYgcK64_RTXZbpeKF/s1600/Histogram+%252B+Chromaticity.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0l7Zxma-JeIuu8QZxn6kX8559Gt25PRub-9R7vrozPnLNWVNJkIBzmN4ebPV_xz5FHuAQCQaRQvBEb4_cVPVbpsEo8MVcsHX4LpMmkLwJMQJ4tuT3rPbL_wBsgzexYgcK64_RTXZbpeKF/s640/Histogram+%252B+Chromaticity.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Left: The histogram of the subregion selected. Right: The&amp;nbsp;normalized chromaticity space.&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
It is obvious that the peak observed in the histogram of the subregion chosen corresponds to the yellow region in the&amp;nbsp;normalized chromaticity space. Having found the histogram of the subregion allows us now to perform histogram backprojection in order to segment the ROI. And the result for this method is shown below.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh09-DtuVWGtjJ_QqH3QdpzkTADSuaVDT8UMukaXuGk-otZiyqM9fuqzmlBnLAV633h670kWlmjQiQ1Ip94okNPwARVyTqrPOmMpnMiExxyUKqvfeCDhz2UCe44QGUnd6GR5vIaCtyYoZOw/s1600/Nonparametric+Collage.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;262&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh09-DtuVWGtjJ_QqH3QdpzkTADSuaVDT8UMukaXuGk-otZiyqM9fuqzmlBnLAV633h670kWlmjQiQ1Ip94okNPwARVyTqrPOmMpnMiExxyUKqvfeCDhz2UCe44QGUnd6GR5vIaCtyYoZOw/s640/Nonparametric+Collage.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The results using non-parametric segmentation with the left image in binary.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
The results obtained for both techniques suggest that parametric segmentation is better than non-parametric segmentation. The use of the Gaussian fit in the parametric segmentation makes the quality of the output better than that of non-parametric. The output obtained for this case reflects the smoothness of the Gaussian curve used.&lt;br /&gt;
&lt;br /&gt;
This was another difficult activity for me. But I still enjoyed doing this activity. Everything just paid off when I saw the results of the segmentation. I am giving myself a grade of 10 for this since I was able to show results for both segmentation techniques.&amp;nbsp;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://anythingphysics.blogspot.com/feeds/636384309527107071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anythingphysics.blogspot.com/2011/09/color-image-segmentation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/636384309527107071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/636384309527107071'/><link rel='alternate' type='text/html' href='http://anythingphysics.blogspot.com/2011/09/color-image-segmentation.html' title='Color Image Segmentation'/><author><name>Jen-Jen Manuel</name><uri>http://www.blogger.com/profile/17781945162053242109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio7WYdtUaWDpY0vUR8rmhXb6vLXc_NJhfW7210lMlbkFxjcoaf31CZ38KIuNSzomRZXPSXX9zYuME75wQBlwP99KltNLXSivQIMcdocBxzVUhe4t36aIu_krVWKUOErA4/s220/49936_1530407762_2876926_n.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnK-ZvzFcTLtem2U8bd-5I1fYyED_EjtOLJX-Jmt1QjE2o8cYZzGuvO926Ok9gkw4tNrK_6K8YIlXSTN6jCpfRr48n-W_xAzcXZtXZUlTa2RDgE7wX4yiFuFGy-iXPYNAz0SeeYnYErnHZ/s72-c/NCC1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2748687604404631686.post-4740600770640484642</id><published>2011-09-02T00:13:00.000+08:00</published><updated>2011-09-02T00:13:58.447+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="eigenvalues"/><category scheme="http://www.blogger.com/atom/ns#" term="pca"/><category scheme="http://www.blogger.com/atom/ns#" term="Principal Component Analysis"/><title type='text'>Image Compression</title><content type='html'>Principal component analysis or&amp;nbsp;&lt;i&gt;PCA &lt;/i&gt;is utilized in this activity as image compression technique. This activity has the goal to demonstrate how image compression works. Nowadays, storing images of large file sizes is no longer a problem with the emergence and availability of cheap flash disks, and probably hard disks. But before we experienced such comfort, there was a time that storage was really a problem. This is where image compression became useful. Several tutorials on &lt;i&gt;PCA&lt;/i&gt; are available over the internet. The technique itself deals with a lot of linear algebra but basically &lt;i&gt;PCA&lt;/i&gt; dwells on the idea that a given image can be represented as a summation of weighted basis images. &lt;i&gt;PCA&lt;/i&gt;, as a compression technique, uses a given number of eigenfunctions (eigenimages) which depends mainly on the degree of accuracy of the reconstruction. A lesser number of eigenimages used suggests a smaller file size and that quality is sacrificed.&amp;nbsp;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;The image below is the grayscale image to be compressed. It has a file size of 735kB. Using the built-in&amp;nbsp;&lt;i&gt;PCA&lt;/i&gt;&amp;nbsp;function in Scilab, the shown image is then compressed.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIxbuWsZJqBxuT9kgQiVtZRlQt8MxyKUeqiHOd3V9gl_xDwj0kHrVfbW-08ibH2vmYh4A2whCWLjiNvEZs-UhLtjE6-n3aXgegNlxhHWJIkwuadBV9vK6ng1pD6mB-4baEShjKgrGbXEx9/s1600/grayscale.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;475&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIxbuWsZJqBxuT9kgQiVtZRlQt8MxyKUeqiHOd3V9gl_xDwj0kHrVfbW-08ibH2vmYh4A2whCWLjiNvEZs-UhLtjE6-n3aXgegNlxhHWJIkwuadBV9vK6ng1pD6mB-4baEShjKgrGbXEx9/s640/grayscale.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;A sample grayscale image to be compressed with file size of&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;735kB.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div&gt;But before &lt;i&gt;PCA &lt;/i&gt;takes the job, the image to be compressed must be cut into 10x10 blocks! Take note that our image is 2440 x 3260! And that is a lot of square blocks to make. Each subblock is then converted into a column matrix having 100 elements. These are then arranged to form an &lt;i&gt;n&lt;/i&gt; x &lt;i&gt;p &lt;/i&gt;matrix &lt;i&gt;x&lt;/i&gt; where &lt;i&gt;n&lt;/i&gt; is the number of blocks and &lt;i&gt;p&lt;/i&gt; is the total number of elements in each subblock, i.e., 100. &lt;i&gt;PCA &lt;/i&gt;is then applied on the matrix &lt;i&gt;x&lt;/i&gt;. The &lt;i&gt;PCA&amp;nbsp;&lt;/i&gt;outputs a set of eigenvalues (lambda), together with their corresponding eigenvectors, that are arranged in decreasing order. Each lambda represents the weight of each eigenvector. Given 1000 subblocks, for example, with size 10x10, 100 eigenvectors can be formed with length equal to 1000. Each eigenvector contains the intensity value of the same pixel location for the 1000 subblocks. The eigenvalue (lambda) dictates the number of eigenimages to be used in the reconstruction of the image depending on some threshold to be set [1]. The decrease in the number of eigenvectors (eigenimages) used leads to the decrease in the file size of the image.&amp;nbsp;Below is an example of the compressed image with the file size reduced to 567kB.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5qIQp1I1QmVSfq2gR4eFPjw-xQt13zUIdYt36QymPCQgwxrx26W55R2t5NEOvVtDbi2k0QYkPQWVRMM_evxQcdt8asSBhOBxpAA0XRkFrvBte6b1I7ya9o0u80awm9oJDJ7rInfO372TA/s1600/eigenimages+%253D+1+0.95.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;475&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5qIQp1I1QmVSfq2gR4eFPjw-xQt13zUIdYt36QymPCQgwxrx26W55R2t5NEOvVtDbi2k0QYkPQWVRMM_evxQcdt8asSBhOBxpAA0XRkFrvBte6b1I7ya9o0u80awm9oJDJ7rInfO372TA/s640/eigenimages+%253D+1+0.95.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Compressed image with the file size reduced to 567kB.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div&gt;There is an observed difference between the original image and the compressed image in terms of resolution. It appears that image compression using &lt;i&gt;PCA &lt;/i&gt;sacrifices the quality of the image to be reconstructed since fewer number of eigenvectors are used to represent the given image.&amp;nbsp;Increasing the number of eigenimages to be used leads to a more accurate reconstruction of the image but does not help in reducing the file size of the image. Below shows the trend observed as the number of eigenimages is increased from 1 to 99.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHP97UZjgcspZXmVDnIVtN-dwxFTTX1qYutVZMoWm320NaCDBDf62LCNsMf86MYR72ewl0I9ttURWLtOfXpILS6PjqUdbxqGbq0KlhRiFGC1MBBb_1WwRWgxY5ubQGKkh3wpZcCOyPsSMG/s1600/data1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;172&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHP97UZjgcspZXmVDnIVtN-dwxFTTX1qYutVZMoWm320NaCDBDf62LCNsMf86MYR72ewl0I9ttURWLtOfXpILS6PjqUdbxqGbq0KlhRiFGC1MBBb_1WwRWgxY5ubQGKkh3wpZcCOyPsSMG/s400/data1.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The total number of eigenimages is 100. And the size of the original image is&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;735kB.&lt;/span&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div&gt;Figuring out what the outputs of the function &lt;i&gt;PCA&lt;/i&gt;&amp;nbsp;mean just consumed much of my time. And do not forget about the complicated &lt;i&gt;PCA&lt;/i&gt; routine. Working with matrices is such a mess. But despite these problems, I was able to fulfill the objective of this activity which is to compress a sample image. And thank God for that. And yes, I am giving myself a grade of 10.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;References:&lt;/div&gt;&lt;div&gt;[1] Principal component analysis. Retrieved Sepetember 1, 2011 from&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Principal_component_analysis&quot;&gt;http://en.wikipedia.org/wiki/Principal_component_analysis&lt;/a&gt;.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anythingphysics.blogspot.com/feeds/4740600770640484642/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anythingphysics.blogspot.com/2011/09/image-compression.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/4740600770640484642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/4740600770640484642'/><link rel='alternate' type='text/html' href='http://anythingphysics.blogspot.com/2011/09/image-compression.html' title='Image Compression'/><author><name>Jen-Jen Manuel</name><uri>http://www.blogger.com/profile/17781945162053242109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio7WYdtUaWDpY0vUR8rmhXb6vLXc_NJhfW7210lMlbkFxjcoaf31CZ38KIuNSzomRZXPSXX9zYuME75wQBlwP99KltNLXSivQIMcdocBxzVUhe4t36aIu_krVWKUOErA4/s220/49936_1530407762_2876926_n.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIxbuWsZJqBxuT9kgQiVtZRlQt8MxyKUeqiHOd3V9gl_xDwj0kHrVfbW-08ibH2vmYh4A2whCWLjiNvEZs-UhLtjE6-n3aXgegNlxhHWJIkwuadBV9vK6ng1pD6mB-4baEShjKgrGbXEx9/s72-c/grayscale.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2748687604404631686.post-425875173969177287</id><published>2011-08-31T22:51:00.001+08:00</published><updated>2011-08-31T22:51:46.884+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="close"/><category scheme="http://www.blogger.com/atom/ns#" term="dilate"/><category scheme="http://www.blogger.com/atom/ns#" term="erode"/><category scheme="http://www.blogger.com/atom/ns#" term="imconv"/><category scheme="http://www.blogger.com/atom/ns#" term="mogrify"/><category scheme="http://www.blogger.com/atom/ns#" term="open"/><title type='text'>Preprocessing Text</title><content type='html'>This activity aims to integrate and apply all the things we have learned in image processing so far. The first time I had a glimpse on the manual for this activity, I thought it was much easier than the previous activity (&lt;a href=&quot;http://anythingphysics.blogspot.com/2011/08/playing-notes-by-image-processing.html&quot;&gt;click here&lt;/a&gt;). I still don&#39;t know why it took me more than two meetings to finish it. Compared to the previous activity, this one requires a lot of subjectivity. Yes, it is clear that the main objective is to extract handwritten text from an imaged document. But one&#39;s judgement regarding the quality of the output is so subjective that determining when to stop from repeating the process again and again is not definite.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjg1wJ_hk-xI0NVZKksb-t1H-f0maOjQv9mGUc-9X6sHifeR5yRClTO7G3peyENgEjPpGbNx-hPLihbv8OTr2deI1V9gDEqU5ylbLgx1VvBGH9mwCgDOjGLD8Ur7OZ8-Je764sqIi2xuppV/s1600/Untitled_0001.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjg1wJ_hk-xI0NVZKksb-t1H-f0maOjQv9mGUc-9X6sHifeR5yRClTO7G3peyENgEjPpGbNx-hPLihbv8OTr2deI1V9gDEqU5ylbLgx1VvBGH9mwCgDOjGLD8Ur7OZ8-Je764sqIi2xuppV/s400/Untitled_0001.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The imaged document used for this activity.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;The whole image was not used. Instead, we cropped a small portion containing handwritten text which is the one shown below.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaYwzNOLgreOmavEjXgHiQuuZWnfl_MZppzSDAlU-4JyDYVWNfRNLx09B0xzqmZV288Y5Y_ymEtLG7ywqR2gYrS7Sk8GnLcx0LJ0w6qjRh1vgybN4br61LhMjxGfsv1KXBMzzISe30S_6V/s1600/compiled+3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;168&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaYwzNOLgreOmavEjXgHiQuuZWnfl_MZppzSDAlU-4JyDYVWNfRNLx09B0xzqmZV288Y5Y_ymEtLG7ywqR2gYrS7Sk8GnLcx0LJ0w6qjRh1vgybN4br61LhMjxGfsv1KXBMzzISe30S_6V/s400/compiled+3.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: left;&quot;&gt;Left: Fourier transform FT of the cropped image on the right. Right: the cropped image from the imaged document which contains handwritten text.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;From the imaged document itself, it is very clear that the image is tilted. Looking on its FT is helpful in finding the tilt angle. It was suggested that we use the &lt;b&gt;mogrify&lt;/b&gt; function in Scilab. The documentation in Scilab is not helpful so I searched over the net for the right arguments for the function. For some weird reason, Scilab kept on returning error messages for each attempt I made just to rotate the image using &lt;b&gt;mogrify&lt;/b&gt;. This just consumed much of my time which made me rotate the image using &lt;b&gt;MATLAB&lt;/b&gt;. I know this is a mortal sin but... mogrigy is not really cooperating.&lt;br /&gt;
&lt;br /&gt;
Finding the tilt angle was done manually. Approximately, a tilt angle of 1degree was chosen. The rotated image and its Fourier transform are shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgk9sQIb8YVVuGxQ7EfsuDuGW1KBV4MqGUBKmOfUOXlYln75DEPNCso2ubUlCo9ZvGW6Yb1b91vKLUZAM-jtwGjMEwPxYt47QV3d6_025OsCRQWoKurNKUqdcO2DxDuT_PTAlGIUCosMWbd/s1600/compiled+1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;170&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgk9sQIb8YVVuGxQ7EfsuDuGW1KBV4MqGUBKmOfUOXlYln75DEPNCso2ubUlCo9ZvGW6Yb1b91vKLUZAM-jtwGjMEwPxYt47QV3d6_025OsCRQWoKurNKUqdcO2DxDuT_PTAlGIUCosMWbd/s400/compiled+1.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Left: the rotated cropped image. Right: The Fourier transform of the image on the left.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;To remove the horizontal lines, a filter must be created such that it covers the vertical line that appears on the FT of the image. Recall that a sinusoid along the x direction produces a Fourier transform that is composed of two &lt;i&gt;dots &lt;/i&gt;that is symmetric along the y-axis. The spacing between these observed symmetric peaks is dependent mainly on the frequency of the signal.&lt;br /&gt;
&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHa1S7kowz7WhdzZZAgY2fTD0qwDcMweRC_o5k3_ZoQiNyebZi4Nv3V9OPjwTcdrWCHVDjUC-gngsHRloflEQj-nt6ce0x4VmlO_4okCAZj1hG5WrHnYgR6yT62-IneT73KIFkGsXX9JOf/s1600/compiled+2.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;168&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHa1S7kowz7WhdzZZAgY2fTD0qwDcMweRC_o5k3_ZoQiNyebZi4Nv3V9OPjwTcdrWCHVDjUC-gngsHRloflEQj-nt6ce0x4VmlO_4okCAZj1hG5WrHnYgR6yT62-IneT73KIFkGsXX9JOf/s320/compiled+2.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: left;&quot;&gt;Left: the resulting image upon the addition of the filter. Right: the FT of the rotated image with a filter added.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;What we have done so far is to remove the horizontal lines in the selected portion of the imaged document. We now proceed to converting the image to binary. The histogram of the said image is shown below together with the resulting binary image using a threshold of 0.51.&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOABf4mcIqsBgsVaubGqVes_NR9JrBridytfwSuLJYvOvYC1fi9_Y_LxeB1hKqpiODGnQDdtrwsFzldgm63JY3a7ldA5coIx1EhUP7U1UBFnc0tWjiOG2-GLtV4q7fD57PZjk9DDhyphenhyphendqtz/s1600/compiled+4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;190&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOABf4mcIqsBgsVaubGqVes_NR9JrBridytfwSuLJYvOvYC1fi9_Y_LxeB1hKqpiODGnQDdtrwsFzldgm63JY3a7ldA5coIx1EhUP7U1UBFnc0tWjiOG2-GLtV4q7fD57PZjk9DDhyphenhyphendqtz/s400/compiled+4.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: left;&quot;&gt;Left: histogram of the image. Right: the resulting binary image using a threshold of 0.51.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;It is evident on the histogram that a single peak exists. In this case, it is very difficult to determine the perfect threshold value to use in order to separate the background and the region of interest, i.e., the handwritten text. &amp;nbsp;I decided to choose a threshold value that is near 0.5, which I think is a safe value to use.&lt;br /&gt;
&lt;br /&gt;
Now, our goal is to clean the image using the techniques we have learned so far. The figure below summarizes the things I have done on the binary image.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAyr3LsewCexmGfUwHexayEmV-NW1gGTLXjjEuDQeI-18lst8ca3gmbR41ciW9T9Rx4wWvKvZ6CAhxaXcbZVq71Ka0pt_jfvsy3EYL68EtKr4MP9lNFguJOt2iu9b65ukLQLF9bnDISOt0/s1600/compiled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;556&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAyr3LsewCexmGfUwHexayEmV-NW1gGTLXjjEuDQeI-18lst8ca3gmbR41ciW9T9Rx4wWvKvZ6CAhxaXcbZVq71Ka0pt_jfvsy3EYL68EtKr4MP9lNFguJOt2iu9b65ukLQLF9bnDISOt0/s640/compiled.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Top row: dilate, erode. Bottom row: close, open.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;I tried different morphological operations on the binary image. I am not quite satisfied with the quality of the results I obtained for this part of the activity. Cleaning the image seems to be impossible. First, not only handwritten text was present in the chosen portion but also typewritten ones. Some of these components after the operation appear to be &lt;i&gt;dirt&lt;/i&gt;&amp;nbsp;on the processed image. Also, the effect of filtering the vertical line on the FT is that the handwritten letters appear to be &lt;i&gt;sliced&lt;/i&gt; horizontally. This hinders us from labeling each handwritten letter in the image. I find it hard to decipher the text written by manual inspection. The letters were written so close together that preprocessing the text was too hard to accomplish. Yes!&lt;br /&gt;
&lt;br /&gt;
Another thing I made was to use the &lt;b&gt;imconv&lt;/b&gt; function on the resulting image after a filter was applied. This is helpful in the case of edge detection. Somehow, what I wanted to happen on this is for &lt;b&gt;imconv&lt;/b&gt;&amp;nbsp;to detect the edges of the text present on the image, Two types of mask were used, i.e., a cross pattern and a dot pattern.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-2pD1Ze-tNR12XM8ADzYK211mtkHAwsCEXeluZKEt_jHbKyqhhZC6qXxjRDP1G3I9dzqvAOZCyV-9tj_cpGptjMMWqfsAosqaLptg_-F4T2XNzoPTTyOYJ8LFcy2k-44XtHaYN4-8A7mt/s1600/compiled+5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-2pD1Ze-tNR12XM8ADzYK211mtkHAwsCEXeluZKEt_jHbKyqhhZC6qXxjRDP1G3I9dzqvAOZCyV-9tj_cpGptjMMWqfsAosqaLptg_-F4T2XNzoPTTyOYJ8LFcy2k-44XtHaYN4-8A7mt/s1600/compiled+5.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Left: the result using a cross mask. Right: the result using a dot mask.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Apparently, the results when these images were converted to binary are not okay, i.e., the results obtained earlier using the morphological operations are better.&lt;br /&gt;
&lt;br /&gt;
Below are my results for the part wherein the other instances of the word &quot;&lt;i&gt;DESCRIPTION&lt;/i&gt;&quot; are to be found. The very first technique that crossed my mind is template matching. Given a template containing the word &quot;&lt;i&gt;DESCRIPTION&lt;/i&gt;&quot; which must at least appear to have a font style and size similar to that of the typewritten text, its correlation with the imaged document will be found using the &lt;b&gt;imcorrcoef&lt;/b&gt; function. The positions where the other instances occur result to a higher correlation values. The result is shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidzeMhu4JzpHHb09QWONW3GkkAu2S_nHOz1fVYwi9YqEfRzxqCt5dgHoTGfR5ilepDaRfOOS3fx00ZEsNfryvV0Pe29gtYRtxOKnHfnBJBTiifDSb1GI0L-nDjW5kUPDmiRj076EAlRgbq/s1600/compiled+6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;393&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidzeMhu4JzpHHb09QWONW3GkkAu2S_nHOz1fVYwi9YqEfRzxqCt5dgHoTGfR5ilepDaRfOOS3fx00ZEsNfryvV0Pe29gtYRtxOKnHfnBJBTiifDSb1GI0L-nDjW5kUPDmiRj076EAlRgbq/s640/compiled+6.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Left: the imaged document with the horizontal lines removed by adding a filter. Right: the output after using &lt;b&gt;imcorrcoef&lt;/b&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;The output after obtaining the correlation of the template with the image appears to display the maximum correlation values at the locations of the instances of the word &quot;&lt;i&gt;DESCRIPTION&lt;/i&gt;&quot;. However, there are observed locations where the resulting correlation values appear to be maximum but do not correspond to the positions of the instances to be found. I know that this technique is too qualitative to be used.&lt;br /&gt;
&lt;br /&gt;
I am giving myself a grade of 9 for the lousy results I have. I am not completely contented with the things I have done for this activity. I think I have not fully applied the things that I have learned.</content><link rel='replies' type='application/atom+xml' href='http://anythingphysics.blogspot.com/feeds/425875173969177287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anythingphysics.blogspot.com/2011/08/preprocessing-text.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/425875173969177287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/425875173969177287'/><link rel='alternate' type='text/html' href='http://anythingphysics.blogspot.com/2011/08/preprocessing-text.html' title='Preprocessing Text'/><author><name>Jen-Jen Manuel</name><uri>http://www.blogger.com/profile/17781945162053242109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio7WYdtUaWDpY0vUR8rmhXb6vLXc_NJhfW7210lMlbkFxjcoaf31CZ38KIuNSzomRZXPSXX9zYuME75wQBlwP99KltNLXSivQIMcdocBxzVUhe4t36aIu_krVWKUOErA4/s220/49936_1530407762_2876926_n.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjg1wJ_hk-xI0NVZKksb-t1H-f0maOjQv9mGUc-9X6sHifeR5yRClTO7G3peyENgEjPpGbNx-hPLihbv8OTr2deI1V9gDEqU5ylbLgx1VvBGH9mwCgDOjGLD8Ur7OZ8-Je764sqIi2xuppV/s72-c/Untitled_0001.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2748687604404631686.post-63791392688699174</id><published>2011-08-19T04:10:00.001+08:00</published><updated>2011-08-19T04:57:54.247+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="musical score sheet"/><category scheme="http://www.blogger.com/atom/ns#" term="scilab"/><category scheme="http://www.blogger.com/atom/ns#" term="sing"/><category scheme="http://www.blogger.com/atom/ns#" term="Twinkle Twinkle Little Star"/><title type='text'>Playing Notes by image processing</title><content type='html'>This activity is, I think, the most challenging so far. First, I need to learn how to read a musical score sheet, i.e., from notes to their corresponding tones. I got so frustrated during the 1st day that I only continued doing this a few hours before deadline (that explains why this blog post is late). Okay let us just forget about these rants and proceed to our main concern.&lt;br /&gt;
&lt;br /&gt;
It is only when I totally concentrated on doing this that I realized how cool this activity is. Yes! This is true especially when everything is working already, i.e., from the code to the saved sound file. I chose a song which has a musical score sheet that is composed of only two kinds of note: half note and quarter note. The song is the famous &#39;&lt;i&gt;Twinkle Twinkle Little Star&lt;/i&gt;&#39;. Its score sheet is shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIsu9rQ3TjjGqzqPWIBmTGP9skHT3xd79CDmpGp_6FHuRmmQ2L_sNTF1y6IZej1UzPR9xb8x7wcbHgLLH_3P-y2_k8nUt71r1wZ9sj9xfgq0NFa9cdvj2aMZXuIk3Bkp-B95qdqea_vR2X/s1600/twinkle_twinkle_little_star+-+Copy.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;356&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIsu9rQ3TjjGqzqPWIBmTGP9skHT3xd79CDmpGp_6FHuRmmQ2L_sNTF1y6IZej1UzPR9xb8x7wcbHgLLH_3P-y2_k8nUt71r1wZ9sj9xfgq0NFa9cdvj2aMZXuIk3Bkp-B95qdqea_vR2X/s400/twinkle_twinkle_little_star+-+Copy.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;This musical score sheet is downloaded from&amp;nbsp;&lt;a href=&quot;http://mamalisa.com/&quot;&gt;mamalisa.com&lt;/a&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;The very first thing I performed on the digitized score sheet was to cut it into 4 parallel rows. Each strip containing the necessary information would then undergo image processing. Since we aim to play the song, detecting what types of note are present in the image is needed. My idea was to use template matching. There only exist two types of note in the whole score sheet. This is advantageous since only a single template will be used. In my case, I opted to use the quarter note as the template. In template matching, the size of the two images being matched must be the same. The figure shown below is the template used for this activity.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUu3I39o-DW1ANhyphenhyphen6qVoV-ijC4o3I7ZdQRzY99F4p2qoR2rJS-kjVsXyU5Pm_c-b6Y0YbAHExrBjh9SNqQOz3rUXhnvhwBncfQdkgeXAPPvdlhKOSt7x-BuNtWbgXpNnoRrJSIh_BExMN0/s1600/template+1+quater+note+-+Copy+bw.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;47&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUu3I39o-DW1ANhyphenhyphen6qVoV-ijC4o3I7ZdQRzY99F4p2qoR2rJS-kjVsXyU5Pm_c-b6Y0YbAHExrBjh9SNqQOz3rUXhnvhwBncfQdkgeXAPPvdlhKOSt7x-BuNtWbgXpNnoRrJSIh_BExMN0/s400/template+1+quater+note+-+Copy+bw.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The template, in binary, used for this activity.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1k4XMLndoJGqj3UfJOEWOsWgd8weLloFKvih3uBgSEkar40EAWrxIYEu4nzdK19xExEmEy41r4ZKZexUrk1C1l9xsU3LjHhO585Xd0A3rGkSzcqB5ZcPsF8eAIieH3Hut9VCXgemuZAyD/s1600/bwscoresheet.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;42&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1k4XMLndoJGqj3UfJOEWOsWgd8weLloFKvih3uBgSEkar40EAWrxIYEu4nzdK19xExEmEy41r4ZKZexUrk1C1l9xsU3LjHhO585Xd0A3rGkSzcqB5ZcPsF8eAIieH3Hut9VCXgemuZAyD/s400/bwscoresheet.bmp&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The first row in the musical score sheet.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Shown below are the results when the 1st row in the musical score sheet is image processed. The first row image shows the correlation of the binarized template and score sheet. This is obtained by multiplying the FT of the template to the conjugate of the FT of the score sheet. The second row presents the result when the obtained correlation of the two function is converted to binary using a good threshold value which is 0.55, in our case.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Notice that difference between the forms of a quarter note and a half note. Our problem regarding how to detect the right note is solved! To further quantify things, the histogram of the areas is investigated and from that a threshold value or criterion in determining whether the connected pixels represent a quarter note or a half note is set.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;My next concern is to determine the corresponding tone for a given note. The third row in the figure shows the exact coordinates where maximum correlation in each region exists. This is better than computing for the center of mass of such regions. The basis for such returned coordinates is the computed correlation of the two patterns earlier. Knowing the coordinates/locations of the notes will help us in determining what specific tone is to be played. My concern at this moment is to calculate the vertical distance of a given note in the score sheet with respect to the note having the lowest vertical position. Such note will then serve as our reference point. It happens that all notes having the lowest vertical position in the 4 rows in the sheet have C as their corresponding tone. A histogram of the spacing of the notes with respect to the reference note is investigated and hints us the existence of constant spacing between tones, e.g., C-D-E-F and so on. A spacing of 4, on average is observed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;C = 261.63&lt;/li&gt;
&lt;li&gt;D = 293.66&lt;/li&gt;
&lt;li&gt;E = 329.63&lt;/li&gt;
&lt;li&gt;F = 349.23&lt;/li&gt;
&lt;li&gt;G = 392&lt;/li&gt;
&lt;li&gt;A = 440&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdzp48NTSch-oa5NsdJ1hVi1x2ngRHERHg5vtJ9tXZ6LGvtWd_J-3cAaPOTxp857Dwc8vyPldI6Qk2YRg1Xf09JPLt7rFplDLR7AIlOkYkZq0Af6FUkqkVN84-w7dM9xdiWftU8rsJ9a0h/s1600/Compiled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;248&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdzp48NTSch-oa5NsdJ1hVi1x2ngRHERHg5vtJ9tXZ6LGvtWd_J-3cAaPOTxp857Dwc8vyPldI6Qk2YRg1Xf09JPLt7rFplDLR7AIlOkYkZq0Af6FUkqkVN84-w7dM9xdiWftU8rsJ9a0h/s640/Compiled.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The image processed musical score sheet.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicifodfHh5ODXvYrLKIZgDiAfkq1lP9D_qp74sPqf1rVvoTf8X3TI5seHhyWKPtKYQH9EtAkmuXs6w-6PWGK3pImlT26HeqigF4m_5K9YbzPTib0Bt8k5I6lGJlVkoRiSMOtsu61q-PpRq/s1600/area+hist.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;312&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicifodfHh5ODXvYrLKIZgDiAfkq1lP9D_qp74sPqf1rVvoTf8X3TI5seHhyWKPtKYQH9EtAkmuXs6w-6PWGK3pImlT26HeqigF4m_5K9YbzPTib0Bt8k5I6lGJlVkoRiSMOtsu61q-PpRq/s400/area+hist.bmp&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The histogram of the areas of the regions observed. It is safe to choose a threshold value of 10 in this case.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Having the necessary tools on how to determine the correct note and tone, we are now ready to let Scilab sing the song for us. Below is the final result of everything.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.blogger.com/video.g?token=AD6v5dz1miNJIYHrVZMPleWd_vLSuTM8wGaUTMD7w5HAnYhe9hqyxVRIUQZjqk19Cy8QukRxNDLMHDD-h4Aab69L8Q&#39; class=&#39;b-hbp-video b-uploaded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&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;I am giving myself a grade of 10 for this since I was able to accomplish the main goal of this activity which is to make Scilab sing the song written on a musical score sheet.&amp;nbsp;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anythingphysics.blogspot.com/feeds/63791392688699174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anythingphysics.blogspot.com/2011/08/playing-notes-by-image-processing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/63791392688699174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/63791392688699174'/><link rel='alternate' type='text/html' href='http://anythingphysics.blogspot.com/2011/08/playing-notes-by-image-processing.html' title='Playing Notes by image processing'/><author><name>Jen-Jen Manuel</name><uri>http://www.blogger.com/profile/17781945162053242109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio7WYdtUaWDpY0vUR8rmhXb6vLXc_NJhfW7210lMlbkFxjcoaf31CZ38KIuNSzomRZXPSXX9zYuME75wQBlwP99KltNLXSivQIMcdocBxzVUhe4t36aIu_krVWKUOErA4/s220/49936_1530407762_2876926_n.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIsu9rQ3TjjGqzqPWIBmTGP9skHT3xd79CDmpGp_6FHuRmmQ2L_sNTF1y6IZej1UzPR9xb8x7wcbHgLLH_3P-y2_k8nUt71r1wZ9sj9xfgq0NFa9cdvj2aMZXuIk3Bkp-B95qdqea_vR2X/s72-c/twinkle_twinkle_little_star+-+Copy.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2748687604404631686.post-1270812906580407983</id><published>2011-08-04T20:29:00.002+08:00</published><updated>2011-08-04T20:49:35.159+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="area estimation"/><category scheme="http://www.blogger.com/atom/ns#" term="area histogram"/><category scheme="http://www.blogger.com/atom/ns#" term="blob"/><category scheme="http://www.blogger.com/atom/ns#" term="cancer cells"/><category scheme="http://www.blogger.com/atom/ns#" term="close"/><category scheme="http://www.blogger.com/atom/ns#" term="dilate"/><category scheme="http://www.blogger.com/atom/ns#" term="erode"/><category scheme="http://www.blogger.com/atom/ns#" term="mean"/><category scheme="http://www.blogger.com/atom/ns#" term="open"/><category scheme="http://www.blogger.com/atom/ns#" term="stdev"/><category scheme="http://www.blogger.com/atom/ns#" term="tag cancer cells"/><title type='text'>Binary Operations</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;In this activity, we will apply everything we have learned so far in image processing. We are asked to estimate the area of the cells found in the figure shown below. Note that the image contains cells whose area distribution is uniform. We then hope to proceed to the case wherein some cells differ in sizes with respect to the typical cell size in the figure. The activity is synonymous to what is being done in cancer cell detection. Knowing the size of a typical cell, one can easily detect any possible cancer cell in a given image using image processing techniques.&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6NCS5kBvVZV56QTlsNFr0ZK0xy-dIGTNJrWooiVd9TUpJPxY5BYAfP33H9VtGNPsSN5VwTQnRRfXzjVnDA0WTo28-1szRPUK7QnBLkmjmABlP7Bs8rPQt-vbSjQfMZ_0F5f-PaEXTxlk2/s1600/Circles002.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6NCS5kBvVZV56QTlsNFr0ZK0xy-dIGTNJrWooiVd9TUpJPxY5BYAfP33H9VtGNPsSN5VwTQnRRfXzjVnDA0WTo28-1szRPUK7QnBLkmjmABlP7Bs8rPQt-vbSjQfMZ_0F5f-PaEXTxlk2/s320/Circles002.jpg&quot; width=&quot;255&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;A digitized image of punched paper using a flatbed scanner.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;The first thing that needs to be done is to separate the region of interest ROI from the background. A threshold value can be obtained from the PDF of the grayscale image. The PDF of the given image is shown below. The peaks observed in the figure below represents the background and ROI. A good threshold value lies somewhere between these two peaks and is a minimum, i.e., 0.825.&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiK7idtPVACK6X3J-NkJLNv842h2NopR5kEVE901uQydnACnfQmVNypKbjPg1sg2a7uYFrB1HAQRG2Dq9VhCNyEP-W6X38dzhxS5pW7-QI86jLSI5kyUYPmaAOoJW5IH9jA_6E66B0wjzkm/s1600/histplot_circle1.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiK7idtPVACK6X3J-NkJLNv842h2NopR5kEVE901uQydnACnfQmVNypKbjPg1sg2a7uYFrB1HAQRG2Dq9VhCNyEP-W6X38dzhxS5pW7-QI86jLSI5kyUYPmaAOoJW5IH9jA_6E66B0wjzkm/s400/histplot_circle1.bmp&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Histogram of the given image. The threshold value used is 0.825.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Cutting the image to produce 12 sub-images and converting these to binary give the following results. Notice that the resulting binary images are a little bit noisy as a result of the&amp;nbsp;&lt;i&gt;threshold &lt;/i&gt;process.&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgniaUD-QPS8JI-isGdvF5KUKUBWtZysgSWKkYo4NzcOaU0or2mkVndBJLaJcsJFdGITl4taXjv0zcKFNX3hgBAzwNssYHU-n-JhMe59ApbJB7o-geuZvoS4hquOne60Ho9vgX3xxGB-Mnf/s1600/compilation.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgniaUD-QPS8JI-isGdvF5KUKUBWtZysgSWKkYo4NzcOaU0or2mkVndBJLaJcsJFdGITl4taXjv0zcKFNX3hgBAzwNssYHU-n-JhMe59ApbJB7o-geuZvoS4hquOne60Ho9vgX3xxGB-Mnf/s1600/compilation.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The result of converting the gray scale image to binary using a threshold value of 0.825.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;To remove such noise, some morphological operations are needed to be done on these binary images. Previously we have investigated how dilation and erosion work (see previous &lt;a href=&quot;http://anythingphysics.blogspot.com/2011/07/morphological-operations.html&quot;&gt;post&lt;/a&gt;). We have the option to utilize some available morphological operations such as opening and closing. These operators are basically a combination of dilation and erosion.&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;The opening of &lt;i&gt;A&lt;/i&gt; by &lt;i&gt;B&lt;/i&gt; is obtained by first eroding &lt;i&gt;A&lt;/i&gt; by &lt;i&gt;B&lt;/i&gt; and then dilating the resulting image by &lt;i&gt;B&lt;/i&gt;.&lt;/li&gt;
&lt;/ul&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/AVvXsEhFU68IYMOX97yKRfY2XpjQVASHSIbCY_4Y_tBjuglfKHuDIKLdQwvk_naA3FnO5ZzgNPcybfmoeyEZPMBNAeTcwH6Q-1ropxo-eO5v4_F4TZ1tqGoyh4Hlyoek3IlKHOVS7CpB3EzLSz3t/s1600/OPEN+eqn.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFU68IYMOX97yKRfY2XpjQVASHSIbCY_4Y_tBjuglfKHuDIKLdQwvk_naA3FnO5ZzgNPcybfmoeyEZPMBNAeTcwH6Q-1ropxo-eO5v4_F4TZ1tqGoyh4Hlyoek3IlKHOVS7CpB3EzLSz3t/s1600/OPEN+eqn.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;The closing of &lt;i&gt;A&lt;/i&gt; by &lt;i&gt;B&lt;/i&gt; is obtained by first dilating &lt;i&gt;A&lt;/i&gt; by &lt;i&gt;B&lt;/i&gt; and then eroding the resulting image by &lt;i&gt;B&lt;/i&gt;.&lt;/li&gt;
&lt;/ul&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/AVvXsEggV1oKK3gMs1okRY8FeeKEw9VMWXUSSQLoTUV5qy4rQwc5wM_onHWj73DszQ6KxGhRJa15Q247l1pRUi3-kFVCP53MZ_L3JpS-o0cbrdqWpt1aRmyMAp0nTiYT1IQKbR89q0jtaxTqpmoo/s1600/CLOSE+eqn.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggV1oKK3gMs1okRY8FeeKEw9VMWXUSSQLoTUV5qy4rQwc5wM_onHWj73DszQ6KxGhRJa15Q247l1pRUi3-kFVCP53MZ_L3JpS-o0cbrdqWpt1aRmyMAp0nTiYT1IQKbR89q0jtaxTqpmoo/s1600/CLOSE+eqn.png&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&gt;After comparing the results using the possible combinations of the opening and closing operators, I resorted back to using the opening operator only. The results it produce appear to be the best among the many options I have. And the result of using such operator is shown below. Also, note that the structuring element &lt;i&gt;B&lt;/i&gt; used here is a circle and its origin is set to be at the origin.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhq5fp1HWVIqn3npnbfOY3_4ULvDvA7IfNG_lvIT5Lbn79YTD8GfIFT-9Eqa8svVbWu-8CaOdZjAy6GISMVzdJ5LoKaYj6orLcbSqNLgLTqhJ6ntR8wqJmkJyixTEnEW6Ik3RW5bSIM-8Ft/s1600/compilation+open.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhq5fp1HWVIqn3npnbfOY3_4ULvDvA7IfNG_lvIT5Lbn79YTD8GfIFT-9Eqa8svVbWu-8CaOdZjAy6GISMVzdJ5LoKaYj6orLcbSqNLgLTqhJ6ntR8wqJmkJyixTEnEW6Ik3RW5bSIM-8Ft/s1600/compilation+open.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The result using the opening operator.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div&gt;Using &lt;b&gt;bwlabel &lt;/b&gt;function in Scilab&amp;nbsp;to label all connected parts (or blobs) in the sub-images and compute for the area of each blob, the histogram of the area computed is shown below.&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcSSRB8AF66_mtGnMFxOFhkW-weCL-iuNVtecTlUmpMMTn92KyxW0tJGNLdbFM3xthsHkMyA2ayLCbApIc1y_KB_CODs4Nrk2IK1cJ8Em0G3J70K6OT8eyNHbMUykj918CJSs4TP9gsaf7/s1600/histplot+area+open.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;313&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcSSRB8AF66_mtGnMFxOFhkW-weCL-iuNVtecTlUmpMMTn92KyxW0tJGNLdbFM3xthsHkMyA2ayLCbApIc1y_KB_CODs4Nrk2IK1cJ8Em0G3J70K6OT8eyNHbMUykj918CJSs4TP9gsaf7/s640/histplot+area+open.bmp&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: left;&quot;&gt;The histogram of the area computed using &lt;b&gt;bwlabel&lt;/b&gt;. The peak is at around&amp;nbsp;531.25. And the range of values clustering around this peak is from&amp;nbsp;387.5 to 571.875.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div&gt;To find the best estimate for the cell size of the given image, we find the mean of the area values that fall on the specified range, as well as its standard deviation using the &lt;b&gt;mean&lt;/b&gt; and &lt;b&gt;stdev&lt;/b&gt; functions in Scilab, respectively. The best estimate for the cell size is&amp;nbsp;490.71&amp;nbsp;±&amp;nbsp;46.97. The actual area of the cell is found by manually measuring its pixel dimensions &amp;nbsp;in &lt;i&gt;Paint&lt;/i&gt;. The value obtained is 530.93. This differs from the mean obtained but still falls on the range found.&lt;br /&gt;
&lt;br /&gt;
Now we move on to a more complicated task: that is to identify cancer cells in a given image containing normal cells and those that are cancerous, i.e., cancer cells. The following figure below shows the image used in this part of the activity.&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyI7EEuzs9N9W6m_ypVzOKxLO-hMVkML5t2f67hNP1AuhaShB3Jg9WBOwMyfx-E7xfQmjoH6Nv6zwnHbrzVc51O2QPhVgP1JOSLQmOb0jMm2_FMIb6EGVLoH5-pKR5OppovykbZjwp4ZZv/s1600/Circles+with+cancer.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;264&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyI7EEuzs9N9W6m_ypVzOKxLO-hMVkML5t2f67hNP1AuhaShB3Jg9WBOwMyfx-E7xfQmjoH6Nv6zwnHbrzVc51O2QPhVgP1JOSLQmOb0jMm2_FMIb6EGVLoH5-pKR5OppovykbZjwp4ZZv/s320/Circles+with+cancer.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;A digital image containing punched papers of two different sizes which correspond to normal cells and cancer cells.&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;We are to apply binary operations on the image in order to identify the 5 cancer cells that are present. The first thing that needs to be done is to view the histogram of the grayscale version of the image. This histogram is shown below. Notice that there exist two regions where the pixel values tend to cluster. Between these lie the threshold value that we want and it is obviously at around 0.843.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI88AoW_HudQXgKsUuGxnpv4unness63stTD52YtPBTBvN6fUpjR0KVm_7XgOPSZLaKik5-yK1npE8RQDIY7NeMCUjEKEWruj9C_reA7pvZBm_dGOGfy4Rn5iW7I-60gQLYwbP7BEOD_zB/s1600/histplot+of+cancer+cells.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;207&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI88AoW_HudQXgKsUuGxnpv4unness63stTD52YtPBTBvN6fUpjR0KVm_7XgOPSZLaKik5-yK1npE8RQDIY7NeMCUjEKEWruj9C_reA7pvZBm_dGOGfy4Rn5iW7I-60gQLYwbP7BEOD_zB/s400/histplot+of+cancer+cells.bmp&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: left;&quot;&gt;Histogram of the image containing cancer cells. A good threshold value is somewhere around &amp;nbsp;0.843 as seen on the image.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;We are now ready to convert the image to binary using the threshold value that we found. The result is shown below.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXZfk6nd1wGzvt662BS7HzxqO_jzSKuqmU3wn-nXMdzwlacVw92HbvtYcZW9dpCXyxEzcpv0qSO-o9prT9Q-wc7n8Rx5ImjZwF4-Vpz5aNw26emwACvU7GXAF8nRmm9IsbS7zLjIbIQHY5/s1600/bw+cancer+cells.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;263&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXZfk6nd1wGzvt662BS7HzxqO_jzSKuqmU3wn-nXMdzwlacVw92HbvtYcZW9dpCXyxEzcpv0qSO-o9prT9Q-wc7n8Rx5ImjZwF4-Vpz5aNw26emwACvU7GXAF8nRmm9IsbS7zLjIbIQHY5/s320/bw+cancer+cells.bmp&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The result upon converting the image to binary.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;The binary image shown above is too noisy to process. We then apply morphological operations to it in order to remove the unnecessary pixels in the image as a result of the threshold process. The same technique utilized earlier on sub-images containing punched papers of equal sizes will be used here, i.e., the opening operation. The result of this operation on our binary image is shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKIvHpHZtJ97gmKkAyNMkgv7VocbJICf7uZQF_Kachij18tdomBB8YeJFB6CCYB8KnBgJMy8TrU99bBHENBXIVlc01SQt9SdqvEBHwPt7n8i5vE-OsxZihuK6zhIrZJGQqAMZ6aMCcca6g/s1600/open_cancer58.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;264&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKIvHpHZtJ97gmKkAyNMkgv7VocbJICf7uZQF_Kachij18tdomBB8YeJFB6CCYB8KnBgJMy8TrU99bBHENBXIVlc01SQt9SdqvEBHwPt7n8i5vE-OsxZihuK6zhIrZJGQqAMZ6aMCcca6g/s320/open_cancer58.bmp&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The result after using the opening operator.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;These time the noise found on the previous image is no longer present. In order to tag a cancer cell found on the image, we need to have an idea of its size. This can be done by looking on the histogram of area of the cells in the figure presented previously. This histogram is displayed below. Notice that there exist three regions on the histogram wherein cell sizes tend to cluster. We may assume that these correspond to the normal cells,&amp;nbsp;cancer cells and&amp;nbsp;&amp;nbsp;finally&amp;nbsp;overlapping normal cells. Previously we have determined where the normal cells in the histogram lie and it is found to be at around 500. It is okay to assume that the range of areas of the cancer cells in the image lies somewhere between 870 to 1020. The remaining region belongs to those normal cells that are overlapping. Averaging the areas that lie between the predicted range and computing for the standard deviation give us a best estimate of 940.83333&amp;nbsp;±&amp;nbsp;58.020111 pixels for the cell size of a cancer cell.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu3v7I94VqHRSeG-hlCykWQqbGNe-pDcfG1WltFqU4E7dEGsAfKGdReoWz_lvfXAGJNoqOlzQCBJ3yYnVxL_FvbAYaUyd00Fm4-nh8Iq13lU0vw-VKQR7RhKlGWOXsLKmfxojKWieubCg0/s1600/area+histplot+of+cancer+cellsopen.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;207&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu3v7I94VqHRSeG-hlCykWQqbGNe-pDcfG1WltFqU4E7dEGsAfKGdReoWz_lvfXAGJNoqOlzQCBJ3yYnVxL_FvbAYaUyd00Fm4-nh8Iq13lU0vw-VKQR7RhKlGWOXsLKmfxojKWieubCg0/s400/area+histplot+of+cancer+cellsopen.bmp&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Histogram for areas of the cells contained in the processed image.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;For tagging the cancer cells, we are to evaluate each labeled part in the image whether its area is within the range of values for area of a cancel cell or not. If it falls in this range, there is a high chance that the said labeled part is a cancer cell. The result is shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoYXh9HcAv-b6ih3_n8g_rinGHGM_Kw9F-o2MyCt-VTJKD6yV7_RznpQXQgxFYEe5oZX5G2_17AM0tq_3oEaHFdm4noYT59-QB5s8U0supeBHn5MN1YeAL5Wd3GnczmAk1MxVHjqjko5ja/s1600/result+using+open.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;264&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoYXh9HcAv-b6ih3_n8g_rinGHGM_Kw9F-o2MyCt-VTJKD6yV7_RznpQXQgxFYEe5oZX5G2_17AM0tq_3oEaHFdm4noYT59-QB5s8U0supeBHn5MN1YeAL5Wd3GnczmAk1MxVHjqjko5ja/s320/result+using+open.bmp&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: left;&quot;&gt;The final result! The 5 cancer cells are tagged but also included are some areas corresponding to overlapping cells in the image given.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Our result suggests that the process done is not 100% accurate, i.e., only the cancer cells are tagged. There are a lot of factors why such result is obtained. The regions of overlapping normal cells may have an area which falls in the given range. If the image used contains cells that are completely isolated from each other, this &amp;nbsp;screening process will no longer be a problem at all. But remember, in real images of cells, for example, it is very rare to see cells that are completely isolated from each other. The solution is, therefore, to improve the implementation process, i.e., from obtaining a good threshold value to the morphological operations to be used and predicting the region in the area histogram corresponding to cancer cells. There are a lot of improvements to be done. But for a beginner like me, these results are already satisfying. And for that I am giving myself a grade of 10.&amp;nbsp;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anythingphysics.blogspot.com/feeds/1270812906580407983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anythingphysics.blogspot.com/2011/08/binary-operations.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/1270812906580407983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/1270812906580407983'/><link rel='alternate' type='text/html' href='http://anythingphysics.blogspot.com/2011/08/binary-operations.html' title='Binary Operations'/><author><name>Jen-Jen Manuel</name><uri>http://www.blogger.com/profile/17781945162053242109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio7WYdtUaWDpY0vUR8rmhXb6vLXc_NJhfW7210lMlbkFxjcoaf31CZ38KIuNSzomRZXPSXX9zYuME75wQBlwP99KltNLXSivQIMcdocBxzVUhe4t36aIu_krVWKUOErA4/s220/49936_1530407762_2876926_n.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6NCS5kBvVZV56QTlsNFr0ZK0xy-dIGTNJrWooiVd9TUpJPxY5BYAfP33H9VtGNPsSN5VwTQnRRfXzjVnDA0WTo28-1szRPUK7QnBLkmjmABlP7Bs8rPQt-vbSjQfMZ_0F5f-PaEXTxlk2/s72-c/Circles002.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2748687604404631686.post-7883877284632962996</id><published>2011-07-27T00:29:00.000+08:00</published><updated>2011-08-25T20:44:39.498+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dilate"/><category scheme="http://www.blogger.com/atom/ns#" term="erode"/><title type='text'>Morphological Operations</title><content type='html'>Morphology in image processing refers to shape or structure. Morphological operations are done on binary images in image processing in order to extract more information or to enhance the quality of the image. These said operations affect the shape of the image depending on the output of the a given operation. Using these operations, disconnected blobs, for example, can be joined, shapes found on the image may either be expanded or thinned, and loops can also be closed. These are just some of the many things that can be done using morphological operations. &lt;br /&gt;
&lt;br /&gt;
In a binary image, all pixels having a value of 0 are considered to be part of the background. On the other hand, all pixels having a value of 1 are part of the foreground. It is important to recall some basics in Set Theory since morphological operations have its backbone on this.&lt;br /&gt;
&lt;br /&gt;
Let &lt;i&gt;A&lt;/i&gt; be a set in 2-D integer space &lt;i&gt;Z&lt;/i&gt;&lt;sup&gt;2&lt;/sup&gt;.The elements of &lt;i&gt;Z&lt;/i&gt;&lt;sup&gt;2&lt;/sup&gt; are the (&lt;i&gt;x, y&lt;/i&gt;) locations of pixels in the image.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;If &lt;i&gt;a&lt;/i&gt; = (&lt;i&gt;x, y&lt;/i&gt;) is an element of &lt;i&gt;A&lt;/i&gt; and &lt;i&gt;b&lt;/i&gt; is not an element of &lt;i&gt;A&lt;/i&gt;, then &lt;/li&gt;
&lt;/ul&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/AVvXsEjSNZH8G6dnHL-ZrXps-79jyS8EcRI07oTUahBAPcIZUsz83VmsQmBu80aUmTh_ju3zVo4ICOkjznpPewD2DGs2HeeX9AmuX2bOo1mh7vqnVOv2dVupjBjKYAYAJ8zgrx9WetxtDL0jjjlk/s1600/1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;158&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSNZH8G6dnHL-ZrXps-79jyS8EcRI07oTUahBAPcIZUsz83VmsQmBu80aUmTh_ju3zVo4ICOkjznpPewD2DGs2HeeX9AmuX2bOo1mh7vqnVOv2dVupjBjKYAYAJ8zgrx9WetxtDL0jjjlk/s200/1.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;If &lt;i&gt;A&lt;/i&gt; is a subset of another set &lt;i&gt;B&lt;/i&gt;, then&lt;/li&gt;
&lt;/ul&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/AVvXsEgPJJ6_CB8rpwwzv9f2d2Vx__TdPXb1F5XC1FpWiPsiOEDOCmoLjqlnQkP60miitKoyA1nBLPFcOrajHM6pwF8MTsm0C3xevGhB5g3CjfhFLLj23ynZ0BMg8k4p566ypOLPYo0UjUBOW56X/s1600/2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&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/AVvXsEjVw79s237PUk1Ljfp7JIwR4Do0se2eObDc5rMi5Q-oxDD1PFlYrvmr2ONeUaxB-Dn-3Oo8s5J22yA56iNFuHTgMm1MffgWWU6_ZhmrsioewLWbsneWceHr2MUwlAMvrnBM-lcalGThKzjn/s1600/2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;119&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVw79s237PUk1Ljfp7JIwR4Do0se2eObDc5rMi5Q-oxDD1PFlYrvmr2ONeUaxB-Dn-3Oo8s5J22yA56iNFuHTgMm1MffgWWU6_ZhmrsioewLWbsneWceHr2MUwlAMvrnBM-lcalGThKzjn/s200/2.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;ul&gt;&lt;li&gt;The union of two sets &lt;i&gt;A&lt;/i&gt; and &lt;i&gt;B&lt;/i&gt; is the set of all elements that belong to &lt;i&gt;either&lt;/i&gt; &lt;i&gt;A&lt;/i&gt; or &lt;i&gt;B&lt;/i&gt;.&lt;/li&gt;
&lt;/ul&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/AVvXsEiY0w-CjaBUppiL_vPz7qtSJrtkpg-D1sAD_D5O42w_s9TNxw12idjRqtV8bRJq91gOpwy51FQHfmz6E20AtxjxMp9MgnB41GfYov1_K38i5QhdAaViP8P52UsyUkplrDXPGQy7X0c4qC59/s1600/3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;131&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY0w-CjaBUppiL_vPz7qtSJrtkpg-D1sAD_D5O42w_s9TNxw12idjRqtV8bRJq91gOpwy51FQHfmz6E20AtxjxMp9MgnB41GfYov1_K38i5QhdAaViP8P52UsyUkplrDXPGQy7X0c4qC59/s200/3.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;The intersection of two sets &lt;i&gt;A&lt;/i&gt; and &lt;i&gt;B&lt;/i&gt; is the set of all elements that are &lt;i&gt;both&lt;/i&gt; in &lt;i&gt;A&lt;/i&gt; and &lt;i&gt;B&lt;/i&gt; only.&lt;/li&gt;
&lt;/ul&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/AVvXsEibADVSvcXlgJ0cwtPf5fUODROvllezNx17w-9C2V300SnrtbjOTiTN0w09ulLHSkh89hb2RqhOjiMBSceIwd5JuGz7fro_g3Kbm0JGQecKiUoKhboipDVnulCZ5UpnJAu3F5CPeI3tTUvW/s1600/4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibADVSvcXlgJ0cwtPf5fUODROvllezNx17w-9C2V300SnrtbjOTiTN0w09ulLHSkh89hb2RqhOjiMBSceIwd5JuGz7fro_g3Kbm0JGQecKiUoKhboipDVnulCZ5UpnJAu3F5CPeI3tTUvW/s1600/4.png&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;ul&gt;&lt;li&gt;&amp;nbsp;Two sets are said to be mutually exclusive if they have no common elements, i.e.,&lt;/li&gt;
&lt;/ul&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/AVvXsEidE62IjnJ9ybAjXcRxZ2ireI7hAq4BjGLD6gl-YkOfrHa1yjBuxlOZEDlHl1MzdFUW6OXbYefxvK9uYpvQR3jAXk0wc2a5vOGuRkmlSD251D498crf6zHsbZHrsw_90FW9O6YsWCjbs9jT/s1600/5.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;60&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidE62IjnJ9ybAjXcRxZ2ireI7hAq4BjGLD6gl-YkOfrHa1yjBuxlOZEDlHl1MzdFUW6OXbYefxvK9uYpvQR3jAXk0wc2a5vOGuRkmlSD251D498crf6zHsbZHrsw_90FW9O6YsWCjbs9jT/s1600/5.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;The complement of a set &lt;i&gt;A&lt;/i&gt; is the set of elements not contained in &lt;i&gt;A&lt;/i&gt;.&lt;/li&gt;
&lt;/ul&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/AVvXsEgzrcYaNdR0yIjAsdQBwiP77jg8E3h8Z9-SZ__ZltWRxcuRWGuMrNvqTi4vpDtJv6g8VLwvrTTRUp0-zeuXZX4__LasYst7fy2_OHvsH4tW01yfxIrFKYEL9pLNR-cmM0MPK8tLvxLUo0mu/s1600/6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;140&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzrcYaNdR0yIjAsdQBwiP77jg8E3h8Z9-SZ__ZltWRxcuRWGuMrNvqTi4vpDtJv6g8VLwvrTTRUp0-zeuXZX4__LasYst7fy2_OHvsH4tW01yfxIrFKYEL9pLNR-cmM0MPK8tLvxLUo0mu/s200/6.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;The difference of two sets &lt;i&gt;A&lt;/i&gt; and &lt;i&gt;B&lt;/i&gt; denoted by &lt;i&gt;A&lt;/i&gt;-&lt;i&gt;B&lt;/i&gt; is defined as all elements of &lt;i&gt;A&lt;/i&gt; excluding all elements of &lt;i&gt;B&lt;/i&gt;.&lt;/li&gt;
&lt;/ul&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/AVvXsEgsxllotMZR9c5KGY1H-HXAnYnv9nCEHKCpxKSc717BvaCHau3MyIHjzCZbt9jzhyL396LXm-R79tqJYeYXW2HEfDe-TJXNQbQrpbnzhZ0aJvCUwuGJV7zbfRBWst-XTwl81eADQ05YNMBD/s1600/7.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;103&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsxllotMZR9c5KGY1H-HXAnYnv9nCEHKCpxKSc717BvaCHau3MyIHjzCZbt9jzhyL396LXm-R79tqJYeYXW2HEfDe-TJXNQbQrpbnzhZ0aJvCUwuGJV7zbfRBWst-XTwl81eADQ05YNMBD/s200/7.png&quot; width=&quot;200&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;ul&gt;&lt;li&gt;&amp;nbsp;The reflection of set &lt;i&gt;A&lt;/i&gt; is defined and shown below.&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRpErLaZ6z5UtFisKnZ6ZziP9wrdKNHcoyJUn9CNYUVzPByc8mwVMWSuhyphenhyphenvYfLFrJ7Oserhcs4gRe1AcX_XD_mX_F9mHqhvcxVg07uOyMMpxK4AgHpdguDg-COrYTnVYqH8QYlnFYvc4yt/s1600/8.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;173&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRpErLaZ6z5UtFisKnZ6ZziP9wrdKNHcoyJUn9CNYUVzPByc8mwVMWSuhyphenhyphenvYfLFrJ7Oserhcs4gRe1AcX_XD_mX_F9mHqhvcxVg07uOyMMpxK4AgHpdguDg-COrYTnVYqH8QYlnFYvc4yt/s200/8.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&amp;nbsp;The translation of set &lt;i&gt;A&lt;/i&gt; by point &lt;i&gt;z&lt;/i&gt; = (&lt;i&gt;z&lt;sub&gt;1&lt;/sub&gt;&lt;/i&gt;, &lt;i&gt;z&lt;sub&gt;2&lt;/sub&gt;&lt;/i&gt;) denoted by &lt;i&gt;(A)&lt;sub&gt;z&lt;/sub&gt;&lt;/i&gt; is defined and illustrated below.&lt;/li&gt;
&lt;/ul&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/AVvXsEj9y5GkEiqcWwBDu9ye7AZsFGhyphenhyphenSoj19X8NxCsQKSOHiInyLq8vWisybsFW2Cci2wrx-DKot1V4ThPfyqyPrkGTAUTlZ3hq35pICiwaSlxSMbMPyr6y56eENlQEH17iLBh-4jISp9FvCndo/s1600/1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;185&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9y5GkEiqcWwBDu9ye7AZsFGhyphenhyphenSoj19X8NxCsQKSOHiInyLq8vWisybsFW2Cci2wrx-DKot1V4ThPfyqyPrkGTAUTlZ3hq35pICiwaSlxSMbMPyr6y56eENlQEH17iLBh-4jISp9FvCndo/s200/1.png&quot; width=&quot;200&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&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Note that the &lt;i&gt;NOT&lt;/i&gt; operator is similar to complement and &lt;i&gt;AND&lt;/i&gt; is equal to intersection. Moreover, the &lt;i&gt;OR&lt;/i&gt; operator is the same as union and &lt;i&gt;XOR&lt;/i&gt; can be written as a combination of &lt;i&gt;NOT&lt;/i&gt;, &lt;i&gt;AND&lt;/i&gt; and &lt;i&gt;OR&lt;/i&gt; which is expressed as&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/AVvXsEjharzkCFa4EDUUE2Ys2qUBaPoMHXMC47i2jk3V4kUkac6FqFSyeetEkwOIaNh3q3a8zY1wYAPTdp1nZwz1r5qUC0O3OlG3LXCZCtA5SSqJMA6l3NvFyZ0l4Tjy44FNuIj3PCIkkNtj8Qu6/s1600/XOR.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjharzkCFa4EDUUE2Ys2qUBaPoMHXMC47i2jk3V4kUkac6FqFSyeetEkwOIaNh3q3a8zY1wYAPTdp1nZwz1r5qUC0O3OlG3LXCZCtA5SSqJMA6l3NvFyZ0l4Tjy44FNuIj3PCIkkNtj8Qu6/s1600/XOR.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp;We now proceed to some morphological operations such as dilation and erosion.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Dilation &lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;The dilation of &lt;i&gt;A&lt;/i&gt; by &lt;i&gt;B&lt;/i&gt; is defined as&amp;nbsp;&lt;/span&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/AVvXsEi45X3-g8h7f9hQOzarHHpjk6ySjMuOip5eafuiXjZ01gj38P1yOTmUQBlAkrjUvRYJpItdijddcg4HLvu6WkiXpOm3p3etB18LBrHXXZQ1jmKeU2u6FkE-I6R2Kx-eQ4njuMY-12nhO72J/s1600/dilation.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi45X3-g8h7f9hQOzarHHpjk6ySjMuOip5eafuiXjZ01gj38P1yOTmUQBlAkrjUvRYJpItdijddcg4HLvu6WkiXpOm3p3etB18LBrHXXZQ1jmKeU2u6FkE-I6R2Kx-eQ4njuMY-12nhO72J/s1600/dilation.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;and thus involves all &lt;i&gt;z&lt;/i&gt;&#39;s which are translations of the reflection of &lt;i&gt;B&lt;/i&gt; that when intersected with &lt;i&gt;A&lt;/i&gt; the result is not an empty set. Note that the translation of &lt;i&gt;B&lt;/i&gt; is relative to its origin. In an image, the origin of a set is located at its left topmost corner. Moreover, the origin can also be the geometric center of the set. Here, &lt;i&gt;B&lt;/i&gt; is the structuring element. Therefore, the effect of dilation is to expand or elongate A in the shape of B. The figure shown below illustrates how dilation works.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQvK10yPgCM6L52HC4edh-XVfZ0xBo6NjUp0MfvcJHGEHLlScT-J8ZDRxqOUwN06MCqrCb3694mb1RUuUW_ePpoGQkdcKDh9Ne0mkBlcvKCFOFRr0wkwEv8bxOboLz6JNe51G3CQIx9naG/s1600/dilation+1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;97&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQvK10yPgCM6L52HC4edh-XVfZ0xBo6NjUp0MfvcJHGEHLlScT-J8ZDRxqOUwN06MCqrCb3694mb1RUuUW_ePpoGQkdcKDh9Ne0mkBlcvKCFOFRr0wkwEv8bxOboLz6JNe51G3CQIx9naG/s320/dilation+1.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The dilation of A by B results to an expanded version of A.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Erosion&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;The erosion of &lt;i&gt;A&lt;/i&gt; by &lt;i&gt;B&lt;/i&gt; is defined as&lt;br /&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/AVvXsEiOJh2-jDr7DL1IV2w8k-ABJ2vQm9H4pO2t4NWka71lJgjAsn-A97RaR7MBYJUFJT5en7Yl3ZRp6A1c5Dqmk1m3LDEfJQuB4_yAXcBKGwSzAbxd2768J4yfNcQp9mABE5Xbk4hWkdwwNsBs/s1600/erosion.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOJh2-jDr7DL1IV2w8k-ABJ2vQm9H4pO2t4NWka71lJgjAsn-A97RaR7MBYJUFJT5en7Yl3ZRp6A1c5Dqmk1m3LDEfJQuB4_yAXcBKGwSzAbxd2768J4yfNcQp9mABE5Xbk4hWkdwwNsBs/s1600/erosion.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;and it is the set of all points &lt;i&gt;z&lt;/i&gt; such that &lt;i&gt;B&lt;/i&gt; translated by &lt;i&gt;z&lt;/i&gt; is contained in &lt;i&gt;A&lt;/i&gt;. Unlike dilation, the effect of erosion is to reduce the image such that its shape is similar to &lt;i&gt;B&lt;/i&gt;. The figure below illustrates how erosion works.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBnhX3aGw5OcU4NlXI3LmCod8e1sFIrKpOgbNxLAzHNpHAgJt-y1UJ1SGPjkjoEf_6iZIagHX7QNI5JYUWPWZf3EaOjq6HzFVkT__3jy-fECpf9FkEHKkUPjXt_RLe4DctkJVsjVFQz0wx/s1600/erosion1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;98&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBnhX3aGw5OcU4NlXI3LmCod8e1sFIrKpOgbNxLAzHNpHAgJt-y1UJ1SGPjkjoEf_6iZIagHX7QNI5JYUWPWZf3EaOjq6HzFVkT__3jy-fECpf9FkEHKkUPjXt_RLe4DctkJVsjVFQz0wx/s320/erosion1.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The erosion of A by B leads to a reduced version of A that inherits the shape of B.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;We now proceed on the application of these operations on different image shapes. The structuring elements shown below will be used for both dilation and erosion of different image shapes. Note that the &lt;i&gt;origin&lt;/i&gt; is set to be at the &lt;i&gt;top leftmost corner&lt;/i&gt; of the structuring element.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhi-QieM0KQ89yOhyphenhyphenZElvh5Rs_1JDqaxlXA74u7o_OjU3HX7yiEDNtJ6M_7mZjJ6uPa_Ge5GvMoHjn1MFm3OT6VcJW_Oo554PbgrkZ3KXJDJlwLoK3kJmjNvLqa8ZweMbdHzU_LvgZLUjzz/s1600/structuring+elements.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;90&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhi-QieM0KQ89yOhyphenhyphenZElvh5Rs_1JDqaxlXA74u7o_OjU3HX7yiEDNtJ6M_7mZjJ6uPa_Ge5GvMoHjn1MFm3OT6VcJW_Oo554PbgrkZ3KXJDJlwLoK3kJmjNvLqa8ZweMbdHzU_LvgZLUjzz/s320/structuring+elements.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The structuring elements used in the dilation and erosion of different image shapes: 1) 2x2 ones; 2) 2x1 ones; 3) 1x2 ones; 4) cross, 3 pixels long and 1 pixel thick; 5) a diagonal line, 2 boxes long. &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;We first find the dilation and erosion of a 5x5 square by the different structuring elements shown above. &lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjk7EoenU0GvIsOJlgP40GWfgXsf6PHnUkqXFtXBDN99B69fLZggoaOsVJPIzD0PJNQl0Tcu-cP2dsASmA0Zio9DAGyyvfPJ_D3cIpD5gK5KLblTT7fmSCurHXVJ1mphH6riNHltsWXtbKV/s1600/orig.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;157&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjk7EoenU0GvIsOJlgP40GWfgXsf6PHnUkqXFtXBDN99B69fLZggoaOsVJPIzD0PJNQl0Tcu-cP2dsASmA0Zio9DAGyyvfPJ_D3cIpD5gK5KLblTT7fmSCurHXVJ1mphH6riNHltsWXtbKV/s320/orig.bmp&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;5x5 square.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwUlZNAAYrvhe9y-Ramz-WVJW5ILUSSWCD5gkDakIfGHnTkJyOd33E16rQ63Rphx6iSs1y5q-uQzQ37gqUcfkFb4thRoHZ-WPbkjUG0pP1umaaOPyGbpEDWUgkwL8R_j_Cxu0c_BeyaNoR/s1600/dilate+predicted.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;145&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwUlZNAAYrvhe9y-Ramz-WVJW5ILUSSWCD5gkDakIfGHnTkJyOd33E16rQ63Rphx6iSs1y5q-uQzQ37gqUcfkFb4thRoHZ-WPbkjUG0pP1umaaOPyGbpEDWUgkwL8R_j_Cxu0c_BeyaNoR/s640/dilate+predicted.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;My predictions for the dilation of the 5x5 square shown on the left by the different structuring elements.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;The shaded part (both green and gray) on the images above corresponds to the white part of the images below.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtdfToF6zH8yUTjbst4H7mgIXXxzBDh6O-V_wfg_r90pUKCV9oG9a4VWXmVfaDovlPBDumgJzMS66Og06AJmMqf1hxDoVrzmgB11h2woUej5nBavmkA1nkN3HJyFkYYPTL3cXRDSliIgQ0/s1600/scilab+dilate.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;78&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtdfToF6zH8yUTjbst4H7mgIXXxzBDh6O-V_wfg_r90pUKCV9oG9a4VWXmVfaDovlPBDumgJzMS66Og06AJmMqf1hxDoVrzmgB11h2woUej5nBavmkA1nkN3HJyFkYYPTL3cXRDSliIgQ0/s400/scilab+dilate.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The result using the function &lt;b&gt;dilate()&lt;/b&gt; in Scilab.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;For the erosion of the given shape, my predictions are shown below.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEix1z0puZ0zHtH79olvAaM_t5lA4imLnBkUtDSvmd4EKo29kwsEjIbcLd09YvC9UEjF9XRraaJg3r5d_borKjbwRpJ-4iq7T3a3Zm4CSL3UWaCFp_kE-spQy8wV0W1mk0-Hyl6y-0IPiKpJ/s1600/erode+predicted.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;148&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEix1z0puZ0zHtH79olvAaM_t5lA4imLnBkUtDSvmd4EKo29kwsEjIbcLd09YvC9UEjF9XRraaJg3r5d_borKjbwRpJ-4iq7T3a3Zm4CSL3UWaCFp_kE-spQy8wV0W1mk0-Hyl6y-0IPiKpJ/s640/erode+predicted.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;My predictions for the erosion of the 5x5 square shown on the left by the different structuring elements.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;And the results using Scilab are presented below.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQLRgzgafi0wt9ejZwm51o2n7J8l2AYURZ25NQEmKNduDf6VrMQ7rC1h9pfu_8uWWAfHwFD6atg37oejUm-Lh0sOpd1UepRqmRIWwD6mgLzXcgE1Dev9EmAH3ubDWy9oRhBs659fjIKJy9/s1600/scilab+erode.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;80&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQLRgzgafi0wt9ejZwm51o2n7J8l2AYURZ25NQEmKNduDf6VrMQ7rC1h9pfu_8uWWAfHwFD6atg37oejUm-Lh0sOpd1UepRqmRIWwD6mgLzXcgE1Dev9EmAH3ubDWy9oRhBs659fjIKJy9/s400/scilab+erode.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The output using the &lt;b&gt;erode()&lt;/b&gt; function in Scilab.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Time to move on now to the dilation and erosion of a triangle having a base of length 4 pixels and height of length 3 pixels.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXKm-kEr4PAK2G8vG259ZvTViHZ6jG-a80bVUF-cIboU6oM6gi91QbVjmCT1Cz3cbA3wxHBD3QNcB_e_L-Cv4eQgvlzXhRtdJmbWyc5A5yzUGmDw6iSmDU47YNOf319gSXKPwcsL0DPY4m/s1600/orig.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;157&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXKm-kEr4PAK2G8vG259ZvTViHZ6jG-a80bVUF-cIboU6oM6gi91QbVjmCT1Cz3cbA3wxHBD3QNcB_e_L-Cv4eQgvlzXhRtdJmbWyc5A5yzUGmDw6iSmDU47YNOf319gSXKPwcsL0DPY4m/s320/orig.bmp&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;A triangle having a height of 3 pixels and base of 4 pixels.&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkAsUpEPmNJBuqAfpDkTwNqvS2dJ2GFiEaCGfEpr3eRyQpTVofsci4s4-iOGWoGedRxuxxm9cW9PgGi-CPtyrxmXDoEmFiQleB7pCsRbxYG8rUuBadNiLptaQTya3mFiDWeBf2PhihxvMq/s1600/dilate+predicted.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;126&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkAsUpEPmNJBuqAfpDkTwNqvS2dJ2GFiEaCGfEpr3eRyQpTVofsci4s4-iOGWoGedRxuxxm9cW9PgGi-CPtyrxmXDoEmFiQleB7pCsRbxYG8rUuBadNiLptaQTya3mFiDWeBf2PhihxvMq/s640/dilate+predicted.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;My predictions for the dilation of the 3x4 triangle shown on the left by the different structuring elements.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0e2gdNtuxbVRIP7W7_rew3yyQ3oyZsPmj9C0c6l2x5WUgoX36z1Otn8LUN8LNZXxoDQMaz8_9AtAkyTb1AWFoVFAjz3jevA7BUc5ERB7nwpUSqNQd8_dDZ-_hvRw8Tu8CvqdrBgE8aJvH/s1600/scilab+dilate.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;68&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0e2gdNtuxbVRIP7W7_rew3yyQ3oyZsPmj9C0c6l2x5WUgoX36z1Otn8LUN8LNZXxoDQMaz8_9AtAkyTb1AWFoVFAjz3jevA7BUc5ERB7nwpUSqNQd8_dDZ-_hvRw8Tu8CvqdrBgE8aJvH/s400/scilab+dilate.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The result using &lt;b&gt;dilate()&lt;/b&gt; in Scilab.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyEb8kkcnlrwTdttJTU0w7QQcYjKJmZSDka6w-NnNhvajWVjjxiUuXmmzTNxjWbYEJ3aT2fUbyF1dfGFOKWyUSyKzl_U8yVi5ut6OKOux6D3DpffWyOMDdBhjVJnGlsQgsV0fUMu4WKMtJ/s1600/erode+predicted.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;122&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyEb8kkcnlrwTdttJTU0w7QQcYjKJmZSDka6w-NnNhvajWVjjxiUuXmmzTNxjWbYEJ3aT2fUbyF1dfGFOKWyUSyKzl_U8yVi5ut6OKOux6D3DpffWyOMDdBhjVJnGlsQgsV0fUMu4WKMtJ/s640/erode+predicted.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;My predictions for the erosion of the 3x4 triangle shown on the left by the different structuring elements.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZEHDl-t_0W9w_TxxBuwfiVHQxXxh9ozpKZhsnXBY6Y_6_1QBQhsR2SeYfUI5uflMGA9J_DO0-XSEs_9YTPHHwSiny7S5oxvnwpMKi_vipiB8AEUlA7TWlk2IrK_cOdOvFmFleTfGd-0N4/s1600/scilab+erosion.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;70&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZEHDl-t_0W9w_TxxBuwfiVHQxXxh9ozpKZhsnXBY6Y_6_1QBQhsR2SeYfUI5uflMGA9J_DO0-XSEs_9YTPHHwSiny7S5oxvnwpMKi_vipiB8AEUlA7TWlk2IrK_cOdOvFmFleTfGd-0N4/s400/scilab+erosion.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The result using &lt;b&gt;erode()&lt;/b&gt; in Scilab.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;For a hollow 10x10 square with thickness of 2 pixels on all sides, the predicted dilation and erosion of the said image are shown below together with the results using Scilab.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlrylBq4tRC0c5qDpCaYWMBxpSIgEphQX56rpLUfCJcDpScmztd3C_AjhdvPNgcMKziacIuW8xBTtSiahWjnDPhK_tkDdiV6AOFNXkgQgLCMY_XuD_Sr8xvBTW10XQ9yNwCHN_qs1HsAf4/s1600/orig.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;157&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlrylBq4tRC0c5qDpCaYWMBxpSIgEphQX56rpLUfCJcDpScmztd3C_AjhdvPNgcMKziacIuW8xBTtSiahWjnDPhK_tkDdiV6AOFNXkgQgLCMY_XuD_Sr8xvBTW10XQ9yNwCHN_qs1HsAf4/s320/orig.bmp&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;A 10x10 hollow square with a thickness of 2 pixels on all sides.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJOLJMJSZ1GvwLjYemSS1gDc-nMdLNz4Vswlp9iOo55MrJlDrv0J7N8mPsVoTUD9arOyB3fNzE8xkg6DmvFLxGaL5VuDUArDQ7zLnPVEGFvc-RchGehl9NxmaTizoe4GHL6073VmamLrnb/s1600/dilate+predicted.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;139&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJOLJMJSZ1GvwLjYemSS1gDc-nMdLNz4Vswlp9iOo55MrJlDrv0J7N8mPsVoTUD9arOyB3fNzE8xkg6DmvFLxGaL5VuDUArDQ7zLnPVEGFvc-RchGehl9NxmaTizoe4GHL6073VmamLrnb/s640/dilate+predicted.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;My predictions for the dilation of the given image by the different structuring elements.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0SGa9rzYSonYkRJgWp6JDVO5DgOxY35BEzFLET-u4Y1mqCnEISN3a5B7cwWBRlRADVgR05tJhYpo3hs_DRaWV1DPu5qLeBYwc1uMRqRLSWn8FT8fC9dcY15QU2oIAVgTpOXVVrIEnhdHw/s1600/scilab+dilate.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;78&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0SGa9rzYSonYkRJgWp6JDVO5DgOxY35BEzFLET-u4Y1mqCnEISN3a5B7cwWBRlRADVgR05tJhYpo3hs_DRaWV1DPu5qLeBYwc1uMRqRLSWn8FT8fC9dcY15QU2oIAVgTpOXVVrIEnhdHw/s400/scilab+dilate.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The results using the &lt;b&gt;dilate()&lt;/b&gt; function in Scilab.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinhU3-n3GmJ8hQcXv399Lz90GOeMWCT_pQ95PLpQiZmiBy-KOlb5e26rzBEJrqh4ti7ynosgaG_ZxNnjh4g2SMLAplQeYugO0Hkg7B6YxHOSB7O_RU_gIMXcd1lai7AXtFXsP5M2is8r-p/s1600/erode+predicted.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;132&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinhU3-n3GmJ8hQcXv399Lz90GOeMWCT_pQ95PLpQiZmiBy-KOlb5e26rzBEJrqh4ti7ynosgaG_ZxNnjh4g2SMLAplQeYugO0Hkg7B6YxHOSB7O_RU_gIMXcd1lai7AXtFXsP5M2is8r-p/s640/erode+predicted.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;My predictions for the erosion of the given image by the different structuring elements.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEist7Os4hHNG7sASs8_j3ZKsgRX86_KfQ0_te9UPJ4YzJelKTtpi27CRnZCP-tyyS1r7aZUm6rHfVmPqu1dx0S6s4JoKoxWuo-baWsT8UtBTCEPcmgwsnqiD0LH_pSS3gNcQ8WGt-zs3im0/s1600/scilab+erode.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;80&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEist7Os4hHNG7sASs8_j3ZKsgRX86_KfQ0_te9UPJ4YzJelKTtpi27CRnZCP-tyyS1r7aZUm6rHfVmPqu1dx0S6s4JoKoxWuo-baWsT8UtBTCEPcmgwsnqiD0LH_pSS3gNcQ8WGt-zs3im0/s400/scilab+erode.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The output using the&lt;b&gt; erode() &lt;/b&gt;function in Scilab.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Finally, we investigate the dilation and erosion of a plus sign of length 5 pixels along each line.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5n4cpE7gz-OoDhI1KUUklpZ4KEHEI7HgydShFLAbKenGC5SOPzXRgyZgbwSA1O1hMhhuVFSnyvfInmpTgyA_pxkfp3rNCost7SzPRKYIEdbHcFxhRF_PDX-LSgE5_clXs3KL-o66ji2SG/s1600/orig.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;157&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5n4cpE7gz-OoDhI1KUUklpZ4KEHEI7HgydShFLAbKenGC5SOPzXRgyZgbwSA1O1hMhhuVFSnyvfInmpTgyA_pxkfp3rNCost7SzPRKYIEdbHcFxhRF_PDX-LSgE5_clXs3KL-o66ji2SG/s320/orig.bmp&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;A plus sign having a length of 5 pixels along each line.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Its dilation and erosion are tabulated below together with some predictions I made for both operations.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwIv3xk1bz6cy-8JvLinaYAf6znHerhYGan3moZRhE1T-jywARUi_j9t221-5-vCoJw4WDWzY99BV-tc5ilAadV2jzOHhsT1ycwdtBI5t9b7PNPgr2Sw5aCq6edyTNTe5Lel5J1hkquuex/s1600/dilation+predicted.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;132&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwIv3xk1bz6cy-8JvLinaYAf6znHerhYGan3moZRhE1T-jywARUi_j9t221-5-vCoJw4WDWzY99BV-tc5ilAadV2jzOHhsT1ycwdtBI5t9b7PNPgr2Sw5aCq6edyTNTe5Lel5J1hkquuex/s1600/dilation+predicted.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The predictions for the dilation of the given object by the different structuring elements.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6DMao0Yry_1QdQaFtDK0hXCw3BRaYWQcESzlt5scVBspFXcsCqdlNrRPGb8lYWHgKygkFNPB-3GIUx_zJhMulM0Ld3NITmWsV7zcGw7bDsCh0xkCePFIys_2I8LOVvBk9-izGwj6dMiu7/s1600/scilab+dilate.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;78&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6DMao0Yry_1QdQaFtDK0hXCw3BRaYWQcESzlt5scVBspFXcsCqdlNrRPGb8lYWHgKygkFNPB-3GIUx_zJhMulM0Ld3NITmWsV7zcGw7bDsCh0xkCePFIys_2I8LOVvBk9-izGwj6dMiu7/s400/scilab+dilate.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The result using the &lt;b&gt;dilate()&lt;/b&gt; function in Scilab.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY96gjYnCDAC4XSsFsLdrD3LgcvYgCAb6JLnGdxwcreIUlyW6hyphenhyphen5DXmaV_URa9POULLxJGIi38JwZLYOlSbUPZRzieekdQW4ZBLnWIg0Pl2acxHPbfynFGTjgziljKUefxGtaKJ0gjwb-8/s1600/erode+predicted.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;148&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY96gjYnCDAC4XSsFsLdrD3LgcvYgCAb6JLnGdxwcreIUlyW6hyphenhyphen5DXmaV_URa9POULLxJGIi38JwZLYOlSbUPZRzieekdQW4ZBLnWIg0Pl2acxHPbfynFGTjgziljKUefxGtaKJ0gjwb-8/s640/erode+predicted.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;My predictions for the erosion of the said image.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ2zKKn9F8W8A44BxuBrD_kLO2XcCRtzlY2soIamOok9q6734fP4rBvyb1fRgFLsOFtepTTKKoDLxMuD7jdmYXrrN7lZ0LfS9CGelgkGpBRfSJJIPT40TO4IfQW5J1nP-Jhitq9zlXGWCf/s1600/scilab+erode.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;77&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ2zKKn9F8W8A44BxuBrD_kLO2XcCRtzlY2soIamOok9q6734fP4rBvyb1fRgFLsOFtepTTKKoDLxMuD7jdmYXrrN7lZ0LfS9CGelgkGpBRfSJJIPT40TO4IfQW5J1nP-Jhitq9zlXGWCf/s400/scilab+erode.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The output using the &lt;b&gt;erode()&lt;/b&gt; in Scilab.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;There are a lot of morphological operations available in Scilab like &lt;b&gt;thin()&lt;/b&gt; and &lt;b&gt;skel()&lt;/b&gt;. The function&lt;b&gt; skel()&lt;/b&gt;, for example, performs skeletonization of a binary object. This is similar to the function &lt;b&gt;thin()&lt;/b&gt; which performs thinning of binary objects. The figure below is created in Paint will serve as a test object for these operations. The results are also shown below.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibOPylJ0DhznANrnf-Rj2xqX-1JwlqVQ-bjLg32oltan2Y08R5Vx5GiNvbIwFZP7pqJ6XYn1SjaDG5rVP2Ok_vkdNJEYEfTHp5IyGg46-LQiJiGhvc8g27C9jfk1EqBxc3YnZySbW4rlT4/s1600/sample.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibOPylJ0DhznANrnf-Rj2xqX-1JwlqVQ-bjLg32oltan2Y08R5Vx5GiNvbIwFZP7pqJ6XYn1SjaDG5rVP2Ok_vkdNJEYEfTHp5IyGg46-LQiJiGhvc8g27C9jfk1EqBxc3YnZySbW4rlT4/s200/sample.png&quot; width=&quot;190&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Sample image.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Using &lt;b&gt;thin()&lt;/b&gt;, the following result is obtained. Notice that it returns the similar figure but this time it has thinner boundary lines.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1CwDTHouux9pm07kuEurdHm7LJyQOmiJnF9cv_v_kZZIqBaTh1ZdYdjJISyTThztPmVPNrDj2kpLON1W1ZhgXRsghtedNtiUgczIjjnkRuoLRFBHa1y9LOAzfU_mdii8n3xJcvPOYDYG7/s1600/thin.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1CwDTHouux9pm07kuEurdHm7LJyQOmiJnF9cv_v_kZZIqBaTh1ZdYdjJISyTThztPmVPNrDj2kpLON1W1ZhgXRsghtedNtiUgczIjjnkRuoLRFBHa1y9LOAzfU_mdii8n3xJcvPOYDYG7/s200/thin.png&quot; width=&quot;188&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The output of &lt;b&gt;thin()&lt;/b&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Moreover, using &lt;b&gt;skel()&lt;/b&gt;, the results are shown tabulated below for different key words in the argument of &lt;b&gt;skel()&lt;/b&gt;.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7JhNGAxl1B7hLoPnKzj2AThx3kZwFYUFXM64aD07ZYwx3gMq2NuEb2Z_rNPzy6H0FaeV2jX-L5fYfAQaafcBr6y-sloim6DMfVaHyPsPxpCNZFIqlPvwPsQvX85P8ncZQT41JtZvyz1ik/s1600/skel.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;111&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7JhNGAxl1B7hLoPnKzj2AThx3kZwFYUFXM64aD07ZYwx3gMq2NuEb2Z_rNPzy6H0FaeV2jX-L5fYfAQaafcBr6y-sloim6DMfVaHyPsPxpCNZFIqlPvwPsQvX85P8ncZQT41JtZvyz1ik/s1600/skel.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The &quot;skeleton&quot; of the sample image (left: exterior skeleton, middle: interior skeleton, right: both exterior and interior)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;The function &lt;b&gt;skel()&lt;/b&gt; is capable of computing both the background and foreground skeleton. The default that it outputs is the interior skeleton which is almost similar to the result using &lt;b&gt;thin()&lt;/b&gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Understanding how both operations work is a must-have when predicting their corresponding output for each case. And believe it or not, this had consumed much of my time. Nonetheless, I enjoyed doing this activity despite working 12 hours straight in front of my computer. I will give myself a grade of 10 for this since my predictions match with the results from Scilab.&lt;br /&gt;
&lt;ul&gt;&lt;/ul&gt;&lt;/div&gt;&lt;ul&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://anythingphysics.blogspot.com/feeds/7883877284632962996/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anythingphysics.blogspot.com/2011/07/morphological-operations.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/7883877284632962996'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/7883877284632962996'/><link rel='alternate' type='text/html' href='http://anythingphysics.blogspot.com/2011/07/morphological-operations.html' title='Morphological Operations'/><author><name>Jen-Jen Manuel</name><uri>http://www.blogger.com/profile/17781945162053242109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio7WYdtUaWDpY0vUR8rmhXb6vLXc_NJhfW7210lMlbkFxjcoaf31CZ38KIuNSzomRZXPSXX9zYuME75wQBlwP99KltNLXSivQIMcdocBxzVUhe4t36aIu_krVWKUOErA4/s220/49936_1530407762_2876926_n.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSNZH8G6dnHL-ZrXps-79jyS8EcRI07oTUahBAPcIZUsz83VmsQmBu80aUmTh_ju3zVo4ICOkjznpPewD2DGs2HeeX9AmuX2bOo1mh7vqnVOv2dVupjBjKYAYAJ8zgrx9WetxtDL0jjjlk/s72-c/1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2748687604404631686.post-4427995400940501333</id><published>2011-07-21T23:47:00.001+08:00</published><updated>2011-07-22T00:01:09.536+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="convolution"/><category scheme="http://www.blogger.com/atom/ns#" term="filter"/><category scheme="http://www.blogger.com/atom/ns#" term="line removal"/><category scheme="http://www.blogger.com/atom/ns#" term="ridge enhancement"/><title type='text'>Enhancement in the Frequency Domain</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;Any unnecessary pattern, noise for example, in an image can be eliminated by filtering its corresponding frequency in the Fourier domain. If this can be done, enhancement of the desired frequencies corresponding to some patterns in the image is also possible. These techniques sound so simple but some basics are to be mastered. And here are some of the things that must be considered and remembered when utilizing such methods.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;The Fourier transform of a convolution of two functions &lt;i&gt;f&lt;/i&gt; and &lt;i&gt;g&amp;nbsp; &lt;/i&gt;in space is the product of the Fourier transform of the functions.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;The convolution of a dirac delta and a function &lt;i&gt;f(t)&lt;/i&gt; outputs a replication of &lt;i&gt;f(t) &lt;/i&gt;in the location of the dirac delta.&lt;/li&gt;
&lt;/ul&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgP25azsRtCYld84lq6Y6R6H0USbZir8m-Gg0uoMFwB33zx6L_b53MHQCCZ3Tdp2zPoISVrgmSc3SpVypM2fQhDmBRB5oUT5kIBFf9p60WNPl6arU7jCNJbQNP2sjsX9YilYCznYNUJYXIi/s1600/diracdeltaconvolution+eqn.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgP25azsRtCYld84lq6Y6R6H0USbZir8m-Gg0uoMFwB33zx6L_b53MHQCCZ3Tdp2zPoISVrgmSc3SpVypM2fQhDmBRB5oUT5kIBFf9p60WNPl6arU7jCNJbQNP2sjsX9YilYCznYNUJYXIi/s1600/diracdeltaconvolution+eqn.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Convolution of a dirac delta and and function &lt;i&gt;f(t)&lt;/i&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
We now investigate these properties and see how they are applied in image enhancement in the frequency (or Fourier) domain. First, we will show how the convolution theorem applies. Each image shown below contains two identical objects, i.e., circles. The size of the circles is varied increasingly.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5VimC0FcwthLmYukXBYEk0poqgFd7RjeSgh4tYB2qE08CSf8Hkq6aOn-cLTj_l2AE1I9FlTh8-eNI0KVgGgowAxj7c1tResssthiDtICJMc0HYVdGPVj8iUPIfFtY8B4B-023PCW9NuQ1/s1600/circles+complied.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5VimC0FcwthLmYukXBYEk0poqgFd7RjeSgh4tYB2qE08CSf8Hkq6aOn-cLTj_l2AE1I9FlTh8-eNI0KVgGgowAxj7c1tResssthiDtICJMc0HYVdGPVj8iUPIfFtY8B4B-023PCW9NuQ1/s320/circles+complied.png&quot; width=&quot;312&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The size of the circles are increased with the two dots as the reference.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;We now take the Fourier transform of the images shown above. And the results are shown below. Notice that as the size of the circles increases, the size of the fringes in the Fourier plane decreases.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguL7Wb5msa689dFkPB34smJ_ad0gK2ZVkIKKkhvRgz8CcyLmeCsdJ14baaNDT-2VeiYqyhHdKvAHPXA1_mzvTULhX14Y0ht0FjX47aQTRZ2bk6L8yCzJgN9jFT4-pohwaOlg0b1Qxng8AE/s1600/circles+fft+compiled.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguL7Wb5msa689dFkPB34smJ_ad0gK2ZVkIKKkhvRgz8CcyLmeCsdJ14baaNDT-2VeiYqyhHdKvAHPXA1_mzvTULhX14Y0ht0FjX47aQTRZ2bk6L8yCzJgN9jFT4-pohwaOlg0b1Qxng8AE/s1600/circles+fft+compiled.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The Fourier transforms of the images shown above. &lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&amp;nbsp;We have seen the effect of the increase in the size of circular apertures in the Fourier transform. Let us now see the effect on images containing squares.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5_yztau9lg-SwI-gshoFiFpF2qp5xYqAV8hp6bm_V-JgU9Z49naFywv-_omqFwDYNTVBli2FUej6exx_ZNKAoDVi2Y_UG8dDgO9RDcst8C0UdbE7Q1uwTec8m00HP_SVjc5zXV-v6rBZK/s1600/square+compiled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;132&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5_yztau9lg-SwI-gshoFiFpF2qp5xYqAV8hp6bm_V-JgU9Z49naFywv-_omqFwDYNTVBli2FUej6exx_ZNKAoDVi2Y_UG8dDgO9RDcst8C0UdbE7Q1uwTec8m00HP_SVjc5zXV-v6rBZK/s400/square+compiled.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Increasing aperture size.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;The resulting Fourier transform for each aperture size is shown below. Similar trend is observed here, i.e., as the size increases, the size of the interference patterns (fringes) decreases.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtESFMyE1e9n7-Ui-7a87YlcvwwYC304KqDqOH4-DhhywPkk7cS7GL11ip8rzD1t8OpgePGHgIuxCoDOVosbaz30nWUh38iGsITrbv7MTPGcgm_EYE08FrcrooOCqxYQAXGJ8BsTBPLZpu/s1600/square+fft+compiled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtESFMyE1e9n7-Ui-7a87YlcvwwYC304KqDqOH4-DhhywPkk7cS7GL11ip8rzD1t8OpgePGHgIuxCoDOVosbaz30nWUh38iGsITrbv7MTPGcgm_EYE08FrcrooOCqxYQAXGJ8BsTBPLZpu/s1600/square+fft+compiled.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The resulting FT&#39;s for different aperture sizes. &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Now, we try this on images containing a pair of Gaussian functions.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxHTFwdY102OhdeB53LnSLOWz0NshlNHk_zp0lre2dCZTUt0iLZG0iLGZd2LWGbu7NkTEACegoUZUazFQ-6o-C-W3sOxlqPK1bBMCsOPwCSWcgs2_o9DXGvntTLW4xylXBAnt1YGq7oZ9A/s1600/gaussian+compiled+new.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;132&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxHTFwdY102OhdeB53LnSLOWz0NshlNHk_zp0lre2dCZTUt0iLZG0iLGZd2LWGbu7NkTEACegoUZUazFQ-6o-C-W3sOxlqPK1bBMCsOPwCSWcgs2_o9DXGvntTLW4xylXBAnt1YGq7oZ9A/s400/gaussian+compiled+new.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Images containing Gaussian function for different variance values. The variance is varied increasingly from left to right.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;The Fourier transform of the above images are shown below. Notice again that the same trend that we observe earlier also applies in here. The size of the spot size that we see in the Fourier plane decreases as the variance is increased.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTzkDhfMMAamTPEraiVIRYS6mF87w7VhR2tRl39O0woG8pKGcYYJRvH0nOISW2NhB8QptSJxHxqJX_1DIduDDBwK5hi6R0xhs3S2GiNCLY5J3BTw-Gr3qGqMzTfOGe-xIywLkJqFwmaMTV/s1600/gaussian+fft+compiled+new.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTzkDhfMMAamTPEraiVIRYS6mF87w7VhR2tRl39O0woG8pKGcYYJRvH0nOISW2NhB8QptSJxHxqJX_1DIduDDBwK5hi6R0xhs3S2GiNCLY5J3BTw-Gr3qGqMzTfOGe-xIywLkJqFwmaMTV/s1600/gaussian+fft+compiled+new.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The Fourier transform of the images containing Gaussian function for different variance values.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Now, we try to convolve a pattern with an image having 10 dirac delta functions at random locations.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZJUOHMRJcrz0m-gJ-f5pEC2E7Ja77LghGU_lg4If0_VXXAfm4hsLWFvtk-SCLVfnAYZ4kt-ye6BxI4KQpQaD4GqnlwDoyMP-aiy3Y70vEnX1suukHRiijrPnUPaJc3BuFnCDuOru4Ik_G/s1600/pattern+cross.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;199&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZJUOHMRJcrz0m-gJ-f5pEC2E7Ja77LghGU_lg4If0_VXXAfm4hsLWFvtk-SCLVfnAYZ4kt-ye6BxI4KQpQaD4GqnlwDoyMP-aiy3Y70vEnX1suukHRiijrPnUPaJc3BuFnCDuOru4Ik_G/s200/pattern+cross.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The pattern chosen: a cross.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;The result of the convolution is shown on the right side of the figure below. Notice that the pattern appears at the 10 locations of the dirac delta functions.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_F9vGxluoFkIvRTq8y-VjoYTW_lOkdCxUvf6bhX51UzVv-RkCfytWUs_Ru8zRnDzXOe2rWrIjGM-AEEimxbm8dX4RYlTdvREaHLG76yU-QKUrSt0bJDABX9wWaognn7io6GuMZMyuPfyT/s1600/conv+compiled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_F9vGxluoFkIvRTq8y-VjoYTW_lOkdCxUvf6bhX51UzVv-RkCfytWUs_Ru8zRnDzXOe2rWrIjGM-AEEimxbm8dX4RYlTdvREaHLG76yU-QKUrSt0bJDABX9wWaognn7io6GuMZMyuPfyT/s1600/conv+compiled.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Left: 10 dirac deltas are distributed at different locations randomly. Right: The result of the convolution of the image on the left and the &lt;i&gt;cross&lt;/i&gt; pattern.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;This shows that indeed when a dirac delta is convolved with a function &lt;i&gt;f&lt;/i&gt;, i.e., a given pattern, the result will be an image having the pattern at the location of the dirac delta.&lt;br /&gt;
&lt;br /&gt;
We now see how the Fourier transform of a lattice looks like.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3rfmCWHWgMGPMskB6ns9U7cRWHqUIvKnfxZOSkxS9EES4-bI5Kr2fqGP3yiG1I81BzCpIvmA7EIeXZ3xU5h1LjJaLUPg6iTNUQ85hOIPFsUVZPM3t8f3pEuiI3Ndpv8WMqvb9DifPMEqG/s1600/lattice+compiled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;157&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3rfmCWHWgMGPMskB6ns9U7cRWHqUIvKnfxZOSkxS9EES4-bI5Kr2fqGP3yiG1I81BzCpIvmA7EIeXZ3xU5h1LjJaLUPg6iTNUQ85hOIPFsUVZPM3t8f3pEuiI3Ndpv8WMqvb9DifPMEqG/s320/lattice+compiled.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Left: spacing = 50. Right: spacing = 25.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
Their Fourier transforms are shown below. Notice that the spacing in the spatial domain is inversely proportional to the spacing in the frequency domain or Fourier space.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEip25-tG4fsHDQgkZMNIUW3tdkkOCMhblc2N-NS3lPeQfcDR-ZuTlNimVm6-CFyBUiAm_grRrGAvLwMIYyVJhFqQVlWZKs_QAsr4rWUKUpRaQuDCHXxndg7F3o2Ve26bYtHNWyl60QpoLVL/s1600/lattice+fft+compiled.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;196&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEip25-tG4fsHDQgkZMNIUW3tdkkOCMhblc2N-NS3lPeQfcDR-ZuTlNimVm6-CFyBUiAm_grRrGAvLwMIYyVJhFqQVlWZKs_QAsr4rWUKUpRaQuDCHXxndg7F3o2Ve26bYtHNWyl60QpoLVL/s400/lattice+fft+compiled.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;The corresponding Fourier transform of the images shown above.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Having some idea of how things work, we now proceed to some applications of image enhancement in frequency domain. Below is a fingerprint image and we want to enhance the ridges that appear on the given image.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL5wjBwvlEBRkAY2mf0rIc0umKvNUyfWVMztnUG6ZDhlurbbpKK8lBIavYo_puEHspBGLMdZsxzX09R_vJzJiOLXNnE8dnZM7ka4Z15SAOJfHSdW3TcPS4bSS-UN-MgIRXGtkRwyVINf3m/s1600/Fingerprints.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL5wjBwvlEBRkAY2mf0rIc0umKvNUyfWVMztnUG6ZDhlurbbpKK8lBIavYo_puEHspBGLMdZsxzX09R_vJzJiOLXNnE8dnZM7ka4Z15SAOJfHSdW3TcPS4bSS-UN-MgIRXGtkRwyVINf3m/s200/Fingerprints.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Source: &lt;a href=&quot;http://www.topnews.in/fingerprint-technology-beats-worlds-toughest-tests-2229048&quot;&gt;http://www.topnews.in/fingerprint-technology-beats-worlds-toughest-tests-2229048&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Shown below are the images for the mask used, the Fourier transform of the image and the resulting image when the mask is applied on the Fourier transform.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqt7hh4lkqgpwIDKFe_drSQC8LBB-55JnCygB3IFKrYVnVB-ZGn_poqNXhgplZ5b6_1hgjn_hB9uIhKeS_GEGaFvW6qMx98CiZNCmNuYu7dqSPi17BRRJDhnm7HN1V6mKsfG_MaxOdsDle/s1600/fingerprint+compiled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;211&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqt7hh4lkqgpwIDKFe_drSQC8LBB-55JnCygB3IFKrYVnVB-ZGn_poqNXhgplZ5b6_1hgjn_hB9uIhKeS_GEGaFvW6qMx98CiZNCmNuYu7dqSPi17BRRJDhnm7HN1V6mKsfG_MaxOdsDle/s640/fingerprint+compiled.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Left: the mask used in eliminating unwanted frequency values. Middle: the Fourier transform of the fingerprint image. Right: the product of the mask and the FT.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Basically, we create a mask that will cover the unnecessary frequencies on the Fourier domain. The resulting image is then shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlNsW5p94pTOJ2LDUHm257JohUKYHyHOBpM7Tnl7Dx2rbjI8XVYY-llcXgR9hUakVcWIO9OwAQGfoc3WJ93L4vWvMQxvai82rTqJBiMqhQF__QX-qlEWpk5-16uXv7_7VWp2pYMIWEOLbp/s1600/final+product.bmp&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlNsW5p94pTOJ2LDUHm257JohUKYHyHOBpM7Tnl7Dx2rbjI8XVYY-llcXgR9hUakVcWIO9OwAQGfoc3WJ93L4vWvMQxvai82rTqJBiMqhQF__QX-qlEWpk5-16uXv7_7VWp2pYMIWEOLbp/s200/final+product.bmp&quot; width=&quot;199&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The resulting fingerprint image.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Now we move to line removal. The image shown below is taken from &lt;a href=&quot;http://www.lpi.usra.edu/lunar/missions/apollo/apollo_11/images&quot;&gt;http://www.lpi.usra.edu/lunar/missions/apollo/apollo_11/images&lt;/a&gt;. Our goal this time is to remove the vertical lines that appear on the given image.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdeJueaJe8q7WGjy2BxW-MxtrMtoBj2EwSoKTtc6qyUYDdJgEh6pK_uW9rxU4uqh0Ik-qf8OTQYeQ5IAyyKWsef2GScKmbX-Kj6W3AoVkXmT6x23wFtMsUOMSVm8K6M8g6ZmItdnc5XEsX/s1600/hi_res_vertical_lg.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdeJueaJe8q7WGjy2BxW-MxtrMtoBj2EwSoKTtc6qyUYDdJgEh6pK_uW9rxU4uqh0Ik-qf8OTQYeQ5IAyyKWsef2GScKmbX-Kj6W3AoVkXmT6x23wFtMsUOMSVm8K6M8g6ZmItdnc5XEsX/s400/hi_res_vertical_lg.gif&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The image we want to enhance, i.e., removing the vertical lines.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;The Fourier transform of the above image is shown below. The other image is the result when a mask is applied on the Fourier transform. Since we want to remove the vertical lines, we need to mask the frequencies along the horizontal line, leaving the frequencies at the center and along the vertical line. Recall that the Fourier transform of a grating along the x-axis produced a series of frequency values arranged in the horizontal manner. This justifies why only the horizontal component is masked.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdGq4qkY-doUlL3jW9VtDjIFsdkbwM_uc5NZuLRT_mht9K26Xtwesch5qwLPzDWhWZHJtPcLeJWZxWtUCXgaPxKbPcjPG7Jr9MKo0kG8rTXYoDXNJpvCoMcIr4I01YicxVVzdN6RTMPBel/s1600/moon+compiled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdGq4qkY-doUlL3jW9VtDjIFsdkbwM_uc5NZuLRT_mht9K26Xtwesch5qwLPzDWhWZHJtPcLeJWZxWtUCXgaPxKbPcjPG7Jr9MKo0kG8rTXYoDXNJpvCoMcIr4I01YicxVVzdN6RTMPBel/s1600/moon+compiled.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Left: the Fourier transform of the given image. Right: the result when a mask is applied on the image on the left.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;The result of the masking is shown below. The vertical lines are no longer prominent in the image shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6v-9F_p2OVB8MV4-wz2BXLIHeGNsbopH9Yu4Qh9Mhkl-M-pJpCs1haq9ZegSIDfP-DpuEqWJE89xy7G7qGV9Ra1MjL3M4rsgZCJsd74hd4kP-CST-LhTonsru55hiZABTlct7g8vvzpOU/s1600/moon+final.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6v-9F_p2OVB8MV4-wz2BXLIHeGNsbopH9Yu4Qh9Mhkl-M-pJpCs1haq9ZegSIDfP-DpuEqWJE89xy7G7qGV9Ra1MjL3M4rsgZCJsd74hd4kP-CST-LhTonsru55hiZABTlct7g8vvzpOU/s400/moon+final.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The vertical lines are successfully eliminated!&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;We move on to the next part of this activity, i.e., canvas weave modeling and removal. The image that will be used is shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWxKZFYa5x8ovSbKk-3twDBTs9y1X-T8ROnSs1y_JdvyhnnOA_Ii94QSAiS__nOPwxjHFOSEXQqa49gRYSr0fsQW7bOl23RmNNtaKkY7WLoXKNBDDz2tzm0qm3pQ7YohlIiqgLfH0rkfka/s1600/canvasweave.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;287&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWxKZFYa5x8ovSbKk-3twDBTs9y1X-T8ROnSs1y_JdvyhnnOA_Ii94QSAiS__nOPwxjHFOSEXQqa49gRYSr0fsQW7bOl23RmNNtaKkY7WLoXKNBDDz2tzm0qm3pQ7YohlIiqgLfH0rkfka/s400/canvasweave.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;This is a part of an oil painting from the UP Vargas Museum Collection.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Shown below are images for the Fourier transform and the result when a mask is applied to filter the frequencies corresponding to the canvas weave. The mask used here is manually generated unlike the previous ones used in this activity. The choice of what to filter relies on the physical appearance of the canvas weave which is periodic and arranged in a way that it has some kind of symmetry. After taking the Fourier transform, I noticed that six dots forming a hexagon when connected appear on the resulting image. I am having a hint that perhaps these correspond to the canvas weave since these dots also display some kind of symmetry similar to that of the canvas weave.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeAYfvU8eS9a6LwHnl293uXlNlOBaovHOAZFKDnzQyU0709uiHt9stQo_UfxKuoVw1MrFJukjYeWU4vUp16jd_fN7jL4wjr2Ne1Hd0TOBAclCSsE_p-maa7EidP03Uy_FcKn5d4bfmG5vw/s1600/canvas+compiled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeAYfvU8eS9a6LwHnl293uXlNlOBaovHOAZFKDnzQyU0709uiHt9stQo_UfxKuoVw1MrFJukjYeWU4vUp16jd_fN7jL4wjr2Ne1Hd0TOBAclCSsE_p-maa7EidP03Uy_FcKn5d4bfmG5vw/s1600/canvas+compiled.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Left: Fourier transform of the image shown above. Right: the result when a mask is applied on the image shown on the left.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;The resulting image is shown below. Observe that the canvas weave is now removed.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBRDDTsX3Wwp2dfF0tF1v59aZw1DAx5J4QJEJk5Irw6fXyWREBlEG_Dl_pi3JR_u8EFftgx2eL0H1f3FbPkWtVgcqACBNQL1onOi7X4wg3gKLd7CFkSFUUBrlRgqbQBvZDr9tqFVZIZjQ0/s1600/weave+final.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;288&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBRDDTsX3Wwp2dfF0tF1v59aZw1DAx5J4QJEJk5Irw6fXyWREBlEG_Dl_pi3JR_u8EFftgx2eL0H1f3FbPkWtVgcqACBNQL1onOi7X4wg3gKLd7CFkSFUUBrlRgqbQBvZDr9tqFVZIZjQ0/s400/weave+final.bmp&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Finally! The output after filtering the frequencies corresponding to the canvas weave.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;What if we want to recover the canvas weave from the given image? This can be done by inverting the filter used previously so it will appear like the one shown below on the left. The figure on the right is the recovered canvas weave. &lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi18mQrMe_EhiQCrjb5Yff33ATdI5YJCC5yz__OabrOSGi5sSj_Azn_uF8EKfSpu4W3S4ERYyQTVgUwARRdyRfKv1ZjLdtUpaYtxxvoC-xWybYf0Rr6D_0V6OscYhUKnNeCDtKklz54Ujob/s1600/3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;233&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi18mQrMe_EhiQCrjb5Yff33ATdI5YJCC5yz__OabrOSGi5sSj_Azn_uF8EKfSpu4W3S4ERYyQTVgUwARRdyRfKv1ZjLdtUpaYtxxvoC-xWybYf0Rr6D_0V6OscYhUKnNeCDtKklz54Ujob/s640/3.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The canvas weave on the right is not noticeable.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;This activity is perhaps the most tedious and difficult one I have encountered. First, it requires me to remember and apply the things I learned from the previous activities, especially on the part wherein I need to create masks or filters for my images. I think much of my time was wasted on the fingerprint image enhancement. I am not really satisfied with my results for that part. I don&#39;t know whether the image I got from the internet is too perfect already to be enhanced. I just realized that image processing is a bit subjective. And sometimes, it is very hard to determine whether the result I am obtaining is already good enough. Overall, I learned a lot from this activity! I am giving myself a grade of 9 for this.</content><link rel='replies' type='application/atom+xml' href='http://anythingphysics.blogspot.com/feeds/4427995400940501333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anythingphysics.blogspot.com/2011/07/enhancement-in-frequency-domain.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/4427995400940501333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/4427995400940501333'/><link rel='alternate' type='text/html' href='http://anythingphysics.blogspot.com/2011/07/enhancement-in-frequency-domain.html' title='Enhancement in the Frequency Domain'/><author><name>Jen-Jen Manuel</name><uri>http://www.blogger.com/profile/17781945162053242109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio7WYdtUaWDpY0vUR8rmhXb6vLXc_NJhfW7210lMlbkFxjcoaf31CZ38KIuNSzomRZXPSXX9zYuME75wQBlwP99KltNLXSivQIMcdocBxzVUhe4t36aIu_krVWKUOErA4/s220/49936_1530407762_2876926_n.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgP25azsRtCYld84lq6Y6R6H0USbZir8m-Gg0uoMFwB33zx6L_b53MHQCCZ3Tdp2zPoISVrgmSc3SpVypM2fQhDmBRB5oUT5kIBFf9p60WNPl6arU7jCNJbQNP2sjsX9YilYCznYNUJYXIi/s72-c/diracdeltaconvolution+eqn.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2748687604404631686.post-5045861718566720423</id><published>2011-07-14T14:32:00.000+08:00</published><updated>2011-07-14T14:32:43.516+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="fft2()"/><category scheme="http://www.blogger.com/atom/ns#" term="FT"/><title type='text'>Properties of the 2D Fourier Transform</title><content type='html'>The spatial frequency distribution of a signal can be found by finding its Fourier Transform FT. The Fourier theorem states that any given signal or image is just a superposition of sinusoids having different frequency values. In this activity, we investigate how a rotation in the orientation of a sinusoid gives rise to a unique and different FT that is also rotated. &lt;br /&gt;
&lt;br /&gt;
Some of the sample images investigated are shown below. &lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwLzAbk8MIWr9A6nxUbyRz2oE_hKAumj25uQd-guvKjzbUzthYvHzaXZyEtEcF-iREBR4rU1TK-UYS333ENdMS0Gjyka_4jO5DEZruCXWTbIrqgVn646nXEVoJRQms72mJdXnWjq3DnQtQ/s1600/Compilation.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwLzAbk8MIWr9A6nxUbyRz2oE_hKAumj25uQd-guvKjzbUzthYvHzaXZyEtEcF-iREBR4rU1TK-UYS333ENdMS0Gjyka_4jO5DEZruCXWTbIrqgVn646nXEVoJRQms72mJdXnWjq3DnQtQ/s320/Compilation.png&quot; width=&quot;209&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;First row: square, square annulus. Second row: circle, annulus. Third: double-slit along x-axis, two dots along x-axis.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;The Fourier transform of the above images are then obtained and presented below in an order similar to the one above.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHat4Mv6Yonc9FnW8gKs2RI4aO8DchgtQUDFmrfDatd5yqpQjktjGA3kYxf-qm5md3JzMnyCbCqYyMpRF20tnkRdS2f7BCJBxs9AmLIuE4MSeLxCLHPUUtHyugEiXNwTINNeuv9KA49F0D/s1600/Compilation+of+A.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHat4Mv6Yonc9FnW8gKs2RI4aO8DchgtQUDFmrfDatd5yqpQjktjGA3kYxf-qm5md3JzMnyCbCqYyMpRF20tnkRdS2f7BCJBxs9AmLIuE4MSeLxCLHPUUtHyugEiXNwTINNeuv9KA49F0D/s1600/Compilation+of+A.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The Fourier transform of the sample images.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Observe the difference in the interference pattern produced by the sample images. &lt;br /&gt;
&lt;br /&gt;
Having an idea of the FT of different image patterns, we now move to the investigation of the anamorphic property of Fourier transform. The image below shows a sinuoid captured and generated at different frequency values, i.e., &lt;i&gt;f&lt;/i&gt; = 2, 4, 16, 32.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLJziu-l_rRuE2Ie5diWcQgJSboWRQqalOHtkqsu18kM7v48oSpXAWrHBfBwU36p0HkdXrxpV_sx10eLW9NqEaGR02y3B3hL6w-PnyTIhVMtUssXJjUCN_NNEiI9LTwiknylVxhlJsm6Un/s1600/compilation+of+different+f.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLJziu-l_rRuE2Ie5diWcQgJSboWRQqalOHtkqsu18kM7v48oSpXAWrHBfBwU36p0HkdXrxpV_sx10eLW9NqEaGR02y3B3hL6w-PnyTIhVMtUssXJjUCN_NNEiI9LTwiknylVxhlJsm6Un/s320/compilation+of+different+f.png&quot; width=&quot;313&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;First row: &lt;i&gt;f&lt;/i&gt; = 2, &lt;i&gt;f&lt;/i&gt; = 4. Second row: &lt;i&gt;f&lt;/i&gt; = 16, &lt;i&gt;f&lt;/i&gt; = 32.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Their corresponding Fourier transforms are shown below. Notice that as &lt;i&gt;f&lt;/i&gt; increases, the two dominant frequencies seen move away from each other. The output generated is consistent with our definition of what Fourier transform is. For a function having a single-valued frequency &lt;i&gt;f&lt;/i&gt;, we expect that a single peak will appear in its Fourier transform. But since the function investigated is odd, another peak will be observed which corresponds to the negative frequency &lt;i&gt;f&lt;/i&gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9vw6GObJ6Biiq7FhMbVESGagrg2M3pDiotpgDSDd3U1_LZxjzYZo2fngHzpYZTCEMli1B0OBhlo0f1QeZIy_rvizt6DTjmriDSDatRyPVl7lzUR5sANqC29LW65qIZbCZ7N_Xv3o5Yxhz/s1600/compilation+of+fft.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;316&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9vw6GObJ6Biiq7FhMbVESGagrg2M3pDiotpgDSDd3U1_LZxjzYZo2fngHzpYZTCEMli1B0OBhlo0f1QeZIy_rvizt6DTjmriDSDatRyPVl7lzUR5sANqC29LW65qIZbCZ7N_Xv3o5Yxhz/s320/compilation+of+fft.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The Fourier transforms for different f values.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;But since in digital images there are no negative values, we eliminate these by adding a bias to the sinusoid. The peak that appears in the origin is the result of the addition of bias since the frequency &lt;i&gt;f &lt;/i&gt;of any constant is equal to zero. For the addition of a non-constant bias, i.e., a sinusoid with frequency &lt;i&gt;f&lt;/i&gt; = 1, to the original sinusoid having a frequency &lt;i&gt;f&lt;/i&gt; = 4, the Fourier transform is observed to have two additional symmetric peaks. These correspond to both positive and negative frequencies &lt;i&gt;f&lt;/i&gt;&amp;nbsp; of the non-constant bias.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp4vidBwND2WV5id_KTIiJDUNd8FOIVbMRjFnepexmzncP-pxGckBj2n_nZzc86jYBWeZfmddADii6Dp8m9LGjhO6fHcQC5ly7DGBwjgGqdKm8CXM3vdFzD6EWcPIHGfKRMc4tOKQaS0Y3/s1600/compilation+of+nonconstant+bias.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp4vidBwND2WV5id_KTIiJDUNd8FOIVbMRjFnepexmzncP-pxGckBj2n_nZzc86jYBWeZfmddADii6Dp8m9LGjhO6fHcQC5ly7DGBwjgGqdKm8CXM3vdFzD6EWcPIHGfKRMc4tOKQaS0Y3/s320/compilation+of+nonconstant+bias.png&quot; width=&quot;314&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Top: Sinusoid with &lt;i&gt;f&lt;/i&gt; = 4 having a constant bias = 10. Bottom: Sinusoid with &lt;i&gt;f&lt;/i&gt; = 4 with a non-constant bias in the form a sinusoid having a frequency&amp;nbsp; &lt;i&gt;f&lt;/i&gt; = 1. &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;We try to rotate the sinusoid and observe what happens to its Fourier transform.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT3yOyjJAKV6QG1s4rLDGV8g-KiLQHKGyK-UEZwi558mVBXijzCIcvR-4Pzev3C4_VCi103TUbMlYFzoXTAYAt9I_hSsRMPzB1ZkByMsIU8eJ9BsbvYyZDCwqduUM2bcb1kIYjHJlTXKSv/s1600/compilation+of+thetas.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;315&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT3yOyjJAKV6QG1s4rLDGV8g-KiLQHKGyK-UEZwi558mVBXijzCIcvR-4Pzev3C4_VCi103TUbMlYFzoXTAYAt9I_hSsRMPzB1ZkByMsIU8eJ9BsbvYyZDCwqduUM2bcb1kIYjHJlTXKSv/s320/compilation+of+thetas.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The sinusoid rotated at different angles theta. First row: theta = -10, 10. Second row: theta = -45, 45.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;The Fourier transforms of the above images are shown below. Notice the change in the orientation. &lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_boNzZ3Fh15K5DoYWXMl0ifBrMhnQPMj0xya7XZTIrpOBhyphenhyphenjcE6DeNOIhY9gO3FnnQXQa1oTc5b1iczG_bZJTdO34GBR5lrILJ4qCZJiZc0iJhzh2Et88VeU-HOBU3bbEGeyTfCr9nOxE/s1600/compilation+of+fft+theta.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_boNzZ3Fh15K5DoYWXMl0ifBrMhnQPMj0xya7XZTIrpOBhyphenhyphenjcE6DeNOIhY9gO3FnnQXQa1oTc5b1iczG_bZJTdO34GBR5lrILJ4qCZJiZc0iJhzh2Et88VeU-HOBU3bbEGeyTfCr9nOxE/s320/compilation+of+fft+theta.png&quot; width=&quot;313&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The FT of the sinusoid rotated at different angles.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;We generate a sinusoid that is both dependent on x and y. We expect that in its Fourier transform, four peaks will be observed, i.e., 2 peaks for x and another 2 peaks for y (both positive and negative frequency values).&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGFQB25XmsC6YQavq7hvJcc1Vc2BHF7uwlnHdGGYC5rJKaw_W_iApuQaX6KGbI9KqwcCxCx0zYAvKxuayx37BDGcJgkIVN3x7zfIAUN12WCwDAfNZxlgcqoVV8kjro0TqpfW-jLNJ4Y5RH/s1600/productxy+plus+fft.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;158&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGFQB25XmsC6YQavq7hvJcc1Vc2BHF7uwlnHdGGYC5rJKaw_W_iApuQaX6KGbI9KqwcCxCx0zYAvKxuayx37BDGcJgkIVN3x7zfIAUN12WCwDAfNZxlgcqoVV8kjro0TqpfW-jLNJ4Y5RH/s320/productxy+plus+fft.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Observe the four peaks in the right image.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;We can also try different combinations of sinusoids. Below are images generated by combining the product of sinusoids along x and y with sinusoid/s rotated at a given angle. Also, shown are their corresponding Fourier transforms.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJPhHyFf7fMp2Sy_yfHuiZfV7_6IUc5pzXrBgYU_-oDaGlikcIQfuU29Jw3jdUFbG7Ku53MAHClMxbCGb3OHgXYrHUH2miaK8K-Ibv6BWTP-GVfKw-6xPPUiWZmih-d1PKJeF-bWBSUdws/s1600/others.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJPhHyFf7fMp2Sy_yfHuiZfV7_6IUc5pzXrBgYU_-oDaGlikcIQfuU29Jw3jdUFbG7Ku53MAHClMxbCGb3OHgXYrHUH2miaK8K-Ibv6BWTP-GVfKw-6xPPUiWZmih-d1PKJeF-bWBSUdws/s400/others.png&quot; width=&quot;392&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;First row: Product of&amp;nbsp; two sinuoids along x and y having a frequency &lt;i&gt;f&lt;/i&gt; =4 added to a sinusoid inclined at an angle -10. Second row: Product of&amp;nbsp; two sinuoids along x and y having a frequency &lt;i&gt;f&lt;/i&gt; =4 added to sinusoids inclined at an angles -10 and 45.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;The resulting FT&#39;s are predictable since the signal being investigated is made up of components that we have just tackled. The output is just then the superposition of all the FTs of the components.&lt;br /&gt;
&lt;br /&gt;
This activity is easy but tedious. But I still enjoyed doing this. It is amazing to see patterns that are familiar in the field of optics. Doing this activity made me further understand how Fourier transform works. And for that, I am giving myself a grade of 10.</content><link rel='replies' type='application/atom+xml' href='http://anythingphysics.blogspot.com/feeds/5045861718566720423/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anythingphysics.blogspot.com/2011/07/properties-of-2d-fourier-transform.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/5045861718566720423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/5045861718566720423'/><link rel='alternate' type='text/html' href='http://anythingphysics.blogspot.com/2011/07/properties-of-2d-fourier-transform.html' title='Properties of the 2D Fourier Transform'/><author><name>Jen-Jen Manuel</name><uri>http://www.blogger.com/profile/17781945162053242109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio7WYdtUaWDpY0vUR8rmhXb6vLXc_NJhfW7210lMlbkFxjcoaf31CZ38KIuNSzomRZXPSXX9zYuME75wQBlwP99KltNLXSivQIMcdocBxzVUhe4t36aIu_krVWKUOErA4/s220/49936_1530407762_2876926_n.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwLzAbk8MIWr9A6nxUbyRz2oE_hKAumj25uQd-guvKjzbUzthYvHzaXZyEtEcF-iREBR4rU1TK-UYS333ENdMS0Gjyka_4jO5DEZruCXWTbIrqgVn646nXEVoJRQms72mJdXnWjq3DnQtQ/s72-c/Compilation.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2748687604404631686.post-5374345228479515146</id><published>2011-07-12T22:23:00.000+08:00</published><updated>2011-07-12T22:23:23.509+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="convolution"/><category scheme="http://www.blogger.com/atom/ns#" term="correlation"/><category scheme="http://www.blogger.com/atom/ns#" term="FFT"/><category scheme="http://www.blogger.com/atom/ns#" term="fft2()"/><category scheme="http://www.blogger.com/atom/ns#" term="fftshift()"/><category scheme="http://www.blogger.com/atom/ns#" term="fourier transform"/><category scheme="http://www.blogger.com/atom/ns#" term="imcorrcoef()"/><title type='text'>Fourier Transform Model of Image Formation</title><content type='html'>&lt;span style=&quot;font-size: large;&quot;&gt;Lens as Fourier Transformer &lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://en.wikipedia.org/wiki/Fourier_transform&quot;&gt;Fourier Transform&lt;/a&gt; (FT), as its name implies, recasts information from one domain to another. In particular, it decomposes a signal, which is in time domain, to its constituent frequencies (frequency domain). Here, we see the transformation from the time domain to the frequency domain. FT is well utilized in the field of signal processing. If one&#39;s goal is to eliminate the noise in a given signal, working on the frequency domain is advantageous compared to the case in time domain. Looking on the FT of the said signal gives one the hint of what frequency value gives rise to the noise observed in the signal. Thus, eliminating the noise is easier with the help of FT. To find the Fourier transform of one signal, the equation shown below is used.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1BCl8R3dJel8MfW34cbmUet6pNl9Nu7YcfLgSuFZBo-kDa-hNZ5o2hfmxc_7Di-TjMYM29KpO7JmHsttWcVmErYUtGfjlLXjT3Ndp7t2ljb_kC3oSnqVL136cz8bJhHah6CFgkAaNihoA/s1600/FT+eqn.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;43&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1BCl8R3dJel8MfW34cbmUet6pNl9Nu7YcfLgSuFZBo-kDa-hNZ5o2hfmxc_7Di-TjMYM29KpO7JmHsttWcVmErYUtGfjlLXjT3Ndp7t2ljb_kC3oSnqVL136cz8bJhHah6CFgkAaNihoA/s400/FT+eqn.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Fourier transform equation&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;An implementation of this, that is fast and efficient, had been created by Cooley and Tukey. And it is called the Fast Fourier Transform algorithm (FFT). This is so widely used today that software like Scilab uses FFT in the implementation of Fourier transform. In Scilab, it is available as &lt;b&gt;fft()&lt;/b&gt; for 1D and&lt;b&gt; fft2()&lt;/b&gt; for 2D. The list below enumerates the properties of FFT for both 1D and 2D.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;FFT2 is most efficient if the size of the image is a power of 2 (e.g. 64x64, 128x128, 256x256, etc.)&lt;/li&gt;
&lt;li&gt;The output of FFT2 has quadrants along the diagonal interchanged.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBp6BNxmRwZpDwxkduLa7XXlhvFw5O23HkjRW7MC6_tbh_DbW8x0DVOeKCwDPxhU_Y4gqq8qzMnUhxPWJRw3scGYnudKD7htEZOiQTNWNZI_QPYT3T55ybIeKidekz2EL0qCbzMsj48lWP/s1600/quadrant+exchange.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;108&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBp6BNxmRwZpDwxkduLa7XXlhvFw5O23HkjRW7MC6_tbh_DbW8x0DVOeKCwDPxhU_Y4gqq8qzMnUhxPWJRw3scGYnudKD7htEZOiQTNWNZI_QPYT3T55ybIeKidekz2EL0qCbzMsj48lWP/s200/quadrant+exchange.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;An example of what happens when FFT2 is applied to a given input. To return the quadrants to their original position, &lt;b&gt;fftshift()&lt;/b&gt; is utilized.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;ul&gt;&lt;li&gt;Take note that FFT outputs a complex number array. The &lt;b&gt;abs()&lt;/b&gt; function can be used to view the intensity of the output.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;The inverse FFT of an image is the same as the forward FFT with the image inverted.&lt;/li&gt;
&lt;/ul&gt;&amp;nbsp;To see how these things work, we apply the said functions on images. The first is a 128x128 image containing a white circle in black background.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgffQSu39OVo9BfGNHygQs_UqPVYsKcRZ3bVdNnZQgncQG_xBSfgHFRVQXCw-9NNSK7g0y7EDb6owOivOJNh2WMp0BbKuu2XauKwWX-CtoWrrksYjNVOvDhf_7EMV2vXtJ53y9eNQuC1IwA/s1600/circle.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Test subject no. 1&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;Its Fourier transform is shown below. Notice the corners of the square.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiexsBISbXRToIqE_xRIU5ILDAWlw38JTGa3QfUjdcFfXi8NGL0D5KiaQX2QfSKDPj6csA9Iu0r4czTZmAhzQ2po4Kc-hkvtRuAGwVjLHXnCnXTRNByq6OwLUz2OPMiYgrUDfxTsUrVICim/s1600/fft+circle.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;195&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiexsBISbXRToIqE_xRIU5ILDAWlw38JTGa3QfUjdcFfXi8NGL0D5KiaQX2QfSKDPj6csA9Iu0r4czTZmAhzQ2po4Kc-hkvtRuAGwVjLHXnCnXTRNByq6OwLUz2OPMiYgrUDfxTsUrVICim/s400/fft+circle.bmp&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The result when &lt;b&gt;fft2()&lt;/b&gt; is applied on test object no. 1. &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;Remember that when using FFT, the quadrants in the image are interchanged. Thus, in order to see the actual result, &lt;b&gt;fftshift()&lt;/b&gt; is used.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRNZ9wSj3wkSs8QVRSyqcvMmHpdt54KEnwTV9NyQkjLLfo559AUqe-HGMXqe0LjnmmDdvTIXJwUWM8QWTn2iAr8ExYIY4odugfW9nZ6K08E6joroGa7a8mY9GVwccMTU_xMmrngWtoAKQ4/s1600/fftshift+circle.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;196&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRNZ9wSj3wkSs8QVRSyqcvMmHpdt54KEnwTV9NyQkjLLfo559AUqe-HGMXqe0LjnmmDdvTIXJwUWM8QWTn2iAr8ExYIY4odugfW9nZ6K08E6joroGa7a8mY9GVwccMTU_xMmrngWtoAKQ4/s400/fftshift+circle.bmp&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The result when &lt;b&gt;fftshift()&lt;/b&gt; is used.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;Performing another&lt;b&gt; fft2()&lt;/b&gt; on the test object results to the image shown below.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBVMFnJu-3FLo7ZiotsyRXYYA7AXaSWpOzXIv4QPipD_jEem5veyF7FPMsOqKsYWhq-j8qJJZ3ijYIh4Vrk0I-GTWdAkQmbbDZpomkOP4ydRiiHjHP19tMPkcKP68L_JrMiQgC7bAHNY2y/s1600/fft2+twice+circle.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;196&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBVMFnJu-3FLo7ZiotsyRXYYA7AXaSWpOzXIv4QPipD_jEem5veyF7FPMsOqKsYWhq-j8qJJZ3ijYIh4Vrk0I-GTWdAkQmbbDZpomkOP4ydRiiHjHP19tMPkcKP68L_JrMiQgC7bAHNY2y/s400/fft2+twice+circle.bmp&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The result of implementing &lt;b&gt;fft2()&lt;/b&gt; twice on the image.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;It appears that after two consecutive &lt;b&gt;fft2()&lt;/b&gt; implementation on the test object the result is similar to the original image, i.e., the test object. But we do not know whether the result is just the original image itself. If ever this is not the case, the symmetry of the circle hinders us to any possible observation on the output image. Thus, it is perfect now to have a second test object that has no perfect symmetry.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOATs126MUonLACFx8Ps3BSrMFKyVRYi8L7KmWF6B2rL6vyJmU5127y5sYdFEBXJsR65qiuRAcCd31AUhRytbwwU6P3vXTYKEkc_AbxNE4wkTxZgcTqqRNNoSfR_rIe8DmtlCjFnsHimfR/s1600/A.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOATs126MUonLACFx8Ps3BSrMFKyVRYi8L7KmWF6B2rL6vyJmU5127y5sYdFEBXJsR65qiuRAcCd31AUhRytbwwU6P3vXTYKEkc_AbxNE4wkTxZgcTqqRNNoSfR_rIe8DmtlCjFnsHimfR/s1600/A.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Test object no. 2&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Applying &lt;b&gt;fft2() &lt;/b&gt;on the above test object, the output is shown below.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsT90DZVAPjiauTTfrtUC0dpStFwdrHd07jhl1-Vf2p6sg1pAA_RZgrwvWolwcvVzCOITyjcP3HG179fXbIgiSi3IazIlwoxJVWZ8v577jrasnercRWt4-HnvUZfpd7LahSB2FTxswbZ0g/s1600/fft+A.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;195&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsT90DZVAPjiauTTfrtUC0dpStFwdrHd07jhl1-Vf2p6sg1pAA_RZgrwvWolwcvVzCOITyjcP3HG179fXbIgiSi3IazIlwoxJVWZ8v577jrasnercRWt4-HnvUZfpd7LahSB2FTxswbZ0g/s400/fft+A.bmp&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Always remember how&lt;b&gt; fft2()&lt;/b&gt; works. Notice the corners once again.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;In order to see the &lt;i&gt;real&lt;/i&gt; output, i.e., similar quadrant locations, &lt;b&gt;fftshift() &lt;/b&gt;is used.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiN6ASBYJucC2IVMyZfvA22m0s2hUg42FHCrie3qM0hOGpJDByd2DfpETrahnbkSpmuqbyVOD5f04pK6UHGoqytBas0SPzw_hnwtCW7we_v_6qRbhzX-3lp1WpHCEVmscDr3Sdd9mc-nE_F/s1600/fftshift+A.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;196&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiN6ASBYJucC2IVMyZfvA22m0s2hUg42FHCrie3qM0hOGpJDByd2DfpETrahnbkSpmuqbyVOD5f04pK6UHGoqytBas0SPzw_hnwtCW7we_v_6qRbhzX-3lp1WpHCEVmscDr3Sdd9mc-nE_F/s400/fftshift+A.bmp&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The output image is better to analyze when &lt;b&gt;fftshift()&lt;/b&gt; is utilized.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Again, another &lt;b&gt;fft2()&lt;/b&gt; is applied on the test object resulting to the image shown below.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBPcgCTXQDxhaCqOjPEFN5Rp1XB6q05Gzh4iJiE5yNcqOh6BVB-rbV6OWo2go4IGKOwHQDohcxfDLa1l_Nyx4gBmY50ZMa7q3R4D8-wmqy6uDREixEzi7x0BloH_nX95EK3dbFUbY6xao2/s1600/fft2+twice+A.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;196&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBPcgCTXQDxhaCqOjPEFN5Rp1XB6q05Gzh4iJiE5yNcqOh6BVB-rbV6OWo2go4IGKOwHQDohcxfDLa1l_Nyx4gBmY50ZMa7q3R4D8-wmqy6uDREixEzi7x0BloH_nX95EK3dbFUbY6xao2/s400/fft2+twice+A.bmp&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The result is similar to the test object but this time inverted.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Remember that the inverse Fourier transform of an image is just the Fourier transform of the image inverted. Thus, if we want to obtain the original image, i.e., inverse FT of the FT of the image, the FT of the image must first be inverted before another FT is applied. This explains why the recovered image is inverted.&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Convolution&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;The convolution between two 2-D functions &lt;i&gt;f&lt;/i&gt; and &lt;i&gt;g&lt;/i&gt; is given by&lt;/span&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpbrxYjBrmZ5E6vSaLztN3XHT2yD2U1e4DkjXcf14AydgTJU7ZBHGFyxHvj1McIdlpAUkBdr47pFNXlc69Xm1wRS20NkInqXxRm9DhuXehwGc1fYCa7AUeKnYbQ1Z8dux8WncFjMl9SXIr/s1600/convolution+eqn.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;48&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpbrxYjBrmZ5E6vSaLztN3XHT2yD2U1e4DkjXcf14AydgTJU7ZBHGFyxHvj1McIdlpAUkBdr47pFNXlc69Xm1wRS20NkInqXxRm9DhuXehwGc1fYCa7AUeKnYbQ1Z8dux8WncFjMl9SXIr/s400/convolution+eqn.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Convolution integral&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;span style=&quot;font-size: small;&quot;&gt;or is simply denoted as&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;h&lt;/i&gt; = &lt;i&gt;f&lt;/i&gt; *&lt;i&gt;g&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Take note that it is a linear operation. This implies that if both &lt;i&gt;f &lt;/i&gt;and &lt;i&gt;g &lt;/i&gt;are recast by linear transformation (e.g. Laplace, Fourier transform), they obey the convolution theorem given by&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;i&gt;H&lt;/i&gt; = &lt;i&gt;FG&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;where &lt;i&gt;H&lt;/i&gt;, &lt;i&gt;F&lt;/i&gt; and &lt;i&gt;G&lt;/i&gt; are the transforms of &lt;i&gt;h&lt;/i&gt;, &lt;i&gt;f&lt;/i&gt; and &lt;i&gt;g&lt;/i&gt;, respectively.&lt;i&gt; &lt;/i&gt;Convolution is basically the &lt;i&gt;smearing &lt;/i&gt;of one function against another function. This gives us an idea that the resulting output &lt;i&gt;h &lt;/i&gt;appears to be almost a combination of &lt;i&gt;f&lt;/i&gt; and &lt;i&gt;g&lt;/i&gt;, i.e., it looks like both &lt;i&gt;f&lt;/i&gt; and &lt;i&gt;g&lt;/i&gt;.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Convolution has its application in simulating the linear regime of instruments or detector devices used in imaging. The functions to be convolved, &lt;i&gt;f&lt;/i&gt; and &lt;i&gt;g&lt;/i&gt;, can be the object and the transfer function of the system being investigated, respectively. Thus, when convolution is done, the result represents the output of the system. It is expected that the output is not perfectly similar to the original image.&lt;br /&gt;
&lt;br /&gt;
Now, we try to simulate how imaging happens using two images: one representing the lens, the other which is the test object.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6uSydDATVDE-NNzBd6re9xO6zP_iToVn8narjoc624CXjFx8vK77un39UeCNzK0v7QbzpKaBnMsds3eKekj0MmNrjCeq5-A8T4EWMCNWuBTTP74I6QBZCo07t_uAkTaj0F_ECINnKUzap/s1600/VIP.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6uSydDATVDE-NNzBd6re9xO6zP_iToVn8narjoc624CXjFx8vK77un39UeCNzK0v7QbzpKaBnMsds3eKekj0MmNrjCeq5-A8T4EWMCNWuBTTP74I6QBZCo07t_uAkTaj0F_ECINnKUzap/s1600/VIP.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The test object.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;The size of the aperture of the lens is varied and the resulting image is observed.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYK1kjamn3nfe0N2yMZshhzXPvtlb3LGCaO3FQIznrPY1ko5mq35lSdhQXigRw-QPC1y4PxtAkyaDw6MMPkKrZqHq7yYCec9cTS62G_TMcseCUXsi04mDGCEyzaPLDuHUNc08ryoQVNPBu/s1600/compiled+lens.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;155&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYK1kjamn3nfe0N2yMZshhzXPvtlb3LGCaO3FQIznrPY1ko5mq35lSdhQXigRw-QPC1y4PxtAkyaDw6MMPkKrZqHq7yYCec9cTS62G_TMcseCUXsi04mDGCEyzaPLDuHUNc08ryoQVNPBu/s640/compiled+lens.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The lens used in varying aperture sizes.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;When the test object is convolved with the lens having different aperture sizes, the results are as follows.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvTrZGKnkhfHiI3Mw6gYZfY0tUat4g2SDSbrkMEq-Cw2vssDmqsUVkUjP8zeUYN7HFrg6TJsHGaP96oOhi14WqWG4QTCdIO_iOe6eteBo2NjP-ZIdxf56HfEHG3DvS4QZMtWS_TmhO3vGO/s1600/VIP+compiled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvTrZGKnkhfHiI3Mw6gYZfY0tUat4g2SDSbrkMEq-Cw2vssDmqsUVkUjP8zeUYN7HFrg6TJsHGaP96oOhi14WqWG4QTCdIO_iOe6eteBo2NjP-ZIdxf56HfEHG3DvS4QZMtWS_TmhO3vGO/s320/VIP+compiled.png&quot; width=&quot;316&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The resulting images are shown for different aperture sizes. First row images correspond to the first two aperture sizes and the second row is for the last two aperture sizes presented previously.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;text-align: left;&quot;&gt;As the size of the aperture of the lens increases, the quality of the image produced also increases. The quality of the reconstruction is dependent on the amount of light rays reflected from the object entering the lens. For the reconstruction to be of good quality, the size of the aperture must be wide enough to gather all the rays that reflected from the object. But in reality, this is not the case because most lens used in imaging has finite aperture size, i.e., the quality of the image produced is also limited.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Correlation&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;The correlation between two functions &lt;i&gt;f&lt;/i&gt; and &lt;i&gt;g&lt;/i&gt;, which are both 2-dimensional functions, is given by&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiUKWbt8l1wGDPr5qsM_8wpnaL8xQOz_GcK8N-KBMvgePzIJpdM9okiTUmLMgeZbAGhWsXExg_6dTsXuPVZGh88_fd1I9QtdLFyBj_91fQByTKne5ACT5Sx7Ibs7ZZ0XPibT_WdSssVl3T/s1600/correlation+eqn.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;42&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiUKWbt8l1wGDPr5qsM_8wpnaL8xQOz_GcK8N-KBMvgePzIJpdM9okiTUmLMgeZbAGhWsXExg_6dTsXuPVZGh88_fd1I9QtdLFyBj_91fQByTKne5ACT5Sx7Ibs7ZZ0XPibT_WdSssVl3T/s400/correlation+eqn.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Correlation integral&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;or is written simply as&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;i&gt;p &lt;/i&gt;= &lt;i&gt;f &lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 14.0pt; line-height: 115%; mso-ansi-language: EN-PH; mso-ascii-theme-font: minor-latin; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;ʘ&lt;/span&gt;&lt;/i&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:TrackMoves/&gt;   &lt;w:TrackFormatting/&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:DoNotPromoteQF/&gt;   &lt;w:LidThemeOther&gt;EN-PH&lt;/w:LidThemeOther&gt;   &lt;w:LidThemeAsian&gt;ZH-CN&lt;/w:LidThemeAsian&gt;   &lt;w:LidThemeComplexScript&gt;AR-SA&lt;/w:LidThemeComplexScript&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:ApplyBreakingRules/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:SplitPgBreakAndParaMark/&gt;    &lt;w:DontVertAlignCellWithSp/&gt;    &lt;w:DontBreakConstrainedForcedTables/&gt;    &lt;w:DontVertAlignInTxbx/&gt;    &lt;w:Word11KerningPairs/&gt;    &lt;w:CachedColBalance/&gt;    &lt;w:UseFELayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathPr&gt;    &lt;m:mathFont m:val=&quot;Cambria Math&quot;/&gt;    &lt;m:brkBin m:val=&quot;before&quot;/&gt;    &lt;m:brkBinSub m:val=&quot;&amp;#45;-&quot;/&gt;    &lt;m:smallFrac m:val=&quot;off&quot;/&gt;    &lt;m:dispDef/&gt;    &lt;m:lMargin m:val=&quot;0&quot;/&gt;    &lt;m:rMargin m:val=&quot;0&quot;/&gt;    &lt;m:defJc m:val=&quot;centerGroup&quot;/&gt;    &lt;m:wrapIndent m:val=&quot;1440&quot;/&gt;    &lt;m:intLim m:val=&quot;subSup&quot;/&gt;    &lt;m:naryLim m:val=&quot;undOvr&quot;/&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; DefUnhideWhenUsed=&quot;true&quot;
  DefSemiHidden=&quot;true&quot; DefQFormat=&quot;false&quot; DefPriority=&quot;99&quot;
  LatentStyleCount=&quot;267&quot;&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;0&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Normal&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;heading 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 7&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 8&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 9&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 7&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 8&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 9&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;35&quot; QFormat=&quot;true&quot; Name=&quot;caption&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;10&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Title&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;1&quot; Name=&quot;Default Paragraph Font&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;11&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Subtitle&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;22&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Strong&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;20&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Emphasis&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;59&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Table Grid&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; UnhideWhenUsed=&quot;false&quot; Name=&quot;Placeholder Text&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;1&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;No Spacing&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; UnhideWhenUsed=&quot;false&quot; Name=&quot;Revision&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;34&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;List Paragraph&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;29&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Quote&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;30&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Intense Quote&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 1&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 2&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 3&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 4&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 5&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 6&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;19&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Subtle Emphasis&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;21&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Intense Emphasis&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;31&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Subtle Reference&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;32&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Intense Reference&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;33&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Book Title&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;37&quot; Name=&quot;Bibliography&quot;/&gt;   &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; QFormat=&quot;true&quot; Name=&quot;TOC Heading&quot;/&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-priority:99;
 mso-style-qformat:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin-top:0in;
 mso-para-margin-right:0in;
 mso-para-margin-bottom:10.0pt;
 mso-para-margin-left:0in;
 line-height:115%;
 mso-pagination:widow-orphan;
 font-size:11.0pt;
 font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
 mso-ascii-font-family:Calibri;
 mso-ascii-theme-font:minor-latin;
 mso-hansi-font-family:Calibri;
 mso-hansi-theme-font:minor-latin;
 mso-bidi-font-family:Arial;
 mso-bidi-theme-font:minor-bidi;}
&lt;/style&gt; &lt;![endif]--&gt;&lt;i&gt;g&lt;/i&gt; = &lt;i&gt;f&lt;/i&gt;(-&lt;i&gt;x&lt;/i&gt;, -&lt;i&gt;y&lt;/i&gt;)*&lt;i&gt;g&lt;/i&gt;(&lt;i&gt;x&lt;/i&gt;, &lt;i&gt;y&lt;/i&gt;)&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Observe the similarity between the correlation integral and convolution integral. The difference is on the signs inside the function &lt;i&gt;g&lt;/i&gt;. We expect that there also exists a correlation theorem similar to that of the convolution theorem. This then holds for linear transforms of both&lt;i&gt; f&lt;/i&gt; and &lt;i&gt;g&lt;/i&gt; and is given by&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;i&gt;P = F*G&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;where &lt;i&gt;P&lt;/i&gt;, &lt;i&gt;F&lt;/i&gt; and &lt;i&gt;G&lt;/i&gt; are the Fourier transforms of &lt;i&gt;p&lt;/i&gt;, &lt;i&gt;f&lt;/i&gt; and &lt;i&gt;g&lt;/i&gt;, respectively. The asterisk above &lt;i&gt;F&lt;/i&gt; indicates complex conjugation.The correlation &lt;i&gt;p &lt;/i&gt;measures the degree of similarity between two functions &lt;i&gt;f&lt;/i&gt; and &lt;i&gt;g&lt;/i&gt;. High correlation value at a certain point signifies that the two functions are most likely identical at that point. This has applications on template matching or pattern recognition.Something nice happens when the function &lt;i&gt;g&lt;/i&gt; is even. Both integrals for correlation and convolution are the same.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;To see how correlation works in template matching, we correlate the image shown below with another image containing only the letter A having the same font style and size with that of the other image.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjN_NrJ0p6iPCRnpsuyh_uOuUL2mdrBfLMPQP0iwbLJL3JBXsl2_CWr6dvUeoDB9rVkEqqoJ_1-HUHXWil9a3gclph9E77I19WmkkTEdo6ZHyFMZfiljHklxEibguEN_ffvdDDVNT_5Qr6f/s1600/The+rain+in+Spain.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjN_NrJ0p6iPCRnpsuyh_uOuUL2mdrBfLMPQP0iwbLJL3JBXsl2_CWr6dvUeoDB9rVkEqqoJ_1-HUHXWil9a3gclph9E77I19WmkkTEdo6ZHyFMZfiljHklxEibguEN_ffvdDDVNT_5Qr6f/s200/The+rain+in+Spain.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Shown is the test object which we want to correlate with an  image containing the letter A. Note that the letter A has the same font style  and size  similar to that of the A&#39;s found on the test object. &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&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 style=&quot;text-align: left;&quot;&gt;Our goal is to locate all the A&#39;s in the test object using a template containing the letter A. We utilize the correlation theorem to do this. The result is shown below.&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm6vDQEWfncOPzgiow_dgTWl3hxwORh3amICtbQ_GJk_YShIzJS7qH13UgNyFjpR0CyRsNSjdjXsLI0hfcr1lK5rw5uZZTMwyUoqsuJHhlQ4zU10iNwX9JFgnyxdisHdlJTCf-UlC9Y4Jl/s1600/correlation+A.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;313&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm6vDQEWfncOPzgiow_dgTWl3hxwORh3amICtbQ_GJk_YShIzJS7qH13UgNyFjpR0CyRsNSjdjXsLI0hfcr1lK5rw5uZZTMwyUoqsuJHhlQ4zU10iNwX9JFgnyxdisHdlJTCf-UlC9Y4Jl/s640/correlation+A.bmp&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The result is pretty amazing. Take a look on the locations of the A&#39;s in the previous image and locate it on the image. What do you see?&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;text-align: left;&quot;&gt;The locations of A have the highest correlation values as marked by the observed &lt;i&gt;twinkles &lt;/i&gt;on the sites. This suggests that indeed correlation can be applied on template matching such as this one.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Edge detection can also be done using the convolution integral. We want to convolve the &lt;b&gt;VIP&lt;/b&gt; image shown above with different patterns. Some of the patterns used are shown below.&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6Rc4s4P30-FX_ZJohCa7qRPWYLYh2pzemIj06R_Z7GIX-kxRqWEB8BHjCJsljpFhZcGUrOxLEDJ2R1joYdEBLy6YewABmp7WiUQNW_cSQzSsVkR3bG-PRDMTe0MCju3mBYQU2-RLtbwpx/s1600/patterns.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6Rc4s4P30-FX_ZJohCa7qRPWYLYh2pzemIj06R_Z7GIX-kxRqWEB8BHjCJsljpFhZcGUrOxLEDJ2R1joYdEBLy6YewABmp7WiUQNW_cSQzSsVkR3bG-PRDMTe0MCju3mBYQU2-RLtbwpx/s320/patterns.png&quot; width=&quot;155&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The patterns used. Take note that the sum of all the elements of the matrix must be zero.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;text-align: left;&quot;&gt;The results are shown below for the convolution of the &lt;b&gt;VIP&lt;/b&gt; image with the different patterns.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijzg337Vv2eTdvABtBPjjQSzA3jwKwTM9IVf6u-Ru9FdGWTzZHTOaxjfkskZ2GZVyvC47ZrmyYK4b4XxF_l32wAZAcOnU3BCQMfexSDtsKzKOn_XpXO4O-0jTqE8bK_SmQwgY9FcMPwu13/s1600/VIP+compiled+convo.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;317&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijzg337Vv2eTdvABtBPjjQSzA3jwKwTM9IVf6u-Ru9FdGWTzZHTOaxjfkskZ2GZVyvC47ZrmyYK4b4XxF_l32wAZAcOnU3BCQMfexSDtsKzKOn_XpXO4O-0jTqE8bK_SmQwgY9FcMPwu13/s320/VIP+compiled+convo.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;First row: horizontal, verticals. Second row: spot, diagonal patterns.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Since convolution took place, we expect that the resulting image appears like the convolved images, i.e., the &lt;b&gt;VIP&lt;/b&gt; image and the pattern. We have seen that the above results contain the word &lt;b&gt;VIP &lt;/b&gt;or parts of it. It is observed that edge detection is best when the image is convolved with a spot pattern. Convolution with a horizontal patterns outputs most edges that are horizontal. On the other hand, a vertical pattern is good in displaying the vertical edges. The diagonal pattern has the least accuracy in terms of edge detection. &lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;For this activity, I am giving myself a grade of 10. This activity is a good starting point for beginners in FT model of image formation. I have encountered the terms convolution and correlation, as well as Fourier transform, so many times that I have memorized them. It feels good to know how these things work, i.e., their applications, the things that can be done using these concepts. There was this one activity in 185 wherein I encountered the Scilab function &lt;b&gt;fftshift()&lt;/b&gt;. It is quite embarrassing to admit right now that through this activity I am able to discover what this function really does. When trying to attack something that appears to be complex, starting on the basics is really and should be the first step to be done. &lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;/div&gt;&lt;ul&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://anythingphysics.blogspot.com/feeds/5374345228479515146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anythingphysics.blogspot.com/2011/07/fourier-transform-model-of-image.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/5374345228479515146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/5374345228479515146'/><link rel='alternate' type='text/html' href='http://anythingphysics.blogspot.com/2011/07/fourier-transform-model-of-image.html' title='Fourier Transform Model of Image Formation'/><author><name>Jen-Jen Manuel</name><uri>http://www.blogger.com/profile/17781945162053242109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio7WYdtUaWDpY0vUR8rmhXb6vLXc_NJhfW7210lMlbkFxjcoaf31CZ38KIuNSzomRZXPSXX9zYuME75wQBlwP99KltNLXSivQIMcdocBxzVUhe4t36aIu_krVWKUOErA4/s220/49936_1530407762_2876926_n.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1BCl8R3dJel8MfW34cbmUet6pNl9Nu7YcfLgSuFZBo-kDa-hNZ5o2hfmxc_7Di-TjMYM29KpO7JmHsttWcVmErYUtGfjlLXjT3Ndp7t2ljb_kC3oSnqVL136cz8bJhHah6CFgkAaNihoA/s72-c/FT+eqn.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2748687604404631686.post-4657537054548926022</id><published>2011-07-06T02:02:00.002+08:00</published><updated>2011-07-06T02:14:55.521+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CDF"/><category scheme="http://www.blogger.com/atom/ns#" term="GIMP"/><category scheme="http://www.blogger.com/atom/ns#" term="histogram manipulation"/><category scheme="http://www.blogger.com/atom/ns#" term="image enhancement"/><category scheme="http://www.blogger.com/atom/ns#" term="PDF"/><title type='text'>Enhancement by Histogram Manipulation</title><content type='html'>&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;The graylevel probability distribution function (&lt;a href=&quot;http://en.wikipedia.org/wiki/Probability_density_function&quot;&gt;PDF&lt;/a&gt;) of a grayscale image is equal to its histogram normalized to the total number of pixels found in the image. The quality of an image can be improved by manipulating its so-called histogram. By doing so, certain features of an image can be improved. Also, the response of different imaging systems can also be mimicked by histogram manipulation. The grayscale PDF of an image can then be changed by backprojecting the grayscale values using the cumulative distribution function (&lt;a href=&quot;http://en.wikipedia.org/wiki/Cumulative_distribution_function&quot;&gt;CDF&lt;/a&gt;) of a desired PDF.&lt;br /&gt;
&lt;br /&gt;
The following statements further explain how the technique works.&lt;br /&gt;
&lt;br /&gt;
Given the probability distribution function&lt;i&gt; p&lt;span style=&quot;font-size: xx-small;&quot;&gt;1&lt;/span&gt;(r)&lt;/i&gt; of the graylevels&lt;i&gt; r &lt;/i&gt;of an image and the corresponding cumulative distribution function &lt;i&gt;T(r)&lt;/i&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9hcF2-v0XNLazHToXcluRPWEGtzVvb2UWG9prOKpr1FtW-HZMXpQKYERAt4zddWxdU4nSlFcKiC8l6j7_2PrOnqTmBenlUQSfVRpcWo6HBwE7p6fD7_gXMi_5hEuxZSd9xAQ8FjOS_-d8/s1600/cdf+eqn.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9hcF2-v0XNLazHToXcluRPWEGtzVvb2UWG9prOKpr1FtW-HZMXpQKYERAt4zddWxdU4nSlFcKiC8l6j7_2PrOnqTmBenlUQSfVRpcWo6HBwE7p6fD7_gXMi_5hEuxZSd9xAQ8FjOS_-d8/s1600/cdf+eqn.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Equation 1&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;where g is a dummy variable here, we plan to map all the graylevels &lt;i&gt;r&lt;/i&gt; to a different set of graylevels &lt;i&gt;z&lt;/i&gt;. This then gives us a new cumulative distribution function &lt;i&gt;G(z)&lt;/i&gt; given by&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlGBedSjgJZPa3bD1gsmicuMF1M57IjN9LJDrGOUhKRt56GZmLaBuRdKGIwTLUEWh2KeRCe5xsEkuBe6vf9sKqKAWJR57Cm1NdeI03xNfc9qcUkAHIjV3ak2rLIeKUUVWvT3HeHD5itSEH/s1600/cdf+eqn+2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlGBedSjgJZPa3bD1gsmicuMF1M57IjN9LJDrGOUhKRt56GZmLaBuRdKGIwTLUEWh2KeRCe5xsEkuBe6vf9sKqKAWJR57Cm1NdeI03xNfc9qcUkAHIjV3ak2rLIeKUUVWvT3HeHD5itSEH/s1600/cdf+eqn+2.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Equation 2&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;wherein we have a new PDF &lt;i&gt;p&lt;span style=&quot;font-size: xx-small;&quot;&gt;2&lt;/span&gt;(z)&lt;/i&gt; corresponding to the transformed image. Take note also that &lt;i&gt;t&lt;/i&gt; is a dummy variable. To summarize all, the equation below shows how the graylevels&lt;i&gt; r&lt;/i&gt; are map to a different set of graylevels &lt;i&gt;z&lt;/i&gt;. &lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsMCSj01in4K6e4BRd6mgfb5GBGEqdhCscLqYp8qo4mQwAk0wZOnr9TVUxxFfMk3tEb_fM8-vfBEzfAMh8__iT9xsDmo-SvF9eapB4G9ELotTDUCppcmYlb6o6uVy9JSjjFFIyS9wAzdg8/s1600/summary+of+eqns.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsMCSj01in4K6e4BRd6mgfb5GBGEqdhCscLqYp8qo4mQwAk0wZOnr9TVUxxFfMk3tEb_fM8-vfBEzfAMh8__iT9xsDmo-SvF9eapB4G9ELotTDUCppcmYlb6o6uVy9JSjjFFIyS9wAzdg8/s1600/summary+of+eqns.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Equation 3&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK4Q6l5zvH8BcTZ3hvbKwrYQtDDlFTBhrhrlYzZAgzKtkpFw6ek9bneiXEg93QLVM4Xr1gco0jCqqsO9qpP2kY0rOoFowlJpkkuDjXSjFRqvX_aL0GJN-_JAM2gyexANWgu7Cp9SKvGENn/s1600/summary+figure.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;251&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK4Q6l5zvH8BcTZ3hvbKwrYQtDDlFTBhrhrlYzZAgzKtkpFw6ek9bneiXEg93QLVM4Xr1gco0jCqqsO9qpP2kY0rOoFowlJpkkuDjXSjFRqvX_aL0GJN-_JAM2gyexANWgu7Cp9SKvGENn/s640/summary+figure.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;blockquote&gt;1-2. For a grayscale level &lt;i&gt;r&lt;/i&gt;, find its corresponding CDF value &lt;i&gt;T(r)&lt;/i&gt;. &lt;br /&gt;
3. Find the value of &lt;i&gt;T(r)&lt;/i&gt; in the y-axis of the CDF &lt;i&gt;G(z)&lt;/i&gt;. &lt;br /&gt;
4. Finally, find the corresponding &lt;i&gt;z&lt;/i&gt; value of the obtained &lt;i&gt;G(z)&lt;/i&gt;.&lt;/blockquote&gt;To apply all the concepts that we just learned, we are to improve the quality of the image shown below, i.e., through histogram manipulation.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmfwhx_9gp0i8p96UQ-EXvww85k4VTySTh1akmhXqnvIyW6ERIWn3wl_1ScKTa9RYRq9OFd-aSyk10R747i7ms0nFYU6NJQnHQvvBKP56JsVIDsfkl5iZbtdbr9ppczVl1qEI09lfwC0Iz/s400/image.JPG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot; width=&quot;400&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;A photo of the sunset at Roxas boulevard courtesy of my friend Desiree Badua. &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&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/AVvXsEgmfwhx_9gp0i8p96UQ-EXvww85k4VTySTh1akmhXqnvIyW6ERIWn3wl_1ScKTa9RYRq9OFd-aSyk10R747i7ms0nFYU6NJQnHQvvBKP56JsVIDsfkl5iZbtdbr9ppczVl1qEI09lfwC0Iz/s1600/image.JPG&quot; imageanchor=&quot;1&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;The image is then converted to grayscale and the result is as follows. Also, the histogram of the grayscale image is shown below. The histogram shows that most of the graylevel values are concentrated near the area corresponding to black. This is evident in the image shown below. In order to make the image appear brighter, we want a histogram wherein the graylevel values are well spread from 0 to 255.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgblCmKJCJXgF9hJuYrzfhFiyCBFjXfEI_-7sJr8tRK_d4VVWPbeI4rFGJAg4FCtZHe9-cz0F11LrVr86u6PSfHufHuyBDzW0tr7TYKG7ShwGSyjR32P182Ku3MGHVUvdigpuNeE_vJgjs5/s1600/gray.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgblCmKJCJXgF9hJuYrzfhFiyCBFjXfEI_-7sJr8tRK_d4VVWPbeI4rFGJAg4FCtZHe9-cz0F11LrVr86u6PSfHufHuyBDzW0tr7TYKG7ShwGSyjR32P182Ku3MGHVUvdigpuNeE_vJgjs5/s400/gray.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The grayscale image.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;290&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeFD4zkVZ7WI_o0Y6Z6VW8v2cUWqwkVbU5c5ABJHskxVMYv3YgaMrgvPvkstLjSjzCN680af1gnmto769Nd8MHTDVk_7fNbnnPopK-70m36lmrptCOYpCkL37DzBqwv3-i7AKVFJTjsZ5m/s640/histogram.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot; width=&quot;640&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The histogram of the grayscale image.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&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: left;&quot;&gt;In order to find for the probability distribution function of the grayscale image, we need to normalized the histogram shown above to the total number of pixels in the image, i.e., 1024x768 pixels.&amp;nbsp;&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;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo523kUhiQYLTkdc5LU2oqxksH2MuJ_BdD4yD9DAdlp12UDdLgCvEVuGlHKWKdUUgfqY6IBcsuNCSL4Ad6N8ZAm9gn54C3-uuR6XZTsTE-iz8PDLtHBgSdxA4j9OINpYHYoOjGwtcmZqxU/s1600/histogram+normalized.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;385&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo523kUhiQYLTkdc5LU2oqxksH2MuJ_BdD4yD9DAdlp12UDdLgCvEVuGlHKWKdUUgfqY6IBcsuNCSL4Ad6N8ZAm9gn54C3-uuR6XZTsTE-iz8PDLtHBgSdxA4j9OINpYHYoOjGwtcmZqxU/s640/histogram+normalized.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The PDF or the normalized histogram of the grayscale image. Take note that the range of x is from 0 to 255. &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&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: left;&quot;&gt;The CDF of the above PDF can be found by using equation 1. When implemented using Scilab, the CDF can be found by performing a cumulative sum over all values of the PDF. The result is shown below.&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWvrmssCk6TFjV2dCRUYyxQGaKjZb5bIGiGnG_WicwCr02aTLHoKQfrlbHOIVeXwbRbhwsgttBWNaIUIeHljJwNUhD-z3byen5FEHPEDNTlKFctzkjJMiP-A-fKFZI8mhKgcfyzj0vIt-A/s1600/cdf.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;251&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWvrmssCk6TFjV2dCRUYyxQGaKjZb5bIGiGnG_WicwCr02aTLHoKQfrlbHOIVeXwbRbhwsgttBWNaIUIeHljJwNUhD-z3byen5FEHPEDNTlKFctzkjJMiP-A-fKFZI8mhKgcfyzj0vIt-A/s400/cdf.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The values of x range from 0 to 255.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;We then create our desired CDF to be able to start the image enhancement. Based on this CDF, the image will now be transformed. We first try a linear CDF shown below.&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: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkZElf1lms5nvP6VFWQk8AcDYRt_Nxf3RKLFA-M-nOetXzsgtfFrnVrli_NrGzxkB4QEjrNqkdLObpDB21Zdv2NDYCP2eHbVOaYGAoJKNT6j42igfwpQ5hhy9KR3R5GMIn2K80jhBlHSBf/s1600/linear+cdf.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;289&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkZElf1lms5nvP6VFWQk8AcDYRt_Nxf3RKLFA-M-nOetXzsgtfFrnVrli_NrGzxkB4QEjrNqkdLObpDB21Zdv2NDYCP2eHbVOaYGAoJKNT6j42igfwpQ5hhy9KR3R5GMIn2K80jhBlHSBf/s640/linear+cdf.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;A desired linear CDF given by the equation &lt;i&gt;G(z)&lt;/i&gt; = 1/255 &lt;i&gt;z&lt;/i&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;The main idea is to map the original set of graylevels &lt;i&gt;r&lt;/i&gt; (0-255) to a different set of graylevels &lt;i&gt;z&lt;/i&gt;. This is what the following code snippet performs. Having obtained the new set of graylevels &lt;i&gt;z&lt;/i&gt;, we are to set the graylevel value &lt;i&gt;r&lt;span style=&quot;font-size: xx-small;&quot;&gt;i&lt;/span&gt;&lt;/i&gt; of each pixel in the image to its corresponding graylevel &lt;i&gt;z&lt;span style=&quot;font-size: xx-small;&quot;&gt;i&lt;/span&gt;&lt;/i&gt;.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1_s_mBwcZwu7X-svqkPkku166ilUSLP9ZRkNgIIsLpixZBkXaRKqSqcQwTyw9-7G0w2oUNT5MASjUvdA41FYDdbYaOce4ztd2lI0Ge7FHNIrP2QXz7VWX8CE7Cd925iWugKKY4wtpZ6-n/s1600/code+for+linear.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1_s_mBwcZwu7X-svqkPkku166ilUSLP9ZRkNgIIsLpixZBkXaRKqSqcQwTyw9-7G0w2oUNT5MASjUvdA41FYDdbYaOce4ztd2lI0Ge7FHNIrP2QXz7VWX8CE7Cd925iWugKKY4wtpZ6-n/s640/code+for+linear.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Remember that each element of vector &lt;i&gt;z&lt;/i&gt; corresponds to each element of &lt;i&gt;r&lt;/i&gt;. Also, the key here is equation 3.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Instead of getting analytically the inverse of the CDF&lt;i&gt; G(z)&lt;/i&gt;, I tried using the function &lt;b&gt;[y&lt;span style=&quot;font-size: xx-small;&quot;&gt;p&lt;/span&gt;] = interp1(x, y, x&lt;span style=&quot;font-size: xx-small;&quot;&gt;p&lt;/span&gt;)&lt;/b&gt; in Scilab 5.3.2. Apparently, I am given a set vectors for x, y and y&lt;span style=&quot;font-size: xx-small;&quot;&gt;p&lt;/span&gt;, i.e., &lt;i&gt;z&lt;/i&gt;, &lt;i&gt;G(z)&lt;/i&gt; and &lt;i&gt;T(r)&lt;/i&gt;, respectively. When using this function, x&lt;span style=&quot;font-size: xx-small;&quot;&gt;p&lt;/span&gt; and y&lt;span style=&quot;font-size: xx-small;&quot;&gt;p&lt;/span&gt; should not be used interchangeably. Unfortunately, we can not utilize this one. This made me proceed to my last resort: finding the inverse of the desired CDF &lt;i&gt;G(z)&lt;/i&gt;.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_w79IMrPcPurXfh0b3iZP_DDFzRl-JbJe81QbjQA-A_WOEzKQeeyofQ-xrO6Rq0CP_ccAsUR6zpjtJyfPuMCEJ-eaazkIld_SckbFncT4QWv2QaSARct7lbPBYbuRW-MUz0odWzsLmpJ9/s1600/gray+modified.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_w79IMrPcPurXfh0b3iZP_DDFzRl-JbJe81QbjQA-A_WOEzKQeeyofQ-xrO6Rq0CP_ccAsUR6zpjtJyfPuMCEJ-eaazkIld_SckbFncT4QWv2QaSARct7lbPBYbuRW-MUz0odWzsLmpJ9/s400/gray+modified.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The modified image using a linear CDF.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Also, its corresponding PDF and CDF are shown below. It is clear that this time the graylevels are at least well distributed from 0 (black) to 255(white).&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ47g3xfcKtqNIz4FOufMnvMYF783dMdXqXKtG0wya2wCaY7KBVu0S0veEg4o5hpO-LtaKdGjK2L0UGxAiX4WmSPLBSVE4Fi0JKDQaNUJfnEeBcDYFMixcSwNEhBomu-obDHw7yQvmiHUR/s1600/histogram+linear+cdf+normalized.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;252&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ47g3xfcKtqNIz4FOufMnvMYF783dMdXqXKtG0wya2wCaY7KBVu0S0veEg4o5hpO-LtaKdGjK2L0UGxAiX4WmSPLBSVE4Fi0JKDQaNUJfnEeBcDYFMixcSwNEhBomu-obDHw7yQvmiHUR/s400/histogram+linear+cdf+normalized.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The PDF of the enhanced image.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZUEufaFrkYfCREBiUxV4R_wqMEP_Sd95YVkktEFmoUPiKcAI98Hb1ik-3HD0f4LwEKJ0zAEQSquVcX_PmSIO5-HmMD7276zU895DFvYeMVZ-uBo9GMb3fToOELQa8vIPjyEtfYV28ad8l/s1600/cdf+linear+check.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;301&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZUEufaFrkYfCREBiUxV4R_wqMEP_Sd95YVkktEFmoUPiKcAI98Hb1ik-3HD0f4LwEKJ0zAEQSquVcX_PmSIO5-HmMD7276zU895DFvYeMVZ-uBo9GMb3fToOELQa8vIPjyEtfYV28ad8l/s400/cdf+linear+check.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The corresponding CDF of the enhanced image.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Let us then try using a nonlinear CDF and see the effect on the image. A parabolic CDF given by the equation of the form &lt;i&gt;G(z)&lt;/i&gt; = &lt;i&gt;Az&lt;sup&gt;2&lt;/sup&gt;&lt;/i&gt; is shown below.&amp;nbsp;&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnS4WlhOROl6ctcxbSxHwcU4ckpLwRZibxb1GvqEXImkXm4gTPxNAs96EMbJbCTOq2Wy0PY6X4viwOf5yHqfbhAhqWOYegqqAztSMU2ivJOoKSqMYJUg6bM2k7H7ZezM5nCxTATNcqfpf2/s1600/nonlinear+cdf.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;301&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnS4WlhOROl6ctcxbSxHwcU4ckpLwRZibxb1GvqEXImkXm4gTPxNAs96EMbJbCTOq2Wy0PY6X4viwOf5yHqfbhAhqWOYegqqAztSMU2ivJOoKSqMYJUg6bM2k7H7ZezM5nCxTATNcqfpf2/s400/nonlinear+cdf.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;A nonlinear CDF &lt;i&gt;G(z) &lt;/i&gt;= 3z&lt;sup&gt;2&lt;/sup&gt;/195075.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;The code used to generate the modified image for this CDF is similar with that of the linear CDF.&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijW8QVVUzhOXc6DFEUd1KG3VJAhWd3KXuFG_8bHlrR1HBd9LziqbVNPlF0Dgo6JkF5dpi2TAa9pGWMgVP_BLO754JPna8ZpEaXy7oImrG5Q0Fvos2SPg6qbf0Ratz0lEiCe_opVDMmanMV/s1600/code+for+nonlinear.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;176&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijW8QVVUzhOXc6DFEUd1KG3VJAhWd3KXuFG_8bHlrR1HBd9LziqbVNPlF0Dgo6JkF5dpi2TAa9pGWMgVP_BLO754JPna8ZpEaXy7oImrG5Q0Fvos2SPg6qbf0Ratz0lEiCe_opVDMmanMV/s640/code+for+nonlinear.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The code for image enhancement using the nonlinear CDF.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;The resulting image is shown below.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEaQsWypXOtvW2J7hd2dM-x0nnM8NXrM6gjIQ2TWmZj6_GV3v1HceV8KCgd1o7FNtIqbWI_iNdSbfpSau2xxNH0foTifyK91wm_ZbcVTL5mSSTeEuw4aAbePLjTO3JmXbDWQTG0str6L36/s1600/gray+modified+nonlinear.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEaQsWypXOtvW2J7hd2dM-x0nnM8NXrM6gjIQ2TWmZj6_GV3v1HceV8KCgd1o7FNtIqbWI_iNdSbfpSau2xxNH0foTifyK91wm_ZbcVTL5mSSTeEuw4aAbePLjTO3JmXbDWQTG0str6L36/s400/gray+modified+nonlinear.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Notice that this appears to be whiter in color compared to the previously enhanced image using a linear CDF.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;For the above modified image, its PDF and CDF are shown below.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpgngU55rV7c6c24R6tH6BjtnRRbiu3vUQKEdnprzVMBFOdxZzxaI11jXiDbXbN_l8Rkli06bwOGWeGNvrZQ3WnisyepoLTj_nKhW4erFlPYz56ai_w0rz-aZC0PTjmGnKw70EosibOCxy/s1600/histogram+nonlinear+cdf+normalized.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;301&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpgngU55rV7c6c24R6tH6BjtnRRbiu3vUQKEdnprzVMBFOdxZzxaI11jXiDbXbN_l8Rkli06bwOGWeGNvrZQ3WnisyepoLTj_nKhW4erFlPYz56ai_w0rz-aZC0PTjmGnKw70EosibOCxy/s400/histogram+nonlinear+cdf+normalized.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The PDF of the enhanced image using a nonlinear CDF.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmIhjYieQ8yuBjJH7QUKfY-w_LaQac6TqEeEuZgvO6yGeY_rmVtpAYTAV9wCp-BTRcG3xXLG1cgPeH5PZGKWn1kZUWfwtXc-OE5dIA-ESIkfbCdhJPGXoeVRyXiLwVwB6Mhy_R2_tpx-lo/s1600/cdf+nonlinear+check.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;252&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmIhjYieQ8yuBjJH7QUKfY-w_LaQac6TqEeEuZgvO6yGeY_rmVtpAYTAV9wCp-BTRcG3xXLG1cgPeH5PZGKWn1kZUWfwtXc-OE5dIA-ESIkfbCdhJPGXoeVRyXiLwVwB6Mhy_R2_tpx-lo/s400/cdf+nonlinear+check.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;It appears that the recovered CDF for this enhanced image is no longer smooth unlike the original CDF that we wanted.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Histogram manipulation can be found in some image processing software (e.g. GIMP). Shown below are snapshots showing the GIMP environment and how histogram manipulation is easily done.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMtbl8agGuOhVdwEMSMRlhHdMaX2arv3tGCZQ2JWxNu2cf1cORZddnsqU4UX5HzNTcrjm4IVfD-faWD-nHPA0l3OwJxxuO28L5yWX8mXRCEprwBUSEjHGs9JlP3-AredtHPVG1KgaoGCjs/s1600/Gimp+1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;284&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMtbl8agGuOhVdwEMSMRlhHdMaX2arv3tGCZQ2JWxNu2cf1cORZddnsqU4UX5HzNTcrjm4IVfD-faWD-nHPA0l3OwJxxuO28L5yWX8mXRCEprwBUSEjHGs9JlP3-AredtHPVG1KgaoGCjs/s640/Gimp+1.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Notice that the desired CDF in this case is not actually a function since there is no one-to-one correspondence that exists between the x and y-axes.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfSVzcY4hlstbFIFEW_sCJP8HTUvfZPokW5OEqaPwNkhWr9duP0pSNvBAyno5D-t38_3AR62Ud5qMWADyivLqzKKX8BqYoWHdO2rlen7OKLSxUfRmPb13X28al6_m2SC012L1vnfxK5nbT/s1600/Gimp+2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;280&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfSVzcY4hlstbFIFEW_sCJP8HTUvfZPokW5OEqaPwNkhWr9duP0pSNvBAyno5D-t38_3AR62Ud5qMWADyivLqzKKX8BqYoWHdO2rlen7OKLSxUfRmPb13X28al6_m2SC012L1vnfxK5nbT/s640/Gimp+2.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;In this case, I tried to mimick a step function for the desired CDF.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;What I have learned in this activity is that through histogram manipulation, information stored in an image that appears to be invisible to the eye can be recovered or seen. We are lucky that most of the software used in image processing today has functions that deal with histogram manipulation. Doing this activity made me appreciate a lot of things. Slowly, those stereotypes I had for image processing are vanishing. I did enjoy doing this activity. And for that, I am giving myself a grade of 10.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;References:&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Enhancement by Histogram Manipulation 2010, Soriano M., Applied Physics 186.&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://anythingphysics.blogspot.com/feeds/4657537054548926022/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anythingphysics.blogspot.com/2011/07/enhancement-by-histogram-manipulation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/4657537054548926022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/4657537054548926022'/><link rel='alternate' type='text/html' href='http://anythingphysics.blogspot.com/2011/07/enhancement-by-histogram-manipulation.html' title='Enhancement by Histogram Manipulation'/><author><name>Jen-Jen Manuel</name><uri>http://www.blogger.com/profile/17781945162053242109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio7WYdtUaWDpY0vUR8rmhXb6vLXc_NJhfW7210lMlbkFxjcoaf31CZ38KIuNSzomRZXPSXX9zYuME75wQBlwP99KltNLXSivQIMcdocBxzVUhe4t36aIu_krVWKUOErA4/s220/49936_1530407762_2876926_n.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9hcF2-v0XNLazHToXcluRPWEGtzVvb2UWG9prOKpr1FtW-HZMXpQKYERAt4zddWxdU4nSlFcKiC8l6j7_2PrOnqTmBenlUQSfVRpcWo6HBwE7p6fD7_gXMi_5hEuxZSd9xAQ8FjOS_-d8/s72-c/cdf+eqn.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2748687604404631686.post-8304455264055454176</id><published>2011-06-29T01:04:00.008+08:00</published><updated>2011-06-30T15:29:29.332+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="area estimation"/><category scheme="http://www.blogger.com/atom/ns#" term="blob"/><category scheme="http://www.blogger.com/atom/ns#" term="follow( )"/><category scheme="http://www.blogger.com/atom/ns#" term="Green&#39;s Theorem"/><category scheme="http://www.blogger.com/atom/ns#" term="UP Diliman"/><title type='text'>Area Estimation for Images with Defined Edges</title><content type='html'>Area measurement in images play a significant role in research. As much as possible, people nowadays want everything to be automated. With this, estimating an area based on images is possible. There are a lot of things that one can do if equipped with the necessary skills in area estimation using images. In research, for example, this technique is used to automate the detection of cancerous cells. Also, given an image, the area of a forest can be obtained using the said technique (remote sensing). &lt;br /&gt;
&lt;br /&gt;
There are two ways in area estimation. The first technique uses &lt;a href=&quot;http://en.wikipedia.org/wiki/Green%27s_theorem&quot;&gt;Green&#39;s Theorem&lt;/a&gt;. The theorem relates the line integral around a closed curve &lt;i&gt;C&lt;/i&gt;, for example, to the double integral over the plane region &lt;i&gt;D&lt;/i&gt; bounded by &lt;i&gt;C&lt;/i&gt;, and vice versa. &lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirkDtjKo1-XnzmgvtxIbaqhhxtLFMLDwFjjePy6GiZrteHRW5XGP8TlryhLmKG1jXkxf9YuyF07dIqe874z508QSJFFFX81B_qakWQwqa8_CgOMXNfiElbDlVxaV1tHJt-07SnPZWDwV5F/s1600/Green%2527s+theorem.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;183&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirkDtjKo1-XnzmgvtxIbaqhhxtLFMLDwFjjePy6GiZrteHRW5XGP8TlryhLmKG1jXkxf9YuyF07dIqe874z508QSJFFFX81B_qakWQwqa8_CgOMXNfiElbDlVxaV1tHJt-07SnPZWDwV5F/s320/Green%2527s+theorem.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The closed curve &lt;i&gt;C&lt;/i&gt;, in the counterclockwise direction, that bounds the region &lt;i&gt;D&lt;/i&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Since the theorem relates a closed integral to a double integral, the equation below summarizes it with the need to consider two continuous functions, &lt;i&gt;F&lt;span style=&quot;font-size: xx-small;&quot;&gt;1&lt;/span&gt;&lt;/i&gt; and &lt;i&gt;F&lt;span style=&quot;font-size: xx-small;&quot;&gt;2&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;font-size: small;&quot;&gt;, which have continuous partial derivatives in the region containing &lt;i&gt;D&lt;/i&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9kldWQAl-e29jcGcBqi_r1WJee77wcZ09Ldu-aK9DplwwjvzPLu6G4gKzW4KtfuL5hkDw-ZWuyw82qGFMaipBQD1K5woG5vcuqvks-__ixBCJeCK7pUM4t5MEdb2S1zkGIwsk5OBTp04y/s1600/Green%2527s+theorem+equation.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;85&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9kldWQAl-e29jcGcBqi_r1WJee77wcZ09Ldu-aK9DplwwjvzPLu6G4gKzW4KtfuL5hkDw-ZWuyw82qGFMaipBQD1K5woG5vcuqvks-__ixBCJeCK7pUM4t5MEdb2S1zkGIwsk5OBTp04y/s400/Green%2527s+theorem+equation.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Equation 1&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Note that if the contour &lt;i&gt;C&lt;/i&gt; is in the counterclockwise direction, the region of interest &lt;i&gt;D&lt;/i&gt; is located to the left of the boundary. &lt;i&gt;C&lt;/i&gt; is then a collection of points (&lt;i&gt;x&lt;/i&gt;, &lt;i&gt;y&lt;/i&gt;) that make up the contour or the boundary of region &lt;i&gt;D&lt;/i&gt;. The succeeding lines demonstrate how the area of region &lt;i&gt;D&lt;/i&gt; can be obtained.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;If we let &lt;i&gt;F&lt;span style=&quot;font-size: xx-small;&quot;&gt;1&lt;/span&gt;&lt;/i&gt; = 0, &lt;i&gt;F&lt;span style=&quot;font-size: xx-small;&quot;&gt;2&lt;/span&gt;&lt;/i&gt; = x and &lt;i&gt;F&lt;span style=&quot;font-size: xx-small;&quot;&gt;1&lt;/span&gt;&lt;/i&gt; = -y, &lt;i&gt;F&lt;span style=&quot;font-size: xx-small;&quot;&gt;2&lt;/span&gt;&lt;/i&gt; = 0, equation 1, for each case, becomes&lt;/span&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6oLw3ieiPktAlqLpGf4qMbADPwB6id3_QtQm4yoBOAalnVXJ6LSNQOxT-Swy949NhsaBEQbjzwssGQGja2ifc-bscqTiWOO7j5GFfASi-VY7A87qugaDvlDBVGmnTFkIBLM5zUhskbZFV/s1600/Eq2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6oLw3ieiPktAlqLpGf4qMbADPwB6id3_QtQm4yoBOAalnVXJ6LSNQOxT-Swy949NhsaBEQbjzwssGQGja2ifc-bscqTiWOO7j5GFfASi-VY7A87qugaDvlDBVGmnTFkIBLM5zUhskbZFV/s1600/Eq2.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Equation 2&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKSfHZkr4ImX5CiZLl3RXFwuhn38HBTng1o7f94ZTF71fjGx6mKDbLfId9sZM2RBUJ9tTbyW03Uz4iE4wBONKS_RU6jM4o3IUrkXHuqUjTrTvSd8fKECqRKU1apu4I04xsQYi2F4qRXmYb/s1600/Eq3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKSfHZkr4ImX5CiZLl3RXFwuhn38HBTng1o7f94ZTF71fjGx6mKDbLfId9sZM2RBUJ9tTbyW03Uz4iE4wBONKS_RU6jM4o3IUrkXHuqUjTrTvSd8fKECqRKU1apu4I04xsQYi2F4qRXmYb/s1600/Eq3.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Equation 3&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Both equations 2 and 3 represent the area of region&amp;nbsp;&lt;i&gt;D&lt;/i&gt;. Averaging the two expressions for area, we have&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBRY5Kp3HOPrQWimutNQDOcc4PAq627R5m34grFA-fMj_QUR3Cn1j5cJpL6AzhCR1EZMU21F6quX7jp5yilWpYJabi5r3k7fF_LVZ9LrFfMThNh2p_YRV6qaCNJWUhlJPnwDxBcH8F9vPT/s1600/area+eqn4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBRY5Kp3HOPrQWimutNQDOcc4PAq627R5m34grFA-fMj_QUR3Cn1j5cJpL6AzhCR1EZMU21F6quX7jp5yilWpYJabi5r3k7fF_LVZ9LrFfMThNh2p_YRV6qaCNJWUhlJPnwDxBcH8F9vPT/s1600/area+eqn4.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Equation 4&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;span style=&quot;font-size: small;&quot;&gt;The discrete form of equation 4 is given by&lt;/span&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRZcJY5J-M7y_3Nve28r0CNv-Nm371-SzZF7B_RVT7vC67diEA22hR9Nqx_qf4OCwGUB6DGiLEtnqS2YA52cIxfDvgkkyufEeLMTU3-bzQjV0Iht5Ao5T0OJsZkNdscc4kFdYpd5_IKEUc/s1600/area+eqn5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;94&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRZcJY5J-M7y_3Nve28r0CNv-Nm371-SzZF7B_RVT7vC67diEA22hR9Nqx_qf4OCwGUB6DGiLEtnqS2YA52cIxfDvgkkyufEeLMTU3-bzQjV0Iht5Ao5T0OJsZkNdscc4kFdYpd5_IKEUc/s320/area+eqn5.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Equation 5&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&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;span style=&quot;font-size: small;&quot;&gt;wherein &lt;i&gt;N&lt;/i&gt;&amp;nbsp;is the total number of pixels in the boundary or contour &lt;i&gt;C&lt;/i&gt;. If the contour is made up of &lt;i&gt;N&lt;/i&gt; pixels, i.e., the total number of pixel coordinates (&lt;i&gt;x&lt;/i&gt;, &lt;i&gt;y&lt;/i&gt;) is equal to &lt;i&gt;N&lt;/i&gt;, then there exists a problem when we try to access the pixel coordinates (&lt;i&gt;x&lt;/i&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;i&gt;N+1&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;, &lt;i&gt;y&lt;/i&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;i&gt;N+1&lt;/i&gt;&lt;/span&gt;). This is solved by letting (&lt;i&gt;x&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;1&lt;/span&gt;&lt;/i&gt;, &lt;i&gt;y&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;1&lt;/span&gt;&lt;/i&gt;) =&amp;nbsp;&lt;span style=&quot;font-size: small;&quot;&gt;(&lt;i&gt;x&lt;/i&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;i&gt;N+1&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;,&amp;nbsp;&lt;i&gt;y&lt;/i&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;i&gt;N+1&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;). This is done because we want to close our loop.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The second technique in area estimation is through morphological operations. This considers connected pixels as blob. It estimates the area in the image by counting the pixels contained inside the blob.&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;To test the accuracy (validity?) of equation 5, I generated some figures whose area can be easily computed, i.e., regular geometric shapes. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&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/AVvXsEi26OJr3vzlOS1mES8VDDiUkh0KTPeKoKbvvy8Pda0-Xok7aTBtyv-y75c2n0_K_zXfO0afpzDyYpgyaH-WjNPnIY2mdgFb6JcFlMsNnsWStXL2I471BbLRpd1jj-2ceZZthkTkZWt5rkcz/s1600/Circle+1.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi26OJr3vzlOS1mES8VDDiUkh0KTPeKoKbvvy8Pda0-Xok7aTBtyv-y75c2n0_K_zXfO0afpzDyYpgyaH-WjNPnIY2mdgFb6JcFlMsNnsWStXL2I471BbLRpd1jj-2ceZZthkTkZWt5rkcz/s200/Circle+1.bmp&quot; width=&quot;186&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivOEVWrQsy6mLpPqA9C3tY9aEh6RPUQppWcu6ZV-lrG5iEYXrWSjLI1BPAceNITDe5XpQrwJvwgexCfEJVdb4CXlFYm6VGocy4w8ZOU36nrHu5ymBmR340ju-y93PHLlXKRqQQcUKguyXr/s1600/Triangle.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivOEVWrQsy6mLpPqA9C3tY9aEh6RPUQppWcu6ZV-lrG5iEYXrWSjLI1BPAceNITDe5XpQrwJvwgexCfEJVdb4CXlFYm6VGocy4w8ZOU36nrHu5ymBmR340ju-y93PHLlXKRqQQcUKguyXr/s200/Triangle.bmp&quot; width=&quot;200&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;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&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/AVvXsEg1kVKVLkcQGsANQqVoLzgFnV5OO-mMCouYXv7nrLQZYTGt-dxKGiG906efU_b-HCXUaUabcGkYOfgEdSRH-eYxXgYJbj3hKmCFW5ba4LHlNATx7ZQ1dtVcTDWQATmnHZ9hqZiJ_8YRPlUa/s1600/Square.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1kVKVLkcQGsANQqVoLzgFnV5OO-mMCouYXv7nrLQZYTGt-dxKGiG906efU_b-HCXUaUabcGkYOfgEdSRH-eYxXgYJbj3hKmCFW5ba4LHlNATx7ZQ1dtVcTDWQATmnHZ9hqZiJ_8YRPlUa/s200/Square.bmp&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;In this activity, I used the 4.1.2 version of Scilab together with the SIP toolbox since SIVP does not contain the &lt;b&gt;follow&lt;/b&gt; command. Basically, the &lt;b&gt;follow&lt;/b&gt; command is a contour follower. It returns the coordinates of the points that make up the contour or boundary of the region of interest. Knowing the coordinates simplifies the job. The only thing to be done then is to insert it into equation 5.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The area of any regular geometric shape can be obtained using the following snippets.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitl7PRtg4PbGhvSHwcSH1WOb5AbLFJrje69REcGuvfU3vv8CzxYD84xKA9TeDlEgW7oPwXt6fxbQg3yqDJri-NHtbKn43uyQcHAWl4TR4qr5rDEA2-SwZsHuvWvFcyQLKBINbZvN-WcJYm/s1600/code+for+area.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitl7PRtg4PbGhvSHwcSH1WOb5AbLFJrje69REcGuvfU3vv8CzxYD84xKA9TeDlEgW7oPwXt6fxbQg3yqDJri-NHtbKn43uyQcHAWl4TR4qr5rDEA2-SwZsHuvWvFcyQLKBINbZvN-WcJYm/s640/code+for+area.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The code used to calculate the area of any regular geometric shape. It is recommended that the image to be used is saved as a Bitmap image.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&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;And here are computed values for the geometric shapes I have chosen, together with the corresponding actual area measurement and the percentage error for each case.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGk-_5TJAjR7PIADrO25RxGvJObtSeik_0uC9VOT9WOQRSL4INf3W_VaDCI7fAZDjrc6Fu4cNcsYn4VvkoFg_Nr0CbSPJAzrEf650G7_It3ABvRJCZcpboGCLBrMhXw-4eyLJI26oGCd9x/s1600/actual+vs+measured+area+value.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;81&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGk-_5TJAjR7PIADrO25RxGvJObtSeik_0uC9VOT9WOQRSL4INf3W_VaDCI7fAZDjrc6Fu4cNcsYn4VvkoFg_Nr0CbSPJAzrEf650G7_It3ABvRJCZcpboGCLBrMhXw-4eyLJI26oGCd9x/s400/actual+vs+measured+area+value.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The percentage error values suggest that exploiting equation 5 in the calculation of the area of given regular shape is quite reasonable up to some degree. The higher the resolution of the image, the greater the possibility that the actual and calculated area coincide.&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;The method I used in measuring the actual area of the given shape is to measure its dimensions in pixels. This method applies whenever the shape to be measured is regular, i.e., the known formulas for area calculation can be applied directly.&lt;br /&gt;
&lt;br /&gt;
A problem arises when the area to be measured has an irregular shape. This is the case in the real world. It is then important to extend our knowledge of area measurement to objects that are irregular in shape. As an example, I want to measure the area bounded by Roces St., Roxas and Osmeña Avenue.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz6WHcnyykPIeJ36z3-yMAsMmsoFxMVy84m6FjncLmlvLLkG3h3QvoqKGBFoptCn_8yO31coW9G6eRyRMGebKpZ1GneeVnhUNiloY_JdQufh8TMwtiP1PopeBbtLVg5sVE47r9ZvEsckf9/s1600/200ft-50m+scale+PNG.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;346&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz6WHcnyykPIeJ36z3-yMAsMmsoFxMVy84m6FjncLmlvLLkG3h3QvoqKGBFoptCn_8yO31coW9G6eRyRMGebKpZ1GneeVnhUNiloY_JdQufh8TMwtiP1PopeBbtLVg5sVE47r9ZvEsckf9/s640/200ft-50m+scale+PNG.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;A satellite image obtained using Google Maps showing a portion of land located in the University of the Philippines Diliman. &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;In order to begin with the area measurement, the following steps are to be done. I opted for the use of &lt;i&gt;Paint&lt;/i&gt; in tracing the boundary of the parcel of land shown. The result is shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwk1LVRskbGdMcx25q5gIx0HKqx-QVh3f9LusNqFmBkOjKwc0ff1J3ZlO9D_cv3KeVsuD4BiWfCmxD3_XBfJeaBvre0bPBu4chKD82zRWtKcxdt3kkNz6ispgQ2Du_pHq8Pf7dzgnWp2fa/s1600/Trace+map+PNG.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;353&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwk1LVRskbGdMcx25q5gIx0HKqx-QVh3f9LusNqFmBkOjKwc0ff1J3ZlO9D_cv3KeVsuD4BiWfCmxD3_XBfJeaBvre0bPBu4chKD82zRWtKcxdt3kkNz6ispgQ2Du_pHq8Pf7dzgnWp2fa/s640/Trace+map+PNG.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The boundary of the parcel of land now traced using &lt;i&gt;Paint&lt;/i&gt;.&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Since Green&#39;s theorem can only be implemented when the region of interest is white in color and the background is black, I planned to recover the black outlines I drew using the technique I learned from Activity 3.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhe2_CZqNSdTZnyhJaKN66PgqiEOdG02hyCtFNDankEtdsI7bmSA2ORE2dCLj8YnEnUZMudZwFanecsGPjwp1h40NbIeV6-ym5r6D3PTnuvr1OZQy-_O2ou-zAXz8uQtjGl4Sz4qcOD1xp-/s1600/threshold.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;314&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhe2_CZqNSdTZnyhJaKN66PgqiEOdG02hyCtFNDankEtdsI7bmSA2ORE2dCLj8YnEnUZMudZwFanecsGPjwp1h40NbIeV6-ym5r6D3PTnuvr1OZQy-_O2ou-zAXz8uQtjGl4Sz4qcOD1xp-/s640/threshold.bmp&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The recovered black outlines from the map shown previously. This appears to be smaller compared to the images shown above but they all have the same area. This is because of the white spaces surrounding the black outline. Trust me. I have measured and compared the dimensions of the three images. &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&amp;nbsp;The code I used in converting the image to binary, together with the histogram plot (which is the basis for the threshold value used), is shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEmnVX2D6vkv6cTV2jxu4xOBowHtM7hoafhiUc3DEP9qBSJbINSqF5mfKITn1tEqPqurwmWmqHD5rFh3sH1TJ-se9gJRWs6CvjE-Jnb4qumBCKN9zmtV5feeND1RlAZe9QERaggXFUJZZ-/s1600/trace+map+bw+code.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;102&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEmnVX2D6vkv6cTV2jxu4xOBowHtM7hoafhiUc3DEP9qBSJbINSqF5mfKITn1tEqPqurwmWmqHD5rFh3sH1TJ-se9gJRWs6CvjE-Jnb4qumBCKN9zmtV5feeND1RlAZe9QERaggXFUJZZ-/s640/trace+map+bw+code.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The number of bins, which is 1000 in this case, may vary. Also, we want the output image to have the same size as the input image. I used &lt;b&gt;imshow (im_bw)&lt;/b&gt; instead of the regular&lt;b&gt; imshow (im_bw, [])&lt;/b&gt; that rescales the image. &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPNVIRgqF5yRqJEQhzFBYwlS11O5W6aS64RqqxFmXO32iSdzS6yxOU8dYHutZG8nzhNkWhrhPIZTxPoapFojuDHj1t24ol0tgaKYkAI-BoeljrfdfvG63daxV9T3tmXRrOqH40luF4_tlE/s1600/histogram.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;481&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPNVIRgqF5yRqJEQhzFBYwlS11O5W6aS64RqqxFmXO32iSdzS6yxOU8dYHutZG8nzhNkWhrhPIZTxPoapFojuDHj1t24ol0tgaKYkAI-BoeljrfdfvG63daxV9T3tmXRrOqH40luF4_tlE/s640/histogram.bmp&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Notice the very sharp peak at around 0 which corresponds to the color black. We then have an idea that if our only interest is the black outline that we saw earlier, the safe threshold value to be used is around 0, which in my case 0.001. &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;The resulting image is then processed using &lt;i&gt;Paint &lt;/i&gt;and Scilab.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgS1ySnVSsmJDmj9E5wB6UaFoq98UMKVis7Swrb9sXtH5NJrB5K3Dso-SvpUXMov6CLFfwV76hJ5R5sjknNalMgr0YvZUd9bUXpOVt4fjkFELMoq39rlfZ1MwzWXF9HCjg9A8olA5zlhj0B/s1600/threshold.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;314&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgS1ySnVSsmJDmj9E5wB6UaFoq98UMKVis7Swrb9sXtH5NJrB5K3Dso-SvpUXMov6CLFfwV76hJ5R5sjknNalMgr0YvZUd9bUXpOVt4fjkFELMoq39rlfZ1MwzWXF9HCjg9A8olA5zlhj0B/s640/threshold.bmp&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;And this image is ready to undergo area measurement!&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;The same code used in calculating the area of regular objects is used. And it gives as the following result.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguCKkIKi04Ep7QniqMs_19tMC8Ki2A8QKoPF4I6QWBgBs5TMJA2ux4-uszUYyHRyskExvS-kXfiH04HQoSbV3bGIQ5G8GyGVpIwC1azlbU6mKJvlJnBFX0j-3452F598kl7UxYMFhFNvQI/s1600/area+of+ROI.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;288&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguCKkIKi04Ep7QniqMs_19tMC8Ki2A8QKoPF4I6QWBgBs5TMJA2ux4-uszUYyHRyskExvS-kXfiH04HQoSbV3bGIQ5G8GyGVpIwC1azlbU6mKJvlJnBFX0j-3452F598kl7UxYMFhFNvQI/s640/area+of+ROI.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The calculated area is in pixels.&amp;nbsp;We need to devise a way on how to convert it to a real quantity.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;It is then important to note the scale used in the map taken using Google Maps. I plan to count the number of pixels in between tick marks, i.e., the number of pixels that make up a 50m.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7gjumMYtlTgT6e1gjadW7O4QnH7oRLIufJZnkiB7MHUtB78bghUpcEKzZ9vkE2S48CYTNQLXz80-qIkL_c7xac6f3eBJ4u4pprAumAeR6Skh89nWQ-859eJORy4B4JRhyphenhyphenbvdDesQDwh08/s1600/Scale+PNG.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7gjumMYtlTgT6e1gjadW7O4QnH7oRLIufJZnkiB7MHUtB78bghUpcEKzZ9vkE2S48CYTNQLXz80-qIkL_c7xac6f3eBJ4u4pprAumAeR6Skh89nWQ-859eJORy4B4JRhyphenhyphenbvdDesQDwh08/s1600/Scale+PNG.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The scale corresponding to the image I obtained using Google Maps. &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Based on pixel measurement of the above image, there are 87 pixels in between the two tick marks in meters. This means that 50m = 87pixels. Then using dimensional analysis,&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitvKNWsiD7XAHHn9w5LvUm1UnLDmktbyEaTxUBZSa3S3zi2vB83UA93itlefxu3TG2J0h4ZhMcCAqZrBeeelz0bTKWj1adiYxC3WxdbXbLfqPQhXJhxZps-5QYi11bsQSrqKNydkZ3WrWa/s1600/dimensional+analysis.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;55&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitvKNWsiD7XAHHn9w5LvUm1UnLDmktbyEaTxUBZSa3S3zi2vB83UA93itlefxu3TG2J0h4ZhMcCAqZrBeeelz0bTKWj1adiYxC3WxdbXbLfqPQhXJhxZps-5QYi11bsQSrqKNydkZ3WrWa/s320/dimensional+analysis.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The calculated area using Green&#39;s Theorem.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;Okay. I need then to compare the value I obtained with the actual area measurement of the parcel of land. Hmmm. I tried to &lt;i&gt;Google&lt;/i&gt; for the area of the lot I selected. Unfortunately, I found no results. What to do now? I am lucky that somehow the lot I selected has a shape that is almost a combination of regular geometric shapes, i.e., a triangle and a rectangle. My plan now is to compare my measurement with the area of the triangle-plus-rectangle combination. I am very aware that this method is not very accurate. Thus, I will just be comparing in terms of the order of magnitude between the two measurements.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlI5YlySL_WMKflAcY9aMvn0w_YxiXu46-MvN5N8DM87wgifBLwVW5QsJbmfMjGzrYXTxd8H8dMj0oWiohZUmm-7mgB6CTK_xM_qTq6I0jgRF1vIxM7Pz0JoGmh6edN4twC_L7Wb59O9nO/s1600/threshold.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;314&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlI5YlySL_WMKflAcY9aMvn0w_YxiXu46-MvN5N8DM87wgifBLwVW5QsJbmfMjGzrYXTxd8H8dMj0oWiohZUmm-7mgB6CTK_xM_qTq6I0jgRF1vIxM7Pz0JoGmh6edN4twC_L7Wb59O9nO/s640/threshold.bmp&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Notice the red &lt;i&gt;triangle&lt;/i&gt; and the green &lt;i&gt;rectangle&lt;/i&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;After the tedious measurement in pixel, the following table tabulates the area I obtained using my clever method.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUqS2bs1o7zchLZ3jx6W4iPjqdvkDCxPXWp1n015C8-jxQEf4JT2w5jBDeQAxu2KeNozk8shx6t_v1bALY03L-XHaIJnLu-yI5aWaJsiLsBiMjOGFOOXEZq0uFV1QV0yxLbV_z4jk4dUXW/s1600/actual+area+measurement+of+map.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;108&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUqS2bs1o7zchLZ3jx6W4iPjqdvkDCxPXWp1n015C8-jxQEf4JT2w5jBDeQAxu2KeNozk8shx6t_v1bALY03L-XHaIJnLu-yI5aWaJsiLsBiMjOGFOOXEZq0uFV1QV0yxLbV_z4jk4dUXW/s400/actual+area+measurement+of+map.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Hmmm. It seems that the actual measurement is almost equal to the calculated area using Green&#39;s theorem with a percentage error of 0.51%. Not bad at all.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Having presented everything, it is time for me to rate myself for this activity. I am giving myself a grade of 10 for this. I am learning a lot from this course. And the good thing is I am able to apply what I learned from the previous activities to the current one. I am not quite satisfied with how I obtained the actual measurement of the lot. I believe that there exists a better way of figuring it out. There is, I believe, some data available concerning parcel of lots located in UP Diliman. Doing this activity reminds me of my father&#39;s work. He is a geodetic engineer. And at home, I am quite exposed to what he is doing, i.e., land titling, surveying. This also reminds me of the AutoCAD that he is using. What I remember is that you input coordinates, and after some clicking, it returns the area of a selected parcel of land in the plot. &lt;br /&gt;
&lt;br /&gt;
And I hope to learn more in the next activities.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://anythingphysics.blogspot.com/feeds/8304455264055454176/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anythingphysics.blogspot.com/2011/06/area-estimation-for-images-with-defined.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/8304455264055454176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/8304455264055454176'/><link rel='alternate' type='text/html' href='http://anythingphysics.blogspot.com/2011/06/area-estimation-for-images-with-defined.html' title='Area Estimation for Images with Defined Edges'/><author><name>Jen-Jen Manuel</name><uri>http://www.blogger.com/profile/17781945162053242109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio7WYdtUaWDpY0vUR8rmhXb6vLXc_NJhfW7210lMlbkFxjcoaf31CZ38KIuNSzomRZXPSXX9zYuME75wQBlwP99KltNLXSivQIMcdocBxzVUhe4t36aIu_krVWKUOErA4/s220/49936_1530407762_2876926_n.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirkDtjKo1-XnzmgvtxIbaqhhxtLFMLDwFjjePy6GiZrteHRW5XGP8TlryhLmKG1jXkxf9YuyF07dIqe874z508QSJFFFX81B_qakWQwqa8_CgOMXNfiElbDlVxaV1tHJt-07SnPZWDwV5F/s72-c/Green%2527s+theorem.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2748687604404631686.post-4185255540792095676</id><published>2011-06-25T23:51:00.008+08:00</published><updated>2011-06-26T18:22:07.117+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="image format"/><category scheme="http://www.blogger.com/atom/ns#" term="image type"/><title type='text'>Image Types and Formats</title><content type='html'>When saving an image, I usually use the JPEG/JPG format. It was only last year that I came to ponder on the existence of other formats, such as .png, .tif, .gif and .bmp. There must be a difference among these file formats. And of course, each must have its odd traits. But if my only aim at a given moment is to save the picture, then saving it using the very well-known .jpeg/.jpg file extension is an accomplishment. Apparently, there exist huge differences among available image formats. And in image processing, the format of the image does matter. I jot down some of the common image formats and the benefits of using such.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/JPEG&quot;&gt;JPEG&lt;/a&gt; - Its name stands for&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Joint_Photographic_Experts_Group&quot;&gt;Joint Photographic Experts Group&lt;/a&gt;. This group of people are responsible for the development of .jpeg. It is well known for its&lt;i&gt; lossy compression&lt;/i&gt;. When you want your file to be compact, i.e., small file size, this image format is the best to use. As its name suggests, not all of the data found on the original file will be saved if a .jpeg extension is used. One needs to choose small storage size over image quality.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Graphics_Interchange_Format&quot;&gt;GIF&lt;/a&gt;&amp;nbsp; - It stands for Graphics Interchange Format. It was introduced by &lt;a href=&quot;http://en.wikipedia.org/wiki/CompuServe&quot;&gt;CompuServe&lt;/a&gt; in 1987. It supports&lt;i&gt; animation&lt;/i&gt; but has some problem with color limitation. It only supports a maximum of 256 colors. Also, unlike JPEG, it uses &lt;i&gt;lossless&lt;/i&gt; data compression technique. Examples (from &lt;a href=&quot;http://www.anikaos.com/0001-gifs-hamtaro1.html&quot;&gt;http://www.anikaos.com/0001-gifs-hamtaro1.html&lt;/a&gt;) are shown below. It is best to use GIF when creating logos. It is not advisable for people who are into photography and publishing industry to use this since it only holds up to 256 colors.&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://www.anikaos.com/anime_animated_gifs/hamtaro/serie/hamtaro_s_001.gif&quot; /&gt; &lt;img src=&quot;http://www.anikaos.com/anime_animated_gifs/hamtaro/serie/hamtaro_s_005.gif&quot; /&gt;&lt;img src=&quot;http://www.anikaos.com/anime_animated_gifs/hamtaro/serie/hamtaro_s_008.gif&quot; /&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Portable_Network_Graphics&quot;&gt;PNG&lt;/a&gt;&amp;nbsp; - (pronounced &lt;i&gt;Ping&lt;/i&gt;) It is short for Portable Network Graphics. It is a better alternative for the GIF format. In terms of image compression, PNG is better than JPEG.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Tagged_Image_File_Format&quot;&gt;TIFF&lt;/a&gt; - The name stands for Tagged Image File Formal. It was developed by &lt;a href=&quot;http://en.wikipedia.org/wiki/Aldus&quot;&gt;Aldus&lt;/a&gt;&amp;nbsp;and as of 2009, it is under &lt;a href=&quot;http://en.wikipedia.org/wiki/Adobe_Systems&quot;&gt;Adobe Systems&lt;/a&gt;. It is popular among people who are into photography, publishing industry and the like. As its name suggests, developers can include tags containing proprietary information inside a TIFF file. &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/BMP_file_format&quot;&gt;BMP&lt;/a&gt;&amp;nbsp;- It is more commonly known as Bitmap Image File or Device Independent Bitmap (DIB) file format. This file format is used in storing bitmap images. This is a popular image format used on Windows and OS/2 operating systems. Data compression is optional in this case.&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;Now that we have an idea of the available file formats, it is good to have some basic knowledge of the different image types. The basic types are enumerated below, together with some examples.&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Truecolor Images - Examples of this image type are those captured by the digital cameras that we have today. The colors that we see are the results of the overlapping of its 3 channels that contain the primary colors red, blue and green.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyvMXNBYbhFk36LCzkr5DFoeFXiPvpIhiF3oYj4SwGzr73mfLYGKMK_Q5320OGIZ7kTwEuWc5q6q1NaEkR-Ohw6m436zXm4cF2GM-WmZH0AxaO1pDXj0qLqk_mNBi14wBNd8oW7EwPlMCC/s1600/Cute+baby.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyvMXNBYbhFk36LCzkr5DFoeFXiPvpIhiF3oYj4SwGzr73mfLYGKMK_Q5320OGIZ7kTwEuWc5q6q1NaEkR-Ohw6m436zXm4cF2GM-WmZH0AxaO1pDXj0qLqk_mNBi14wBNd8oW7EwPlMCC/s320/Cute+baby.jpg&quot; width=&quot;252&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;A photo of a cute baby taken from:&amp;nbsp;&lt;a href=&quot;http://www.flickr.com/photos/asam/432194779/&quot;&gt;http://www.flickr.com/photos/asam/432194779/&lt;/a&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;text-align: center;&quot;&gt;The image shown above has the following properties:&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4IhUnuQAAS1smeX-r8XpveMYTGPASLJY9W6DRa1craihLo77Q0vClB5BKAXqNAk5626rvaOrbc0nrK-hNQdQ6AJCUKvLuPezCskV51FoWJG3WTJSYb_pvCW2IYnbF8jbF-6JTjpMx96Vn/s1600/Cute+baby+properties.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;219&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4IhUnuQAAS1smeX-r8XpveMYTGPASLJY9W6DRa1craihLo77Q0vClB5BKAXqNAk5626rvaOrbc0nrK-hNQdQ6AJCUKvLuPezCskV51FoWJG3WTJSYb_pvCW2IYnbF8jbF-6JTjpMx96Vn/s320/Cute+baby+properties.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Note that dpi means dots per inch. It expresses the resolution of the image. The higher the resolution of an image, the more you can zoom in on the image.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;ul&gt;&lt;li&gt;Binary Images - The first things that come into your mind when you hear the word binary are 1&#39;s and 0&#39;s. The image is basically made up of 1&#39;s and 0&#39;s which in color are represented by the colors white and black, respectively.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm75Pi4hMNAwhOSaPz1D2LJ82WowH1Z9SLFLwLJNB_FfCHWvTmypd6M0yveIRRiftcgBsLRN4oyf2CBo671dbYyGmOV5pegCMXe0NGVItqOGqA3Td1NYGA-B2eF3R3MhZ3zRJYDCHdCizJ/s1600/Black+and+white_cats.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;266&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm75Pi4hMNAwhOSaPz1D2LJ82WowH1Z9SLFLwLJNB_FfCHWvTmypd6M0yveIRRiftcgBsLRN4oyf2CBo671dbYyGmOV5pegCMXe0NGVItqOGqA3Td1NYGA-B2eF3R3MhZ3zRJYDCHdCizJ/s320/Black+and+white_cats.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Photo taken from:&amp;nbsp;&lt;a href=&quot;http://free-extras.com/images/black_and_white_cats-1541.htm&quot;&gt;http://free-extras.com/images/black_and_white_cats-1541.htm&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;Here are the image properties of the binary image shown above:&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/AVvXsEgik_Ldkl9hbW28rOzX08dZIE7xzFVuWrlJNNpp_ebTJ774CYBJGrKUYY0qCjQ5Ks_IltNy12NA5CInhWA61zBCz_WAqU4bUMiExszOrZfXbSVE_cenG8oqj4BwmQrTVA87bUkSLAnGSzp3/s1600/Black+and+white_cats+properties.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;223&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgik_Ldkl9hbW28rOzX08dZIE7xzFVuWrlJNNpp_ebTJ774CYBJGrKUYY0qCjQ5Ks_IltNy12NA5CInhWA61zBCz_WAqU4bUMiExszOrZfXbSVE_cenG8oqj4BwmQrTVA87bUkSLAnGSzp3/s320/Black+and+white_cats+properties.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;/div&gt;&lt;ul&gt;&lt;li style=&quot;text-align: left;&quot;&gt;Grayscale images - These are images whose colors ranges between 0 (black) and 1(white). Images of this type are gray in color.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzkXW0u_Rjix_Q9l5s5j2KMFXE8y5t0ZmkxW0rfMLrNiecylxla8SiXE__2DGrQNYEMwv9HkY-23Wwm2fBJN11VGZnY_IUlnFPBwHjEWIPWdGhLAe-J1-92vqUFSazIEOTUi1U74B_x5W8/s1600/Baby+and+dog.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;254&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzkXW0u_Rjix_Q9l5s5j2KMFXE8y5t0ZmkxW0rfMLrNiecylxla8SiXE__2DGrQNYEMwv9HkY-23Wwm2fBJN11VGZnY_IUlnFPBwHjEWIPWdGhLAe-J1-92vqUFSazIEOTUi1U74B_x5W8/s320/Baby+and+dog.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Photo of a baby and a dog taken from:&amp;nbsp;&lt;a href=&quot;http://www.likecool.com/Cute_Baby--Pic--Gear.html&quot;&gt;http://www.likecool.com/Cute_Baby--Pic--Gear.html&lt;/a&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;text-align: center;&quot;&gt;The above image has the properties shown below:&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/AVvXsEjtk8w2K687xy2kq_XWrds4tvJLsv_PMK4ev9XEzB3Bky7F_9ODDPNmf-c3pt4AhhZjZY2pIRGyI6RYaFAFT_xDlXlSPm333IcLPN6gwSdMUebI2fJ0pho7NPLZZc_0f_-JEH_AzMgmcVsA/s1600/Baby+and+dog+properties.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;220&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtk8w2K687xy2kq_XWrds4tvJLsv_PMK4ev9XEzB3Bky7F_9ODDPNmf-c3pt4AhhZjZY2pIRGyI6RYaFAFT_xDlXlSPm333IcLPN6gwSdMUebI2fJ0pho7NPLZZc_0f_-JEH_AzMgmcVsA/s320/Baby+and+dog+properties.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;ul&gt;&lt;li style=&quot;text-align: left;&quot;&gt;Indexed images - These are basically images whose colors are represented by numbers indicating the corresponding index of colors in a color map. Images of this type contains two sets of information: the original image and its color map.&lt;/li&gt;
&lt;/ul&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP5j2G_e-rZq1y8FsOil79Boh3t89bZuqHonqkOG9JXxmqXb5VHRMAtfPdTsKSGJLwn1N1uvHArJvjekF8ZRD0DfnUc523cfHJ5_x6-QIOcaWMvlMmIVnKMVMODpvio0QAYyhyP8nWWv7H/s1600/Indexed+image.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP5j2G_e-rZq1y8FsOil79Boh3t89bZuqHonqkOG9JXxmqXb5VHRMAtfPdTsKSGJLwn1N1uvHArJvjekF8ZRD0DfnUc523cfHJ5_x6-QIOcaWMvlMmIVnKMVMODpvio0QAYyhyP8nWWv7H/s320/Indexed+image.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Photo taken from:&amp;nbsp;&lt;a href=&quot;http://annaleeblysse.blogspot.com/2010/09/lava-fountain.html&quot;&gt;http://annaleeblysse.blogspot.com/2010/09/lava-fountain.html&lt;/a&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.blogger.com/&quot;&gt;&lt;/a&gt;&lt;span id=&quot;goog_1976733934&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1976733935&quot;&gt;&lt;/span&gt;The indexed image shown above has the properties displayed below.&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/AVvXsEguLayz4PrAL8apakCGhNBl8j75z0cGOCaeMFyFbLgsKqLJvOccrJLAK66ckztIWei7S7ZlZum16kS6zSYMQAHe0HiOQ319dPlu2ZY3Akv1JwgIcrvDN3dKAHnsnpG8LRtHT15YROnieesB/s1600/Indexed+image+properties.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;217&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguLayz4PrAL8apakCGhNBl8j75z0cGOCaeMFyFbLgsKqLJvOccrJLAK66ckztIWei7S7ZlZum16kS6zSYMQAHe0HiOQ319dPlu2ZY3Akv1JwgIcrvDN3dKAHnsnpG8LRtHT15YROnieesB/s320/Indexed+image+properties.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;The properties of an image can be found by right clicking the file then choosing &lt;i&gt;Properties &lt;/i&gt;and then &lt;i&gt;Details&lt;/i&gt;. This applies when the operating system you are using is Windows 7. The disadvantage of using this is that it does not give you the image type. In Scilab 5.3.2, these properties can be seen by simply typing&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;b&gt;info = imfinfo(filename)&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;This will output the following set of properties:&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/AVvXsEg_JHIhPSy40plnfeOXidpe5cp6A48pjFfpZoQnVFp2ESWiAcUWAyELbc68dLNFv-74RKK0xOVsZ5gi4dLn2US1D10X0tNH44dT2a8XRAtSHxeW1_3u5xqoWL9yZVyKhodqPQtsJuPVnANs/s1600/info.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;142&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_JHIhPSy40plnfeOXidpe5cp6A48pjFfpZoQnVFp2ESWiAcUWAyELbc68dLNFv-74RKK0xOVsZ5gi4dLn2US1D10X0tNH44dT2a8XRAtSHxeW1_3u5xqoWL9yZVyKhodqPQtsJuPVnANs/s400/info.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;And here are some of the advanced image types available.&lt;/div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt; High dynamic range images&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcBUT21WpaggbZIjJP9yaHJStRZGOQJ6V5raWq29dE1zTjwuUC-DC9-6XR0Lx6h1CLVx68ypwzZ99p5gFETow3Ov519QNyC3Z91vUy6Sp5MmnTicu1RfOpVyBUpNC35svmZFpsLcXJ2ziO/s1600/HDR+Image.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;190&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcBUT21WpaggbZIjJP9yaHJStRZGOQJ6V5raWq29dE1zTjwuUC-DC9-6XR0Lx6h1CLVx68ypwzZ99p5gFETow3Ov519QNyC3Z91vUy6Sp5MmnTicu1RfOpVyBUpNC35svmZFpsLcXJ2ziO/s320/HDR+Image.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Photo taken from: &lt;a href=&quot;http://www.modny73.com/artwork/photography/30-hdr-images-of-famous-cities-of-the-world/&quot;&gt;http://www.modny73.com/artwork/photography/30-hdr-images-of-famous-cities-of-the-world&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&amp;nbsp;3D images&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVj5zHllLINCrceFLPR9MR_zaG01jtGPARcXewZaE6Yt1swYCapPvaMCbG9YmjVN4xw6u9WhOtfini61FIm3iaSrg6SvCNJ2eunXd0XiFuENv5H6MU9D_OOZXfL_V0q9B9hcUfOhk_5bof/s1600/3D.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;252&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVj5zHllLINCrceFLPR9MR_zaG01jtGPARcXewZaE6Yt1swYCapPvaMCbG9YmjVN4xw6u9WhOtfini61FIm3iaSrg6SvCNJ2eunXd0XiFuENv5H6MU9D_OOZXfL_V0q9B9hcUfOhk_5bof/s320/3D.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Photo taken from: &lt;a href=&quot;http://www.fotocommunity.com/pc/pc/display/16115020&quot;&gt;http://www.fotocommunity.com/pc/pc/display/16115020&lt;/a&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&amp;nbsp;Multi or hyperspectral images&lt;/li&gt;
&lt;/ul&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjna7r5qpRT_q9dHmxG7xScseqXJ3feIU-K-PWow0sTD064zLRCqTr-FSzu3AGjAOU2ZIA1yUmzClvMaovl7ymET9MKcUDX6QjFy1vomGRb700M-NZziH5AgWTGhyGUWONFjggj5-G48DWZ/s1600/Multi+or+hyperspectral+image.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjna7r5qpRT_q9dHmxG7xScseqXJ3feIU-K-PWow0sTD064zLRCqTr-FSzu3AGjAOU2ZIA1yUmzClvMaovl7ymET9MKcUDX6QjFy1vomGRb700M-NZziH5AgWTGhyGUWONFjggj5-G48DWZ/s1600/Multi+or+hyperspectral+image.jpg&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;A satellite image taken from &lt;a href=&quot;http://www.gearthblog.com/blog/archives/2008/10/new_satellite_imagery_galore_coming.html&quot;&gt;http://www.gearthblog.com/blog/archives/2008/10/new_satellite_imagery_galore_coming.html&lt;/a&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Temporal images or videos - Presented below is a sample video I found in my laptop c/o Windows 7.&lt;/li&gt;
&lt;/ul&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.blogger.com/video.g?token=AD6v5dwXfCzNIVxOcvP4dyNfDmT20_0VboaikrRdr9Pnwfcu33B-gmPsC8HgdmbWFXXv5ygxkts8yoas81_dmJqhsA&#39; class=&#39;b-hbp-video b-uploaded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;One can convert an image from one type to another. The image shown below is an example of a truecolor type.&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOUNU4JIvn4z10dPb3hLIqCgLVlFfiVl8vLD4gMPGTOG4BV5Iso9y7nZlv7KWaUMor0epZwYe80oAoCKE68PUgduDRxtHWdUuKtOCQbiOgoLwFpzxbQPPGyi4_OxY5dDNZlhaDOzMxxVDN/s1600/Cute+puppies.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOUNU4JIvn4z10dPb3hLIqCgLVlFfiVl8vLD4gMPGTOG4BV5Iso9y7nZlv7KWaUMor0epZwYe80oAoCKE68PUgduDRxtHWdUuKtOCQbiOgoLwFpzxbQPPGyi4_OxY5dDNZlhaDOzMxxVDN/s320/Cute+puppies.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Photo taken from:&amp;nbsp;&lt;a href=&quot;http://www.desktoprating.com/wallpapers/4-cute-puppies-wallpaper-640x480.htm&quot;&gt;http://www.desktoprating.com/wallpapers/4-cute-puppies-wallpaper-640x480.htm&lt;/a&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;This image can be converted to a binary type using the snippet of code below.&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_EOrWs7eLlXPSTt9qY49-LhJmZbvNU0GRInB42bnFjoxXuap1V6uKUsLgfld54RBh9jCHBUwx2erjXWFJ8Yz3IgCE03Chh-yeF18cXMtz0cLlL8iBHONRwwNmsBVmAE-89ZcIn0MDptj7/s1600/true+color+to+bw.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;57&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_EOrWs7eLlXPSTt9qY49-LhJmZbvNU0GRInB42bnFjoxXuap1V6uKUsLgfld54RBh9jCHBUwx2erjXWFJ8Yz3IgCE03Chh-yeF18cXMtz0cLlL8iBHONRwwNmsBVmAE-89ZcIn0MDptj7/s640/true+color+to+bw.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The code I used to convert the image from truecolor to binary.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&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;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;And the result is shown below. Note that in converting an image to binary, a threshold value which ranges from 0 to 1 needs to be set. In this case I chose a value of 0.5.&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIxOo7hI_4EhSOGdGoqTTEwZs7ciPmRk5cfL1uCoU3kB1Jp7A2YGlpyc-k6Ww22fkSKlXFoAOa8b1gZBr68LYsn7A8zvVk-EGtx4cZMvwcmFVZal3lEwp6eG_8zM9Uuls6cp4n6hYzS8cR/s1600/cute+puppies+bw.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIxOo7hI_4EhSOGdGoqTTEwZs7ciPmRk5cfL1uCoU3kB1Jp7A2YGlpyc-k6Ww22fkSKlXFoAOa8b1gZBr68LYsn7A8zvVk-EGtx4cZMvwcmFVZal3lEwp6eG_8zM9Uuls6cp4n6hYzS8cR/s320/cute+puppies+bw.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The binary image with a threshold value of 0.5.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;To have a hint of what is happening when we increase or decrease the threshold value, look at the figure below. It shows how the threshold value plays a significant role in the process of converting the image to binary.&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp9I74tHsbjWJCxq9MneZsvSMftZjMyUmWqvnVa0Q35IPTRhwaA7UgTAQMIluxNTeBAJStjyeEbgiiXQwSBGCrtA2GrJFiqkQQabvh60DTDeGvHuHzWDsh-csmbZ5jThi-mqCzPyx7xHON/s1600/Recently+Updated.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;250&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp9I74tHsbjWJCxq9MneZsvSMftZjMyUmWqvnVa0Q35IPTRhwaA7UgTAQMIluxNTeBAJStjyeEbgiiXQwSBGCrtA2GrJFiqkQQabvh60DTDeGvHuHzWDsh-csmbZ5jThi-mqCzPyx7xHON/s400/Recently+Updated.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;From left to right: threshold value starting from zero with an increment of 0.1.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;When using Scilab 5.3.2 together with the SIVP toolbox, the corresponding function for&lt;b&gt; im2gray&lt;/b&gt; in Scilab 4.1.2 plus SIP toolbox is &lt;b&gt;rgb2gray&lt;/b&gt;. In converting a truecolor image to grayscale, the following set of lines was used.&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAPlOov7nLJqTZyxsw0ZFT7y8dim_n3yPkBqhpUQ9ruAjWgSn5_Huy6Pe8w7HQmL1M4ghUcw54QsQIdz0JXIwDE2sFeqogvhdqTtbGG5Asa4IiCnOfahwJcLABT46Ewoq8GQzHv1jxkA77/s1600/truecolor+to+grayscale.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;62&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAPlOov7nLJqTZyxsw0ZFT7y8dim_n3yPkBqhpUQ9ruAjWgSn5_Huy6Pe8w7HQmL1M4ghUcw54QsQIdz0JXIwDE2sFeqogvhdqTtbGG5Asa4IiCnOfahwJcLABT46Ewoq8GQzHv1jxkA77/s640/truecolor+to+grayscale.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;From truecolor to grayscale. &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&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: left;&quot;&gt;The resulting image is this.&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizb-7O1wrob_gu60adfWizPtzr2JhhSe4pg0tW-uaFuvXaYA5PLsF4JioYtoPe6ifzedv9MrgtzeOXLAcctZ7ZZE97SJwITKTyqsCOwRstLyOhV5RrG7pkC_xaxdllurceKX5K_qhtN-X4/s1600/cute+puppies+gray.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizb-7O1wrob_gu60adfWizPtzr2JhhSe4pg0tW-uaFuvXaYA5PLsF4JioYtoPe6ifzedv9MrgtzeOXLAcctZ7ZZE97SJwITKTyqsCOwRstLyOhV5RrG7pkC_xaxdllurceKX5K_qhtN-X4/s1600/cute+puppies+gray.jpg&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The cute puppies in grayscale.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;The next thing I needed to do is to convert the scanned image I used in Activity 1 to grayscale. The common error encountered when doing this is that the stacksize is smaller than the required value.&amp;nbsp;&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfkNbXZEn4gormOS0Dc_a3lpIUSB4I3kh7TAvk1q5y37AF7g2l7grhPJ17ZlLNHu87l8GgxdZeuYCSg-n-azYT6sI1XLMj4TUod3KyayPHpDq39Wyk3glefKeKvbxeo8U6GL-zh14K4pyG/s1600/Stacksize+error.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;172&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfkNbXZEn4gormOS0Dc_a3lpIUSB4I3kh7TAvk1q5y37AF7g2l7grhPJ17ZlLNHu87l8GgxdZeuYCSg-n-azYT6sI1XLMj4TUod3KyayPHpDq39Wyk3glefKeKvbxeo8U6GL-zh14K4pyG/s640/Stacksize+error.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;When you encounter problem like this, try increasing the stacksize you are using.&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;To increase the stacksize, &lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;blockquote&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;b&gt;stacksize(x);&lt;/b&gt; //where x = [180000,268435454]&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Earlier, we converted a truecolor image to binary. Converting an image to binary needs a threshold value. Looking on the histogram of an image gives you clue on what threshold value needs to be used in order to separate a region of interest from the background. This is possible when in the histogram of an image, the pixel intensities are crowded around two values. In this case, the threshold value to be used to separate the region of interest from the background is somewhere between the two peaks. The image shown below is the gray scale version of the scanned image I used in Activity 1.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdLaKeK8XFdm7bU-LKszOYEbT_LA7_8zUgCZPZIDbhYBtdMQTWXzDA7ByL2oimvCrcyuUS6WCeuH0_Vu4m6sss1vj6Uqc6ZHM2DkxmiOe2-XTg7Pc9hrsTDicfptKdwfh5FSosgkqUU8ji/s1600/scanned+image+gray.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;224&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdLaKeK8XFdm7bU-LKszOYEbT_LA7_8zUgCZPZIDbhYBtdMQTWXzDA7ByL2oimvCrcyuUS6WCeuH0_Vu4m6sss1vj6Uqc6ZHM2DkxmiOe2-XTg7Pc9hrsTDicfptKdwfh5FSosgkqUU8ji/s320/scanned+image+gray.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The scanned image converted to grayscale.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;And for the histogram of the above image we have&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkW5cbAD3eGuDx8e1yCFJLXhRMqwvsAVZOBfOa6hTGuavTxSy3VYBRT3O39_atsnX5jX3dQIfR4sSBtCVfaITyGV2ia6JuF0VjB11YN379WnOM4L_7eQ4gBWSQHNKsrVCPP59YXm3NGJCw/s1600/histogram+scanned+image+gray.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;236&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkW5cbAD3eGuDx8e1yCFJLXhRMqwvsAVZOBfOa6hTGuavTxSy3VYBRT3O39_atsnX5jX3dQIfR4sSBtCVfaITyGV2ia6JuF0VjB11YN379WnOM4L_7eQ4gBWSQHNKsrVCPP59YXm3NGJCw/s400/histogram+scanned+image+gray.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Notice the two peaks in the histogram shown below. Each peak either represents the background or the region of interest, i.e., the lines. A good threshold value is somewhere between the two peaks (145.71).&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Using the value selected as the basis for thresholding, the result is shown below.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyHKnLrCrVet7jReW5uUQiPG9PF9UtMmkIXOaai_fR6pwznU0nxQ9Aj75JzKCjjf-KGfbINADTuGL2CNXhqkPS7O8ZWVfreY_3Ehe8ts6mfza0QTnqIXCaCd0LGCMN1W_YidljxVRCZS25/s1600/scanned+image+bw.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;224&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyHKnLrCrVet7jReW5uUQiPG9PF9UtMmkIXOaai_fR6pwznU0nxQ9Aj75JzKCjjf-KGfbINADTuGL2CNXhqkPS7O8ZWVfreY_3Ehe8ts6mfza0QTnqIXCaCd0LGCMN1W_YidljxVRCZS25/s320/scanned+image+bw.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The binary image as a result of a threshold value of ~0.57. &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;The code used to generate the binary image shown above.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXDghf31HJ9lmXvqO2XxLEfnODxa_Iw35exlKWraSJbsLHk0AGzb6Y58TXC-b6W2ARSNwlTUEBBrbbpnL8upmjCDFFRPGgBxOPEounujV8q9gbP3bGfSYH9Reg_qKVywoc0u7TSBB3tLXR/s1600/scanned+image+to+bw+code.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;140&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXDghf31HJ9lmXvqO2XxLEfnODxa_Iw35exlKWraSJbsLHk0AGzb6Y58TXC-b6W2ARSNwlTUEBBrbbpnL8upmjCDFFRPGgBxOPEounujV8q9gbP3bGfSYH9Reg_qKVywoc0u7TSBB3tLXR/s640/scanned+image+to+bw+code.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;From grayscale to binary. Plus displaying the histogram of the gray scale image.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;To compare how good the thresholding process, the original scanned image is shown below. Notice that due to the quality of original image, i.e., the scanning process or how it was scanned, there exists on the right side a column that is black. The quality of the thresholding process is therefore affected. Nevertheless, the result is quite okay upon ignoring the limitations due to the quality of the image.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuAd_nsvTxOWANZOTehkp5doNE8acveA3Ji9dFcDOBydIUjmS7_0LArM_CVjrkHHzdIOm7YOL0wMoLkV8uI9NIm75-bo2krRfpKf87zfN6O6n6q873_3lA_f40YTp0O0T28PwtVAoJ5mui/s1600/scanned+image.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;224&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuAd_nsvTxOWANZOTehkp5doNE8acveA3Ji9dFcDOBydIUjmS7_0LArM_CVjrkHHzdIOm7YOL0wMoLkV8uI9NIm75-bo2krRfpKf87zfN6O6n6q873_3lA_f40YTp0O0T28PwtVAoJ5mui/s320/scanned+image.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The original image.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;I have learned a lot from this activity especially on when to use a specific image format. I was introduced to the vast variety of image formats available, including the image types. I would give my self a grade of 10 for this activity.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anythingphysics.blogspot.com/feeds/4185255540792095676/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anythingphysics.blogspot.com/2011/06/image-types-and-formats.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/4185255540792095676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/4185255540792095676'/><link rel='alternate' type='text/html' href='http://anythingphysics.blogspot.com/2011/06/image-types-and-formats.html' title='Image Types and Formats'/><author><name>Jen-Jen Manuel</name><uri>http://www.blogger.com/profile/17781945162053242109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio7WYdtUaWDpY0vUR8rmhXb6vLXc_NJhfW7210lMlbkFxjcoaf31CZ38KIuNSzomRZXPSXX9zYuME75wQBlwP99KltNLXSivQIMcdocBxzVUhe4t36aIu_krVWKUOErA4/s220/49936_1530407762_2876926_n.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyvMXNBYbhFk36LCzkr5DFoeFXiPvpIhiF3oYj4SwGzr73mfLYGKMK_Q5320OGIZ7kTwEuWc5q6q1NaEkR-Ohw6m436zXm4cF2GM-WmZH0AxaO1pDXj0qLqk_mNBi14wBNd8oW7EwPlMCC/s72-c/Cute+baby.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2748687604404631686.post-3425669314640874732</id><published>2011-06-21T10:33:00.000+08:00</published><updated>2011-06-21T10:33:23.748+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="atomsInstall"/><category scheme="http://www.blogger.com/atom/ns#" term="sivp toolbox"/><title type='text'>Installing SIVP 0.5.2 on Scilab 5.3.2</title><content type='html'>I finally was able to install SIVP on Scilab 5.3.2! Apparently the &lt;i&gt;Install&lt;/i&gt;&amp;nbsp;file that I read was misleading. Installing SIVP is easy. There are two simple ways to install it. Click &lt;a href=&quot;http://www.scilab.org/products/modules/pem/sivp&quot;&gt;here&lt;/a&gt;&amp;nbsp;to find out how.</content><link rel='replies' type='application/atom+xml' href='http://anythingphysics.blogspot.com/feeds/3425669314640874732/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anythingphysics.blogspot.com/2011/06/installing-sivp-052-on-scilab-532.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/3425669314640874732'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/3425669314640874732'/><link rel='alternate' type='text/html' href='http://anythingphysics.blogspot.com/2011/06/installing-sivp-052-on-scilab-532.html' title='Installing SIVP 0.5.2 on Scilab 5.3.2'/><author><name>Jen-Jen Manuel</name><uri>http://www.blogger.com/profile/17781945162053242109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio7WYdtUaWDpY0vUR8rmhXb6vLXc_NJhfW7210lMlbkFxjcoaf31CZ38KIuNSzomRZXPSXX9zYuME75wQBlwP99KltNLXSivQIMcdocBxzVUhe4t36aIu_krVWKUOErA4/s220/49936_1530407762_2876926_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2748687604404631686.post-3414078638793040890</id><published>2011-06-19T16:46:00.042+08:00</published><updated>2011-06-21T12:33:39.571+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="imagemagick"/><category scheme="http://www.blogger.com/atom/ns#" term="scilab"/><category scheme="http://www.blogger.com/atom/ns#" term="sip toolbox"/><category scheme="http://www.blogger.com/atom/ns#" term="sivp toolbox"/><title type='text'>Scilab Basics</title><content type='html'>I had a hard time figuring out how to install the SIVP toolbox for Scilab. The version of Scilab that I have is 5.3.0 which for compatibility reason needs an SIVP toolbox, not an SIP.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikeJem2g4TFZ3YP2_eF5a38P8XosQeMIksudZjKWGinDLlPctCkwL6UyM4u1FyZ3OTbRGtaYBzxKELu0ekhqdmAm6XWRX2UlOVB8AW0KrvVT499_9Ol3KbHQntga06cRGGUDnGziQmhFYs/s1600/Error+in+installing+SIVP.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;185&quot; id=&quot;BLOGGER_PHOTO_ID_5619166178000420738&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikeJem2g4TFZ3YP2_eF5a38P8XosQeMIksudZjKWGinDLlPctCkwL6UyM4u1FyZ3OTbRGtaYBzxKELu0ekhqdmAm6XWRX2UlOVB8AW0KrvVT499_9Ol3KbHQntga06cRGGUDnGziQmhFYs/s400/Error+in+installing+SIVP.png&quot; style=&quot;display: block; height: 148px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;The error I encountered. Hmm, what to do now?&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;The common suggestion I got from those I asked was to use Scilab 5.3.2 instead of 5.3.0. I installed the 5.3.2 together with the SIVP toolbox 0.5.2. And guess what the same error appeared. A C compiler is needed in the installation process. But I don&#39;t have any idea how to get rid of this error. Instead, I went to the older version of Scilab which is 4.1.2 and installed SIP toolbox 0.4.0 and ImageMagick 6.2.5-5. I again encountered a problem but this time a solution is available.If you are having a difficult time porting SIP toolbox into Scilab, read this &lt;a href=&quot;http://a-little-learning.blogspot.com/search/label/CORE_RL_magick.dll&quot;&gt;link&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
I am a newbie in&amp;nbsp;&lt;a href=&quot;http://www.scilab.org/&quot;&gt;Scilab&lt;/a&gt; but had already used&amp;nbsp;&lt;a href=&quot;http://www.mathworks.com/products/matlab/&quot;&gt;Matlab&lt;/a&gt; for my research. Scilab, according to many, is almost similar to Matlab. The good thing about Scilab is that it is a free software. Anyone can use it.&lt;br /&gt;
&lt;br /&gt;
Of course, whenever a programming language is new to you, practice is needed. The first thing I generated, given the snippets of code as an example, was a circular aperture.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgb3xbkw_4BcRlryOHAq3AekXQ0Lg5r-9zEs382_ZakQZQeMFDpvpvW3nXXlvFGs7VJrjtOQ9cZZ8C-pdihh4mPBAe3vWvosrlCx_zYwjKR2vfYMorgVURfugBHAyRtYQHfhP7fCrWl_N9Q/s1600/Circle.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;196&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgb3xbkw_4BcRlryOHAq3AekXQ0Lg5r-9zEs382_ZakQZQeMFDpvpvW3nXXlvFGs7VJrjtOQ9cZZ8C-pdihh4mPBAe3vWvosrlCx_zYwjKR2vfYMorgVURfugBHAyRtYQHfhP7fCrWl_N9Q/s400/Circle.bmp&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The circular aperture I generated using the snippets shown below. &lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMfrN7YuHl2xjKVdhOAZitZTvrlSuakpCFiSqERr90HkdfgSqeuGlWrz7KQA5nEAFmFQprvSEzTNAEHl7_MlcS0eaOmuPVVPuVRN-kGhzs2U4JPT0F5WL4BY2Yhe9YOLoUWnfE1Gczhttm/s1600/Circular+aperture+code.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;176&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMfrN7YuHl2xjKVdhOAZitZTvrlSuakpCFiSqERr90HkdfgSqeuGlWrz7KQA5nEAFmFQprvSEzTNAEHl7_MlcS0eaOmuPVVPuVRN-kGhzs2U4JPT0F5WL4BY2Yhe9YOLoUWnfE1Gczhttm/s400/Circular+aperture+code.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The free code found in the activity manual. &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;And now it is my time to generate my own figures. The easiest one I think to make is the annular. Here, I used the technique of masking. The code is shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOi5XnkwGVWfk41jvReaewlfGsYuy3OILdQ5SyMKrQgkHoLD6hFRFwt6R0nRMk6sImFE3yu7PbZ-O8lyBE-LWcaNamxGAxCyyq93Cq8oBd6wDF3g_KCmOUoGSz-UpIVMt2Pb3TeAn1zcy-/s1600/Annular+code.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;201&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOi5XnkwGVWfk41jvReaewlfGsYuy3OILdQ5SyMKrQgkHoLD6hFRFwt6R0nRMk6sImFE3yu7PbZ-O8lyBE-LWcaNamxGAxCyyq93Cq8oBd6wDF3g_KCmOUoGSz-UpIVMt2Pb3TeAn1zcy-/s400/Annular+code.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The code I used to generate an annular. Here, a mask B was created.&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;I recycled the code I used in generating a circular aperture and added some few lines since an annular is almost similar to a circular aperture with a smaller circle inside it. I created a matrix B having the same size as A but this time it is composed of 1&#39;s. I set to zero all elements of B which were less than 0.3 (r &amp;lt; 0.3). I then add A and B and set it to C.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifIptfIbdK93bUIdsPuSmpdxguH3W_r1ZvK7ejrB3o4NeLi2gz8mZIGocJNKsEkg_R6Lnqr1FSMlUXXS4G0bQgKOUUyBaoGRTQNeXqTcQgGOF4bEfz_R4kwNYdyizeCHWnX8fA6dBUEwSZ/s1600/Annulus.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;195&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifIptfIbdK93bUIdsPuSmpdxguH3W_r1ZvK7ejrB3o4NeLi2gz8mZIGocJNKsEkg_R6Lnqr1FSMlUXXS4G0bQgKOUUyBaoGRTQNeXqTcQgGOF4bEfz_R4kwNYdyizeCHWnX8fA6dBUEwSZ/s400/Annulus.bmp&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The annular I generated. &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&amp;nbsp;The second one I generated was a square aperture. To generate this is simple. First, you need to know the center of the square, i.e., the matrix. In this case, it is matrix A with all its elements set to zero. The dimension of the square can be any number as long as it is less than that of the matrix. &lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFdYsTPifrtQ8awEtaXW7sku8rOMHn938mWar7a1sNFHIgZ2puQRewB6IAzjbBajnEE28SVioE_Eo9SX5mFelLnao9mHEn3gDkoXqUqkRgyNxcO1rfHTQpt4mm8hDEMfIc7HGDFmh9iJaN/s1600/Square+aperture+code.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;112&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFdYsTPifrtQ8awEtaXW7sku8rOMHn938mWar7a1sNFHIgZ2puQRewB6IAzjbBajnEE28SVioE_Eo9SX5mFelLnao9mHEn3gDkoXqUqkRgyNxcO1rfHTQpt4mm8hDEMfIc7HGDFmh9iJaN/s400/Square+aperture+code.png&quot; width=&quot;400&quot; /&gt;&amp;nbsp;&lt;/a&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The code for a square aperture.&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;And ta-da! Here is the square aperture, with an area of 40x40, that I generated.&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3s6sFvCmM08CC__2NBN2UjLF575H_sA4SCna0E9yX3L0kE1sirg-ybFq2NnrGG12AGXLuB6T5Ev1aC-bvnSnBbbKkmq98KKLYy8PGaNJSnAzC4-T1vK71bFil1CVMrlwtwePbGfW2hSut/s1600/Square.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;196&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3s6sFvCmM08CC__2NBN2UjLF575H_sA4SCna0E9yX3L0kE1sirg-ybFq2NnrGG12AGXLuB6T5Ev1aC-bvnSnBbbKkmq98KKLYy8PGaNJSnAzC4-T1vK71bFil1CVMrlwtwePbGfW2hSut/s400/Square.bmp&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The square aperture with an area of 40x40.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;text-align: left;&quot;&gt;The next thing I generated was a sinusoid along the x-direction, a.k.a. corrugated roof. Since we wanted a sinusoid along the x-direction, for sure, the X matrix would be the argument of sine. I had some time figuring out the right argument for sine. For our synthetic image to be a corrugated roof, a spatial frequency factor, together with a pi, must be inserted as an argument of sine. And here it is!&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3nfv5lME_P_I_ys5JsveRUIZBwMw-k9jDey1CS-UXBTaxDMvaIcxNUmdogM-YSBcrG9IUQQCJEctweZM5h_zPetaFxCsehmlG7m8h7pBHCXKu1lFh6T_U9hG6XXiblEhWhyphenhyphenB_V6bK4L-7/s1600/Corrugated+roof.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;196&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3nfv5lME_P_I_ys5JsveRUIZBwMw-k9jDey1CS-UXBTaxDMvaIcxNUmdogM-YSBcrG9IUQQCJEctweZM5h_zPetaFxCsehmlG7m8h7pBHCXKu1lFh6T_U9hG6XXiblEhWhyphenhyphenB_V6bK4L-7/s400/Corrugated+roof.bmp&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The corrugated roof with a spatial frequency of 10!&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp;And for the code... The factors f and pi in the argument of sine played significant role in making the synthetic image looked like a corrugated roof. A plain A = sin(X) would not output the right figure. &lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1ccEpfUxPi5OK0ervEJJSrY7mckwxEgqcDfWpieg1AhVTUrsrCsiH3vzlsYfowc3rRJzUKdE5D99Q41Zgvg7o32Ju5n-57d2T9xYyZs8YlJF1hb4NVqsj_bF7-ZslTcrS3mu9e1zABE-S/s1600/Corrugated+roof+code.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;91&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1ccEpfUxPi5OK0ervEJJSrY7mckwxEgqcDfWpieg1AhVTUrsrCsiH3vzlsYfowc3rRJzUKdE5D99Q41Zgvg7o32Ju5n-57d2T9xYyZs8YlJF1hb4NVqsj_bF7-ZslTcrS3mu9e1zABE-S/s320/Corrugated+roof+code.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The code for a corrugated roof. Notice the factors f and pi in the argument of sine!&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Okay. For the next synthetic image, we have a grating along the x direction. I took advantage of the sine function in this case since I realized that a grating has a repetitive property. Together with the functions &lt;i&gt;round&lt;/i&gt; and &lt;i&gt;abs&lt;/i&gt;, I was able to generate a grating. Notice that the argument of sine contained a factor of 10. Varying this, i.e., inserting other number, changes the output image. This consumed much of my time figuring out how to generalize it. That means controlling the number of gratings. &lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiN0h6xr5nd-D1i7lyxkcUV7Qx3zqAWzbICmNgyipWck-dmfeNb1B42ro97hsKY2Mmq6nM_HpEFljZO67ay9f-j_R3RT-RzP9h-S4WXHAEUHFVDpdXed8pME5-ZUrKTuNJup661oVF99yFQ/s1600/Grating+code.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;112&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiN0h6xr5nd-D1i7lyxkcUV7Qx3zqAWzbICmNgyipWck-dmfeNb1B42ro97hsKY2Mmq6nM_HpEFljZO67ay9f-j_R3RT-RzP9h-S4WXHAEUHFVDpdXed8pME5-ZUrKTuNJup661oVF99yFQ/s400/Grating+code.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;This still needs to be generalized. &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;text-align: left;&quot;&gt;And the result...&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8VMPY5XxwcZHSkvQfOkIQlw0HAW9UXU0CSkNzWZEpnQgexirTvOYbjqsoPflNVOMGNi69dOXPsKs70tJRqatHNy3j97tL0ucw7Vzd1Ebi524DLebuqywtoI9C4LbXKHW-Wx8Z4fgOzxSw/s1600/Grating.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;196&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8VMPY5XxwcZHSkvQfOkIQlw0HAW9UXU0CSkNzWZEpnQgexirTvOYbjqsoPflNVOMGNi69dOXPsKs70tJRqatHNy3j97tL0ucw7Vzd1Ebi524DLebuqywtoI9C4LbXKHW-Wx8Z4fgOzxSw/s400/Grating.bmp&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Not bad at all.&amp;nbsp;&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;text-align: left;&quot;&gt;And finally, a circular aperture with graded transparency was created. Depending on the value of sigma used, the spread of the&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Gaussian_function&quot;&gt;Gaussian function&lt;/a&gt; varies. It is good to know that the variance measures the spread of the function. Adjusting the value of sigma in the snippet of code below gives you a different output.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjBxqI1N-aL0ow30UenaoCXTE843HXFdSpK5L5uFiXRxgdKqAKrlMoYLfkDZu-X4LmvOJbeyIBfjM4IP4Yj0vnbR_8j_LCvgecsHDQ2YDP_8uffD-G9ZK_ERcYbzfxybtSov3oFz9MGwbx/s1600/Gaussian+code+1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;127&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjBxqI1N-aL0ow30UenaoCXTE843HXFdSpK5L5uFiXRxgdKqAKrlMoYLfkDZu-X4LmvOJbeyIBfjM4IP4Yj0vnbR_8j_LCvgecsHDQ2YDP_8uffD-G9ZK_ERcYbzfxybtSov3oFz9MGwbx/s400/Gaussian+code+1.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Try different values for sigma. And compare the results. Also, you may try adding a factor for the Gaussian function.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;And the result is this!&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG886yC3RUzDz52dwuU9JIsGdqnq6v4fsBibmCrNca0kwhThr0lqPBqSnkvkH7heWlaTqdV-_xSwEzBrEY3pOh19_i-mkvmSHiqIKnlZulIYB7OU-QuGY4KcgIXbEEGY-7iTRaks5v3mLd/s1600/Gaussian+1.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;196&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG886yC3RUzDz52dwuU9JIsGdqnq6v4fsBibmCrNca0kwhThr0lqPBqSnkvkH7heWlaTqdV-_xSwEzBrEY3pOh19_i-mkvmSHiqIKnlZulIYB7OU-QuGY4KcgIXbEEGY-7iTRaks5v3mLd/s400/Gaussian+1.bmp&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;A circular aperture with a Gaussian transparency (sigma = 0.5).&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;The&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Double-slit_experiment&quot;&gt;double-slit experiment&lt;/a&gt; or Young&#39;s experiment is very known in the field of optics. Since most of the synthetic images I created are being used in optics, I decided to come up with patterns that are at least familiar and useful in optics.&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAUCcY_pehzIozIofx6VF5JC8ZxWu_WvF42WZsL0v4oxQzn6Pz_DYd9GM0rTAWDjdFrqS8dPaNBpLGqDvUL8N7_t9bdWPuKRzGnFKyoyYDtI6HHOelwN3ePfRmj2QlSnvP2MOwwzqOflZc/s1600/Double+slit.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;196&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAUCcY_pehzIozIofx6VF5JC8ZxWu_WvF42WZsL0v4oxQzn6Pz_DYd9GM0rTAWDjdFrqS8dPaNBpLGqDvUL8N7_t9bdWPuKRzGnFKyoyYDtI6HHOelwN3ePfRmj2QlSnvP2MOwwzqOflZc/s400/Double+slit.bmp&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr align=&quot;center&quot;&gt;&lt;td class=&quot;tr-caption&quot;&gt;The well-known double- slit!&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;The code I used to generate such image is shown below. Notice that the width of each slit &lt;i&gt;a&lt;/i&gt; and the separation distance &lt;i&gt;d&lt;/i&gt; of the slits may vary. In this case, I chose&lt;i&gt; a&lt;/i&gt; = 5 and &lt;i&gt;d&lt;/i&gt; = 20.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmtRKI8NoaUMnrmnLB63MouAbka7YuS_Rwvas_OURKzwb45NCQhuk72n4MI973HMOctsy6X9sb1OMt2CE3Ld8vcASB7ZdGdJDsbIiu6DlHuNlbRsN1US5CeljPcQBNSs2DbP-HMdliwiE9/s1600/Double+slit+code.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;131&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmtRKI8NoaUMnrmnLB63MouAbka7YuS_Rwvas_OURKzwb45NCQhuk72n4MI973HMOctsy6X9sb1OMt2CE3Ld8vcASB7ZdGdJDsbIiu6DlHuNlbRsN1US5CeljPcQBNSs2DbP-HMdliwiE9/s400/Double+slit+code.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;You may try different values for &lt;i&gt;a&lt;/i&gt; and &lt;i&gt;d &lt;/i&gt;too!&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;I remember some of the apertures I encountered in Fresnel diffraction and I want to duplicate them. An example is shown below.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRN3r7L4pOlMVo3hV9tiq07hcjMy1OF7qcamN1I-NS-boV7h-1DUuPDLDD4uw6YaSPMGdY6xW1s00amNkx0iPloaAk0Q06Go75M3yOfYq5TPQrUam7AYhhQU68R0wwF5r4G0seh3N4SgD3/s1600/Aperture+1.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;196&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRN3r7L4pOlMVo3hV9tiq07hcjMy1OF7qcamN1I-NS-boV7h-1DUuPDLDD4uw6YaSPMGdY6xW1s00amNkx0iPloaAk0Q06Go75M3yOfYq5TPQrUam7AYhhQU68R0wwF5r4G0seh3N4SgD3/s400/Aperture+1.bmp&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;A man-with-a-hat aperture.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Half of the bigger circle needs to be cropped. Masking technique was used to remove the lower half of the circle. Also, a smaller circle was created inside the bigger one. See the code below.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKIn_EfVe31anxfFkP7bQllUpiXiJO9jIpnuJIs0ZunKx3NItwe02oShRTCQltK0ywtac7VbVTEEwocLCgKQ45JTVn8KBTnIES3m4SJ5nCMdWtlG_Zlo7glhX8RRySGh9Wu7veWLfTzsBJ/s1600/Aperture+1+code.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;143&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKIn_EfVe31anxfFkP7bQllUpiXiJO9jIpnuJIs0ZunKx3NItwe02oShRTCQltK0ywtac7VbVTEEwocLCgKQ45JTVn8KBTnIES3m4SJ5nCMdWtlG_Zlo7glhX8RRySGh9Wu7veWLfTzsBJ/s400/Aperture+1+code.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;The code for the man-with-a-hat aperture.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;There are a lot of interesting synthetic images one can create using Scilab or any numerical software. Imagination and algorithm are the key! I enjoyed doing this activity and I would not be hesitant to give my self a grade of 13 for this. I hope to be able to enhance my Scilab skills in the future, i.e., in the succeeding weeks!&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anythingphysics.blogspot.com/feeds/3414078638793040890/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anythingphysics.blogspot.com/2011/06/scilab-basics.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/3414078638793040890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/3414078638793040890'/><link rel='alternate' type='text/html' href='http://anythingphysics.blogspot.com/2011/06/scilab-basics.html' title='Scilab Basics'/><author><name>Jen-Jen Manuel</name><uri>http://www.blogger.com/profile/17781945162053242109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio7WYdtUaWDpY0vUR8rmhXb6vLXc_NJhfW7210lMlbkFxjcoaf31CZ38KIuNSzomRZXPSXX9zYuME75wQBlwP99KltNLXSivQIMcdocBxzVUhe4t36aIu_krVWKUOErA4/s220/49936_1530407762_2876926_n.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikeJem2g4TFZ3YP2_eF5a38P8XosQeMIksudZjKWGinDLlPctCkwL6UyM4u1FyZ3OTbRGtaYBzxKELu0ekhqdmAm6XWRX2UlOVB8AW0KrvVT499_9Ol3KbHQntga06cRGGUDnGziQmhFYs/s72-c/Error+in+installing+SIVP.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2748687604404631686.post-3751066224096795188</id><published>2011-06-16T12:48:00.000+08:00</published><updated>2011-06-16T22:25:23.616+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="digital scanning"/><title type='text'>Hello AP186!</title><content type='html'>Digital scanning is the first activity that we performed in my Applied Physics 186 class. During the time when computers were not yet used in generating figures, people had the last resort (or only option?) to draw their figures and graph manually. Such a tedious job for them! The french curve is one among the many useful tools used in drawing smooth curves. Thanks to everyone who contributed in making things easier for us these days.&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq3MdmDlfiPJl_e8wIqVAwoPxe4ODv2k3xiG5R56kQyOUC_FpZhrBDKvw5y5obR_E9L70ZO-vNjavQ-dKsorMowlBgPEI74qmpX9RDuqW3f0OjE-u0nLQPP99HSdUokI3UhpYab1u3jAyf/s1600/french_curves3.jpg&quot;&gt;&lt;img style=&quot;display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 213px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq3MdmDlfiPJl_e8wIqVAwoPxe4ODv2k3xiG5R56kQyOUC_FpZhrBDKvw5y5obR_E9L70ZO-vNjavQ-dKsorMowlBgPEI74qmpX9RDuqW3f0OjE-u0nLQPP99HSdUokI3UhpYab1u3jAyf/s320/french_curves3.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5618820587798891586&quot; border=&quot;0&quot; /&gt;graphicsdirect.co.uk&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;I am not really into editing pictures or anything that has something to do with Paint, Adobe Photoshop and the like. I became a bit scared when I learned that our activity would be about counting pixels and doing ratio and proportion. Contrary to what I expected, everything went well.&lt;br /&gt;&lt;br /&gt;The figure that I used in this activity was from Tracy. It came from a 1973 thesis. The first problem I encountered was how to rotate the figure since it was kind of tilted.&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiot-TPLSUxBYIcp15aw3IW133hm_64eVmtZYjbS8nsMvromBzB6rZjZeDFDW5cWVO6Dmh99i6L-zDrhzOwkfFuG63nDc12QopM8rOfsC1yQsTR_sZgg_ryO25R3K-PeYA-O7i367Xxoi5h/s1600/02.jpg&quot;&gt;&lt;img style=&quot;display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 224px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiot-TPLSUxBYIcp15aw3IW133hm_64eVmtZYjbS8nsMvromBzB6rZjZeDFDW5cWVO6Dmh99i6L-zDrhzOwkfFuG63nDc12QopM8rOfsC1yQsTR_sZgg_ryO25R3K-PeYA-O7i367Xxoi5h/s320/02.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5618792284458871938&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt; &lt;span style=&quot;font-size:78%;&quot;&gt;The original image I got from Tracy. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;It was Rusty&#39;s idea to rotate it using Word. For about 15 minutes, I tried figuring out how to do it in Word. And finally after doing multiple right clicks in order to find the proper command, the image was now ready to be digitally scanned!&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq6IQbX5Of5SL74f7axjxLpMigBCwwwKOYIC9lwGQVNzVSV7WOgOiI6p_i4Jx2CgIqTXKj1dBVOdi_TcL-1DsLEw0bMvIhIidlpFf2c-vf8W21FoxpUOwmtpjOf7cDZZ9yx0yU2U-kyVtc/s1600/Rotated+1.png&quot;&gt;&lt;img style=&quot;display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 171px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq6IQbX5Of5SL74f7axjxLpMigBCwwwKOYIC9lwGQVNzVSV7WOgOiI6p_i4Jx2CgIqTXKj1dBVOdi_TcL-1DsLEw0bMvIhIidlpFf2c-vf8W21FoxpUOwmtpjOf7cDZZ9yx0yU2U-kyVtc/s320/Rotated+1.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5618794811211896978&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;div style=&quot;text-align: center;&quot;&gt; &lt;span style=&quot;font-size:78%;&quot;&gt;The rotated image ready to be digitally scanned!&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;text-align: left;&quot;&gt;With the image now ready, I removed all the excess areas on the graph leaving everything enclosed by the intersecting x and y axes.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3Q5FezNg24Sv127EvcYUFceNQtdAuj_epsPlnsXFv_FfcUngb3V8aO3D5CNTDTu8p0coqnDMSy4UD0Voh34fcBzYubtHUNYV7qeX4J7IELZ-43MabFqXUi1rs-qWdSsVUhUNazcFavJjh/s1600/Rotated.png&quot;&gt;&lt;img style=&quot;display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 164px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3Q5FezNg24Sv127EvcYUFceNQtdAuj_epsPlnsXFv_FfcUngb3V8aO3D5CNTDTu8p0coqnDMSy4UD0Voh34fcBzYubtHUNYV7qeX4J7IELZ-43MabFqXUi1rs-qWdSsVUhUNazcFavJjh/s320/Rotated.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5618796741621130530&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;div style=&quot;text-align: center;&quot;&gt; &lt;span style=&quot;font-size:78%;&quot;&gt;And now let&#39;s begin!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;I located the origin and recorded its pixel coordinates. I also measured the length of each axis and the corresponding location of the tick marks in the pixel world. The first technique I used was to know how many pixels make up an interval in both axes. Then I selected few points in the graph and obtained their coordinates in pixel. With this, I could go directly to ratio and proportion in finding the exact physical quantities.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5m9hooIHxgwfMEiAy0QUt3dus3HFpf3dRg4oywQ1hycTpNUpV9c13SuM164IFbaRkU0MBuP9BB1-SpmS0o-GLBHPQZXedOHTYUT5SecOfHS8IupLQ1Xx82R9a5FHuu0g2f90T7hyphenhyphenc9pO4/s1600/Final+with+label.png&quot;&gt;&lt;img style=&quot;display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 202px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5m9hooIHxgwfMEiAy0QUt3dus3HFpf3dRg4oywQ1hycTpNUpV9c13SuM164IFbaRkU0MBuP9BB1-SpmS0o-GLBHPQZXedOHTYUT5SecOfHS8IupLQ1Xx82R9a5FHuu0g2f90T7hyphenhyphenc9pO4/s320/Final+with+label.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5618804239370608386&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;div style=&quot;text-align: center;&quot;&gt; &lt;span style=&quot;font-size:78%;&quot;&gt;The final result! The original image superimposed with the reconstructed graph.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: left;&quot;&gt;And now for the second technique, the following plots were made.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn8Ret2ZVfl0ND_yE8ZyOYWoij_VXVZ9xiLYEsX7fiJFoUx1MgOz0l7voPznTlxnuqJzlmkdo5AwuK3BNJ826oQbgOPnwVyNvhTIGQekSs0Wbq_BpLZ6Kxl29b63rccmsivB5kWNaEGW98/s1600/YvsPixel.png&quot;&gt;&lt;img style=&quot;display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 193px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn8Ret2ZVfl0ND_yE8ZyOYWoij_VXVZ9xiLYEsX7fiJFoUx1MgOz0l7voPznTlxnuqJzlmkdo5AwuK3BNJ826oQbgOPnwVyNvhTIGQekSs0Wbq_BpLZ6Kxl29b63rccmsivB5kWNaEGW98/s320/YvsPixel.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5618814831182580194&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;div style=&quot;text-align: center;&quot;&gt; &lt;span style=&quot;font-size:78%;&quot;&gt;A plot of the y-axis tick marks versus their corresponding y-coordinate in pixel.&lt;/span&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq7g2nABcdp9q9Jb2-WQzh6g7giJy-mtTm4U95F_YuJpyxAa9qjBD_NEu-hzS1HUrzGi4sEHr8qomON2UU0iLtrOSdbbXgLm7w5l3M8R8oyTVs1xs5746sy_6u7B7Bg81ARzVU6i_dG2Mo/s1600/XvsPixel.png&quot;&gt;&lt;img style=&quot;display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 193px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq7g2nABcdp9q9Jb2-WQzh6g7giJy-mtTm4U95F_YuJpyxAa9qjBD_NEu-hzS1HUrzGi4sEHr8qomON2UU0iLtrOSdbbXgLm7w5l3M8R8oyTVs1xs5746sy_6u7B7Bg81ARzVU6i_dG2Mo/s320/XvsPixel.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5618814825858874898&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;div style=&quot;text-align: center;&quot;&gt; &lt;span style=&quot;font-size:78%;&quot;&gt;A plot of the x-axis tick marks versus their corresponding x-coordinate in pixel.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;This technique consumed much of my time because the image I used in determining the x and y-coordinates in pixel of the tick marks for both axes was the one that was not yet cropped. So I needed to start all over again. I was kind of disappointed to see that the result of this is not the same as that of the first one.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgroQrxFVMdYfo0onswWGVIlLPaaCdFZRK8SMgy9NwtgVeDjyuRbI3Q-4FhPCZADXirmXTuqrlCP-RFf5BwkNFyDv4l1YnZ-wru5XPjzDt0UuWlNb6ACPwM9sjfsLg3ATpqILW1p8T73FLX/s1600/Final2.png&quot;&gt;&lt;img style=&quot;display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 188px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgroQrxFVMdYfo0onswWGVIlLPaaCdFZRK8SMgy9NwtgVeDjyuRbI3Q-4FhPCZADXirmXTuqrlCP-RFf5BwkNFyDv4l1YnZ-wru5XPjzDt0UuWlNb6ACPwM9sjfsLg3ATpqILW1p8T73FLX/s320/Final2.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5618817164190475634&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;div style=&quot;text-align: center;&quot;&gt; &lt;span style=&quot;font-size:78%;&quot;&gt;Not a good one. But better than the first one I got using this technique.&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;text-align: left;&quot;&gt;It seems that the reconstructed graph is shifted some units away from the original one.&lt;br /&gt;&lt;br /&gt;With all the results shown, a grade of 8 will be okay for me. The first technique did work but a lot of approximations were done. The second technique presented here is better than the first but asks you to be accurate and precise in determining the coordinates in pixel. It seems to me now that my measurements were not that accurate and precise.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anythingphysics.blogspot.com/feeds/3751066224096795188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anythingphysics.blogspot.com/2011/06/hello-ap186.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/3751066224096795188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2748687604404631686/posts/default/3751066224096795188'/><link rel='alternate' type='text/html' href='http://anythingphysics.blogspot.com/2011/06/hello-ap186.html' title='Hello AP186!'/><author><name>Jen-Jen Manuel</name><uri>http://www.blogger.com/profile/17781945162053242109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio7WYdtUaWDpY0vUR8rmhXb6vLXc_NJhfW7210lMlbkFxjcoaf31CZ38KIuNSzomRZXPSXX9zYuME75wQBlwP99KltNLXSivQIMcdocBxzVUhe4t36aIu_krVWKUOErA4/s220/49936_1530407762_2876926_n.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq3MdmDlfiPJl_e8wIqVAwoPxe4ODv2k3xiG5R56kQyOUC_FpZhrBDKvw5y5obR_E9L70ZO-vNjavQ-dKsorMowlBgPEI74qmpX9RDuqW3f0OjE-u0nLQPP99HSdUokI3UhpYab1u3jAyf/s72-c/french_curves3.jpg" height="72" width="72"/><thr:total>0</thr:total></entry></feed>