<?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: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-8100611507941163067</id><updated>2011-08-02T13:46:05.023-07:00</updated><category term='career'/><category term='http://www.blogger.com/img/blank.gif'/><title type='text'>Chocolate lover</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jrvitug.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://jrvitug.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Jaziel</name><uri>http://www.blogger.com/profile/04691747960517842787</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_1iO_ypw66RA/Sj8P-fXMj5I/AAAAAAAAABQ/L-wUdz_4OJA/S220/DSC04020.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>22</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8100611507941163067.post-1507677077623676410</id><published>2011-07-13T07:19:00.000-07:00</published><updated>2011-07-13T07:23:15.519-07:00</updated><title type='text'>I believe</title><content type='html'>"Even if everybody thinks you're not... I still believe that you are"... &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We are human beings... not perfect... but we shouldn't be deprived of the chance to improve ourselves and show the society the better side of us... &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Just some random thoughts from a very lazy evening... I remember the time when I last spoke about this.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8100611507941163067-1507677077623676410?l=jrvitug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jrvitug.blogspot.com/feeds/1507677077623676410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jrvitug.blogspot.com/2011/07/i-believe.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/1507677077623676410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/1507677077623676410'/><link rel='alternate' type='text/html' href='http://jrvitug.blogspot.com/2011/07/i-believe.html' title='I believe'/><author><name>Jaziel</name><uri>http://www.blogger.com/profile/04691747960517842787</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_1iO_ypw66RA/Sj8P-fXMj5I/AAAAAAAAABQ/L-wUdz_4OJA/S220/DSC04020.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8100611507941163067.post-16856924577909010</id><published>2011-06-17T06:53:00.001-07:00</published><updated>2011-06-17T06:57:47.027-07:00</updated><title type='text'>Happy weekend ^_^</title><content type='html'>And so my day ended very happily!  I know God will not let things happen without lessons to be learned.  I will always trust in You Lord... &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What a happy weekend indeed!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8100611507941163067-16856924577909010?l=jrvitug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jrvitug.blogspot.com/feeds/16856924577909010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jrvitug.blogspot.com/2011/06/happy-weekend.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/16856924577909010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/16856924577909010'/><link rel='alternate' type='text/html' href='http://jrvitug.blogspot.com/2011/06/happy-weekend.html' title='Happy weekend ^_^'/><author><name>Jaziel</name><uri>http://www.blogger.com/profile/04691747960517842787</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_1iO_ypw66RA/Sj8P-fXMj5I/AAAAAAAAABQ/L-wUdz_4OJA/S220/DSC04020.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8100611507941163067.post-6994653342818593863</id><published>2011-06-17T01:20:00.000-07:00</published><updated>2011-06-17T01:25:26.043-07:00</updated><title type='text'>I was just so scared</title><content type='html'>I've been used to presenting talks about my research... But today, I don't know.  I just got so scared to people.  My confidence in facing different people inclined to different areas of research dropped down... I'm frustrated... but I know, this gave me a very important lesson...&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8100611507941163067-6994653342818593863?l=jrvitug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jrvitug.blogspot.com/feeds/6994653342818593863/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jrvitug.blogspot.com/2011/06/i-was-just-so-scared.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/6994653342818593863'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/6994653342818593863'/><link rel='alternate' type='text/html' href='http://jrvitug.blogspot.com/2011/06/i-was-just-so-scared.html' title='I was just so scared'/><author><name>Jaziel</name><uri>http://www.blogger.com/profile/04691747960517842787</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_1iO_ypw66RA/Sj8P-fXMj5I/AAAAAAAAABQ/L-wUdz_4OJA/S220/DSC04020.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8100611507941163067.post-5789576714283090460</id><published>2011-01-23T05:10:00.000-08:00</published><updated>2011-01-23T05:29:22.289-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='career'/><title type='text'>get back that luck</title><content type='html'>It's been more than a year since I visited my blog.  And oh yeah, I was still an undergraduate student when I last posted some stuffs (academic-related stuffs) here.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;I just astonished and anxious about TIME.  Yes, time flies so fast.  It seems like it was only yesterday when I rushed my blogs, my papers, my thesis.  And now, time for making another thesis is coming... again...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I am already a 2nd year Master of Physics student... and next semester.. YES, as in June-Nov 2011, I shall be defending my master's thesis.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I was quite lucky during my undergrad years because I was able to conduct experiments and gather data everytime I lack information to support my research topic.  And because of my excitement to my research, I entered the graduate program immediately after graduating last November 2009.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, I am feeling a bit nervous about my research.  One factor is that the laser I used before is now in trouble.  The simmer LED doesn't turn on during the warm up time.  My supervisor has already checked several parameters to resolve our problem, but unfortunately, until now it is still not lighting.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Given more than 6 months before the end of the 1st semester of AY 2011-2012, our group must get the laser back to operation.  Many of us depend on it.  We can't easily replace it because IT IS VERY COSTLY... T_T&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I just hope to get back that luck and be able to debug the problem in our laser.  &lt;cross-fingers&gt;...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8100611507941163067-5789576714283090460?l=jrvitug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jrvitug.blogspot.com/feeds/5789576714283090460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jrvitug.blogspot.com/2011/01/get-back-that-luck.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/5789576714283090460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/5789576714283090460'/><link rel='alternate' type='text/html' href='http://jrvitug.blogspot.com/2011/01/get-back-that-luck.html' title='get back that luck'/><author><name>Jaziel</name><uri>http://www.blogger.com/profile/04691747960517842787</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_1iO_ypw66RA/Sj8P-fXMj5I/AAAAAAAAABQ/L-wUdz_4OJA/S220/DSC04020.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8100611507941163067.post-644430146589799215</id><published>2009-10-12T09:31:00.000-07:00</published><updated>2009-10-12T20:06:14.514-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='http://www.blogger.com/img/blank.gif'/><title type='text'>Activity 19 Restoration of blurred images</title><content type='html'>The main objective of this activity is to restore an image corrupted by a known degradation function and an additive noise using Mean square error (Weiner) filtering.&lt;br /&gt;In order to perform this, we first choose a clean grayscale image containing some texts within.  The chosen image is shown in Figure 1.  This image was then degraded by adding a Gaussian noise with it.  The discussion about this noise model has been stated in the previous activity.&lt;br /&gt;To perform the restoration, a simple model adapted from the handout [1] is displayed in figure 2.  The image is degraded by convolving the degradation function h(x,y) with the image f(x,y) and adding the Gaussian noise &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StPgGjHo6OI/AAAAAAAAAtM/q_0oCe1B-6s/s1600-h/nu.bmp"&gt;&lt;img style="cursor: pointer; width: 17px; height: 23px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StPgGjHo6OI/AAAAAAAAAtM/q_0oCe1B-6s/s400/nu.bmp" alt="" id="BLOGGER_PHOTO_ID_5391899582003734754" border="0" /&gt;&lt;/a&gt;(x,y).  Note that this is in spatial domain.  In order to transform this to the frequency domain, we take the Fourier transform of the terms and apply equation 2 in the handout, given by:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/StPhI63qV-I/AAAAAAAAAtU/V1aSBsObEQw/s1600-h/degradation+equation.bmp"&gt;&lt;img style="cursor: pointer; width: 264px; height: 33px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/StPhI63qV-I/AAAAAAAAAtU/V1aSBsObEQw/s400/degradation+equation.bmp" alt="" id="BLOGGER_PHOTO_ID_5391900722250536930" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;where capital letters correspond to the Fourier transform of the functions.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StNabG5CjtI/AAAAAAAAArU/QZ2G8umXJJA/s1600-h/starbucks.bmp"&gt;&lt;img style="cursor: pointer; width: 300px; height: 400px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StNabG5CjtI/AAAAAAAAArU/QZ2G8umXJJA/s400/starbucks.bmp" alt="" id="BLOGGER_PHOTO_ID_5391752600645439186" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1.  Clean image&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StPfaPCC1vI/AAAAAAAAAtE/nhoA-SxUi3g/s1600-h/model.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 147px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StPfaPCC1vI/AAAAAAAAAtE/nhoA-SxUi3g/s400/model.bmp" alt="" id="BLOGGER_PHOTO_ID_5391898820697315058" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.  Model of image degradation and restoration.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;If we assume that the image is blurred by a linear motion between the sensor and the image during the acquisition, the image then undergoes a planar displacement in the x and y direction which varies through time t.  In order to obtain to total exposure at any point of the recording medium, the integral of the instantaneous exposure is taken over the time interval for which the imaging shutter is opened.  And if the opening and closing of the shutter occurs instantaneously, we can isolate the image motion and arrive at the blurred image using the formula:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/StPj0EnXXUI/AAAAAAAAAtc/S2Af7CyHVJM/s1600-h/g.bmp"&gt;&lt;img style="cursor: pointer; width: 284px; height: 45px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/StPj0EnXXUI/AAAAAAAAAtc/S2Af7CyHVJM/s400/g.bmp" alt="" id="BLOGGER_PHOTO_ID_5391903662624169282" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;where T is the exposure time.  This can also be expressed in the frequency domain which is equivalent to:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/StPkd_68u8I/AAAAAAAAAtk/fDuutcjbIiE/s1600-h/Gg.bmp"&gt;&lt;img style="cursor: pointer; width: 182px; height: 26px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/StPkd_68u8I/AAAAAAAAAtk/fDuutcjbIiE/s400/Gg.bmp" alt="" id="BLOGGER_PHOTO_ID_5391904382918638530" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;The degradation function H is estimated using the following expression&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/StPlGzSdLiI/AAAAAAAAAts/q-iwoo6NNlw/s1600-h/H.bmp"&gt;&lt;img style="cursor: pointer; width: 357px; height: 61px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/StPlGzSdLiI/AAAAAAAAAts/q-iwoo6NNlw/s400/H.bmp" alt="" id="BLOGGER_PHOTO_ID_5391905083902209570" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;Note that the variables a and b correspond to the total distance from which the image is displaced in the x and y direction.&lt;br /&gt;&lt;br /&gt;In order to employ Weiner filtering, we treat the the image and the noise as random processes &lt;span style="font-size:100%;"&gt;and try to estimate&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/StPm9Hjv0GI/AAAAAAAAAt0/RWkRG-8S9gw/s1600-h/f+hut.bmp"&gt;&lt;span style="font-size:100%;"&gt;&lt;img style="cursor: pointer; width: 24px; height: 41px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/StPm9Hjv0GI/AAAAAAAAAt0/RWkRG-8S9gw/s400/f+hut.bmp" alt="" id="BLOGGER_PHOTO_ID_5391907116568006754" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;such that its mean square error with the original image f is small.  This is performed mathematically by using the the equations:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/StPoHf-6UyI/AAAAAAAAAuM/BMTZgHqaHo8/s1600-h/eqn6.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 83px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/StPoHf-6UyI/AAAAAAAAAuM/BMTZgHqaHo8/s400/eqn6.bmp" alt="" id="BLOGGER_PHOTO_ID_5391908394434712354" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: justify;"&gt;where&lt;br /&gt;&lt;/div&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/StPn9cV4y2I/AAAAAAAAAt8/qVbQRKJHJxg/s1600-h/eqn+6+variable.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 88px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/StPn9cV4y2I/AAAAAAAAAt8/qVbQRKJHJxg/s400/eqn+6+variable.bmp" alt="" id="BLOGGER_PHOTO_ID_5391908221658647394" border="0" /&gt;&lt;/a&gt;.&lt;br /&gt;&lt;/div&gt;Alternatively, the expression for F above can be approximated by the equation:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/StPn93rornI/AAAAAAAAAuE/rVbsKi5lgNA/s1600-h/eqn+7.bmp"&gt;&lt;img style="cursor: pointer; width: 316px; height: 81px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/StPn93rornI/AAAAAAAAAuE/rVbsKi5lgNA/s400/eqn+7.bmp" alt="" id="BLOGGER_PHOTO_ID_5391908228997623410" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;where K is a constant.  This is particularly used when we are dealing with spectral white noise such that the spectrum is constant.&lt;br /&gt;&lt;br /&gt;By varying the parameters a b and T, we apply Gaussian noise and degrade the image.  The results for this degradation process are shown in Figure2.  Using the last two expressions for &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/StPpfDcbebI/AAAAAAAAAuU/fafMpFRyuzs/s1600-h/F.bmp"&gt;&lt;img style="cursor: pointer; width: 56px; height: 27px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/StPpfDcbebI/AAAAAAAAAuU/fafMpFRyuzs/s400/F.bmp" alt="" id="BLOGGER_PHOTO_ID_5391909898602379698" border="0" /&gt;&lt;/a&gt;, we try to restore these blurred images and the are shown in Figures 3 and 4.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/StPRqRAc52I/AAAAAAAAArc/_ButGonjzhQ/s1600-h/blur+a%3Db%3D0.001.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 231px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/StPRqRAc52I/AAAAAAAAArc/_ButGonjzhQ/s400/blur+a%3Db%3D0.001.bmp" alt="" id="BLOGGER_PHOTO_ID_5391883702942623586" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/StPRrWa_lPI/AAAAAAAAArs/aGVuMWuIxvI/s1600-h/blur+a%3Db%3D0.005.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 234px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/StPRrWa_lPI/AAAAAAAAArs/aGVuMWuIxvI/s400/blur+a%3Db%3D0.005.bmp" alt="" id="BLOGGER_PHOTO_ID_5391883721575994610" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/StPRq2K15qI/AAAAAAAAArk/Tl_m_i2ZtRg/s1600-h/blur+a%3Db%3D0.01.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 231px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/StPRq2K15qI/AAAAAAAAArk/Tl_m_i2ZtRg/s400/blur+a%3Db%3D0.01.bmp" alt="" id="BLOGGER_PHOTO_ID_5391883712918316706" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/StPZwB7tsVI/AAAAAAAAAsk/_SSB6jcA77A/s1600-h/blur+a%3Db%3D0.1.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 234px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/StPZwB7tsVI/AAAAAAAAAsk/_SSB6jcA77A/s400/blur+a%3Db%3D0.1.bmp" alt="" id="BLOGGER_PHOTO_ID_5391892598068457810" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Figure 2.  Degradation of the image using different values of a, b, and T&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Upon increasing the values of a and b, image becomes more blurry.  This is reasonable since upon increasing the distance for which the image is displaced along the x and y axis with respect to the recording medium, lesser the information about the image can be generated.  And it is seen that at a=b= 0.1, most of the information regarding the image is lost.&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StPRrrCcUyI/AAAAAAAAAr0/GOs6Pi7shSs/s1600-h/eqn6+a%3Db%3D0.001.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 188px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StPRrrCcUyI/AAAAAAAAAr0/GOs6Pi7shSs/s400/eqn6+a%3Db%3D0.001.bmp" alt="" id="BLOGGER_PHOTO_ID_5391883727110165282" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/StPR9i-5PWI/AAAAAAAAAsE/odEz20gpF40/s1600-h/eqn6+a%3Db%3D0.005.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 188px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/StPR9i-5PWI/AAAAAAAAAsE/odEz20gpF40/s400/eqn6+a%3Db%3D0.005.bmp" alt="" id="BLOGGER_PHOTO_ID_5391884034185444706" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/StPRsId16JI/AAAAAAAAAr8/I_ACwX8ymJg/s1600-h/eqn6+a%3Db%3D0.01.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 188px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/StPRsId16JI/AAAAAAAAAr8/I_ACwX8ymJg/s400/eqn6+a%3Db%3D0.01.bmp" alt="" id="BLOGGER_PHOTO_ID_5391883735009716370" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/StPZwk4r6eI/AAAAAAAAAss/BbFZm0jMSUQ/s1600-h/eqn6+a%3Db%3D0.1.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 188px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/StPZwk4r6eI/AAAAAAAAAss/BbFZm0jMSUQ/s400/eqn6+a%3Db%3D0.1.bmp" alt="" id="BLOGGER_PHOTO_ID_5391892607450999266" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3.  Restoration of the image using Weiner Filtering&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;From the figure above, the quality of the degraded image was improved, although it was not totally recovered.  And comparing the images before and after applying Weiner flitering, we can observe that some of the information regarding the original image were restored.  However, among the four sets of images, the restoration for a=b=0.1 is poorest.&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StPXb0YD8fI/AAAAAAAAAsM/1Cdu6sZ67o4/s1600-h/weiner2+for+all+K+a%3Db%3D0.001+T%3D1.bmp"&gt;&lt;img style="cursor: pointer; width: 337px; height: 400px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StPXb0YD8fI/AAAAAAAAAsM/1Cdu6sZ67o4/s400/weiner2+for+all+K+a%3Db%3D0.001+T%3D1.bmp" alt="" id="BLOGGER_PHOTO_ID_5391890051808621042" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/StPXc0GN37I/AAAAAAAAAsc/itHjcdhm6g0/s1600-h/weiner2+for+all+K+a%3Db%3D0.005+T%3D1.bmp"&gt;&lt;img style="cursor: pointer; width: 345px; height: 400px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/StPXc0GN37I/AAAAAAAAAsc/itHjcdhm6g0/s400/weiner2+for+all+K+a%3Db%3D0.005+T%3D1.bmp" alt="" id="BLOGGER_PHOTO_ID_5391890068913643442" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StPXcSfpyXI/AAAAAAAAAsU/JmLBNp0se90/s1600-h/weiner2+for+all+K+a%3Db%3D0.01+T%3D1.bmp"&gt;&lt;img style="cursor: pointer; width: 337px; height: 400px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StPXcSfpyXI/AAAAAAAAAsU/JmLBNp0se90/s400/weiner2+for+all+K+a%3Db%3D0.01+T%3D1.bmp" alt="" id="BLOGGER_PHOTO_ID_5391890059893524850" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/StPckRZG92I/AAAAAAAAAs0/-3RSbrsO4Gk/s1600-h/weiner2+for+all+K+a%3Db%3D0.1+T%3D1.bmp"&gt;&lt;img style="cursor: pointer; width: 341px; height: 400px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/StPckRZG92I/AAAAAAAAAs0/-3RSbrsO4Gk/s400/weiner2+for+all+K+a%3Db%3D0.1+T%3D1.bmp" alt="" id="BLOGGER_PHOTO_ID_5391895694594733922" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 4.  Restoration of the image using Weiner Filtering equation 2 for different K, a, b, and T.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;After using the second equation for the Weiner filtering and using different values for K (0.005-0.01 with 0.001 interval), restoration of some information in the image was done.  However, if we compared the result with Figure 3, it can be seen that richer image quality is obtained in the first expression.  And after varying K, no significant difference was observed.&lt;br /&gt;&lt;br /&gt;In this activity, I was able to restore the degraded image corrupted with a degradation function and a Gaussian noise model so I am giving myself a grade of 10.&lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt;" Restoration of blurred images", Activity 18 Handout, Applied Physics 186.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8100611507941163067-644430146589799215?l=jrvitug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jrvitug.blogspot.com/feeds/644430146589799215/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jrvitug.blogspot.com/2009/10/activity-19-restoration-of-blurred.html#comment-form' title='36 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/644430146589799215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/644430146589799215'/><link rel='alternate' type='text/html' href='http://jrvitug.blogspot.com/2009/10/activity-19-restoration-of-blurred.html' title='Activity 19 Restoration of blurred images'/><author><name>Jaziel</name><uri>http://www.blogger.com/profile/04691747960517842787</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_1iO_ypw66RA/Sj8P-fXMj5I/AAAAAAAAABQ/L-wUdz_4OJA/S220/DSC04020.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_1iO_ypw66RA/StPgGjHo6OI/AAAAAAAAAtM/q_0oCe1B-6s/s72-c/nu.bmp' height='72' width='72'/><thr:total>36</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8100611507941163067.post-4858630682620854480</id><published>2009-10-10T21:17:00.000-07:00</published><updated>2009-10-12T09:17:42.094-07:00</updated><title type='text'>Activity 18 Noise model and basic image restoration</title><content type='html'>In this activity, we try to demonstrate the different types of noise and image restoration techniques.  Similar to image enhancement technique, this method aims to improve the quality of images surrounded with noise.  However, this technique is more of object type as compared to image enhancement technique which is subjective in nature.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;The image below shows the clean image composed of three grayscale values.  The corresponding probability distribution function (PDF) of the gray levels of the clean image is also shown together with the image.&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/StMUbiNTluI/AAAAAAAAAj0/ywJaSbEyeAA/s1600-h/clean.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 196px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/StMUbiNTluI/AAAAAAAAAj0/ywJaSbEyeAA/s400/clean.bmp" alt="" id="BLOGGER_PHOTO_ID_5391675642164254434" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Figure 1.  Clean image and its PDF&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The different noise models that are applied to the image above are as follows:&lt;br /&gt;&lt;br /&gt;1.  Gaussian noise&lt;br /&gt;This model is also known as the normal noise model from which the PDF is given by:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/StMai0jWKXI/AAAAAAAAAmc/CVXNdXkZh6I/s1600-h/gaussian.bmp"&gt;&lt;img style="cursor: pointer; width: 235px; height: 69px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/StMai0jWKXI/AAAAAAAAAmc/CVXNdXkZh6I/s400/gaussian.bmp" alt="" id="BLOGGER_PHOTO_ID_5391682364417386866" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;where z is the gray level value, &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/StMbPQJw6oI/AAAAAAAAAmk/4xywZJrcFWQ/s1600-h/mu.bmp"&gt;&lt;img style="cursor: pointer; width: 15px; height: 23px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/StMbPQJw6oI/AAAAAAAAAmk/4xywZJrcFWQ/s400/mu.bmp" alt="" id="BLOGGER_PHOTO_ID_5391683127740525186" border="0" /&gt;&lt;/a&gt; is the average, and &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StMbP-QTGeI/AAAAAAAAAms/Blcs3GFJZEE/s1600-h/sigma.bmp"&gt;&lt;img style="cursor: pointer; width: 15px; height: 23px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StMbP-QTGeI/AAAAAAAAAms/Blcs3GFJZEE/s400/sigma.bmp" alt="" id="BLOGGER_PHOTO_ID_5391683140115962338" border="0" /&gt;&lt;/a&gt; is the standard deviation.&lt;br /&gt;&lt;br /&gt;2.  Gamma/Erlang noise&lt;br /&gt;This model has a PDF equal to:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/StMcCpHFuPI/AAAAAAAAAm0/S1e0PSJ_gfo/s1600-h/erlang.bmp"&gt;&lt;img style="cursor: pointer; width: 331px; height: 140px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/StMcCpHFuPI/AAAAAAAAAm0/S1e0PSJ_gfo/s400/erlang.bmp" alt="" id="BLOGGER_PHOTO_ID_5391684010613520626" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;and the mean and variance are given by:&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/StMcDCFbvmI/AAAAAAAAAm8/jCF3wX8m8gs/s1600-h/mean+and+std+for+erlang.bmp"&gt;&lt;img style="cursor: pointer; width: 76px; height: 126px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/StMcDCFbvmI/AAAAAAAAAm8/jCF3wX8m8gs/s400/mean+and+std+for+erlang.bmp" alt="" id="BLOGGER_PHOTO_ID_5391684017317461602" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;3.  Exponential noise model&lt;br /&gt;For this model, the PDF is given as:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StMdllEwZoI/AAAAAAAAAnE/2BZMR2fCaFQ/s1600-h/exp.bmp"&gt;&lt;img style="cursor: pointer; width: 241px; height: 99px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StMdllEwZoI/AAAAAAAAAnE/2BZMR2fCaFQ/s400/exp.bmp" alt="" id="BLOGGER_PHOTO_ID_5391685710337042050" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;and the mean and variance of the density are:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StMdmQAdR5I/AAAAAAAAAnM/1inMV_QcOAQ/s1600-h/mu+exp.bmp"&gt;&lt;img style="cursor: pointer; width: 71px; height: 58px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StMdmQAdR5I/AAAAAAAAAnM/1inMV_QcOAQ/s400/mu+exp.bmp" alt="" id="BLOGGER_PHOTO_ID_5391685721861736338" border="0" /&gt;&lt;/a&gt;  &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/StMdm8w8ogI/AAAAAAAAAnU/TTqx8Q8L6Kg/s1600-h/var+exp.bmp"&gt;&lt;img style="cursor: pointer; width: 86px; height: 62px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/StMdm8w8ogI/AAAAAAAAAnU/TTqx8Q8L6Kg/s400/var+exp.bmp" alt="" id="BLOGGER_PHOTO_ID_5391685733876277762" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;4.  Rayleigh noise model&lt;br /&gt;The PDF of the Rayleigh noise model is given by:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/StMeTuVdS5I/AAAAAAAAAns/Vjkb5mMoUog/s1600-h/rayleigh.bmp"&gt;&lt;img style="cursor: pointer; width: 334px; height: 107px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/StMeTuVdS5I/AAAAAAAAAns/Vjkb5mMoUog/s400/rayleigh.bmp" alt="" id="BLOGGER_PHOTO_ID_5391686503096994706" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;and the mean and variance are determine using the equations:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/StMeUl53AEI/AAAAAAAAAn8/adqdcwiNpko/s1600-h/mu+rayleigh.bmp"&gt;&lt;img style="cursor: pointer; width: 130px; height: 36px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/StMeUl53AEI/AAAAAAAAAn8/adqdcwiNpko/s400/mu+rayleigh.bmp" alt="" id="BLOGGER_PHOTO_ID_5391686518013624386" border="0" /&gt;&lt;/a&gt;  &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/StMeUC6zj-I/AAAAAAAAAn0/FpYpxRcaR38/s1600-h/var+rayleigh.bmp"&gt;&lt;img style="cursor: pointer; width: 129px; height: 54px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/StMeUC6zj-I/AAAAAAAAAn0/FpYpxRcaR38/s400/var+rayleigh.bmp" alt="" id="BLOGGER_PHOTO_ID_5391686508622352354" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;5.  Uniform noise model&lt;br /&gt;To determine the PDF, mean, and variance of this model, the following equations are used.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/StMdncJa6SI/AAAAAAAAAnc/6tFr6qV3ZZw/s1600-h/uniform.bmp"&gt;&lt;img style="cursor: pointer; width: 267px; height: 116px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/StMdncJa6SI/AAAAAAAAAnc/6tFr6qV3ZZw/s400/uniform.bmp" alt="" id="BLOGGER_PHOTO_ID_5391685742300424482" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/StMdnjgJtZI/AAAAAAAAAnk/OKttSJo37NM/s1600-h/mu+unif.bmp"&gt;&lt;img style="cursor: pointer; width: 111px; height: 57px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/StMdnjgJtZI/AAAAAAAAAnk/OKttSJo37NM/s400/mu+unif.bmp" alt="" id="BLOGGER_PHOTO_ID_5391685744274814354" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/StMfiMFYA7I/AAAAAAAAAoU/JS8etdunBbI/s1600-h/var+unif.bmp"&gt;&lt;img style="cursor: pointer; width: 136px; height: 69px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/StMfiMFYA7I/AAAAAAAAAoU/JS8etdunBbI/s400/var+unif.bmp" alt="" id="BLOGGER_PHOTO_ID_5391687851112399794" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;6.  Impulse (Salt and Pepper) noise model&lt;br /&gt;The PDF of this model is:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StMeVPG6QmI/AAAAAAAAAoE/xkUM_A09xxY/s1600-h/S%26P.bmp"&gt;&lt;img style="cursor: pointer; width: 251px; height: 86px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StMeVPG6QmI/AAAAAAAAAoE/xkUM_A09xxY/s400/S%26P.bmp" alt="" id="BLOGGER_PHOTO_ID_5391686529074217570" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;These noise models were simulated using the "grand" function available in Scilab programming language.  The effect of the different noise model on the clean image is investigated and shown in Figure 2.  Notice from the PDF of the different noise models that the graylevels of the image which were supposedly consisting of only three values become broad and occupied other graylevel values.  Depending on the parameters of the noise model, the width of the broadening can be varied.  From Figure 2, it can also be noticed that after adding a uniform noise to the image, the graylevels become very large in range such that the values from ~125 to 255 were covered.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/StMU4ScunVI/AAAAAAAAAk0/YKtFBVQ7unM/s1600-h/noise+with+pdf.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 249px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/StMU4ScunVI/AAAAAAAAAk0/YKtFBVQ7unM/s400/noise+with+pdf.bmp" alt="" id="BLOGGER_PHOTO_ID_5391676136150179154" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.  Different noise models applied to the clean image&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;In order to improve the quality of the degraded image brought by the added noise, spatial filtering method is employed.  The different filters that are utilized in this activity are as follows.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Arithmetic Mean Filter (AMF)&lt;/span&gt;&lt;br /&gt;In this method, a window S_xy with dimensions m x n and centered at point (x,y) from the corrupted image g(x,y) is selected and the average values of g(x,y) in the area of the window is computed.  This can be expressed mathematically as:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/StMzIWoYUvI/AAAAAAAAAoc/WerGNXs1mvw/s1600-h/AMF.bmp"&gt;&lt;img style="cursor: pointer; width: 235px; height: 71px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/StMzIWoYUvI/AAAAAAAAAoc/WerGNXs1mvw/s400/AMF.bmp" alt="" id="BLOGGER_PHOTO_ID_5391709397499532018" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;where f(x,y) is the restored image.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Geometric Mean Filter (GMF)&lt;/span&gt;&lt;br /&gt;This filter is used by implementing the following formula for computing the restore image f(x,y).&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StMzI42PDUI/AAAAAAAAAok/6Yps5EGKkeE/s1600-h/GMF.bmp"&gt;&lt;img style="cursor: pointer; width: 255px; height: 98px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StMzI42PDUI/AAAAAAAAAok/6Yps5EGKkeE/s400/GMF.bmp" alt="" id="BLOGGER_PHOTO_ID_5391709406684450114" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-weight: bold;"&gt;Harmonic Mean Filter (HMF)&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;To restore the corrupted image brought by the addition of noise, this filter is employed by following the formula:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/StMzJZvMWWI/AAAAAAAAAos/SA0JE-N2yqQ/s1600-h/HMF.bmp"&gt;&lt;img style="cursor: pointer; width: 229px; height: 113px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/StMzJZvMWWI/AAAAAAAAAos/SA0JE-N2yqQ/s400/HMF.bmp" alt="" id="BLOGGER_PHOTO_ID_5391709415513282914" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-weight: bold;"&gt;Contraharmonic Mean Filter (CMF)&lt;/span&gt;&lt;br /&gt;This filter works by using the expression:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StMzJitYmWI/AAAAAAAAAo0/bvQMK1tliVA/s1600-h/CMF.bmp"&gt;&lt;img style="cursor: pointer; width: 207px; height: 125px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StMzJitYmWI/AAAAAAAAAo0/bvQMK1tliVA/s400/CMF.bmp" alt="" id="BLOGGER_PHOTO_ID_5391709417921616226" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;where Q is the order of the filter.  Different values of Q yields the removal of either salt or pepper noise and it cannot eliminate both the salt and pepper at the same time.&lt;br /&gt;&lt;br /&gt;By implementing the formula given for every filter, the corrupted images after adding the different noise models were restored and shown in the figures below together with the PDF of the restored images.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/StMUc1MlACI/AAAAAAAAAkM/99j3FFlsoM8/s1600-h/Filtering+Gaussian+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 302px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/StMUc1MlACI/AAAAAAAAAkM/99j3FFlsoM8/s400/Filtering+Gaussian+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391675664441344034" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3.  Restoration of image with Gaussian noise&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StMVhI8asRI/AAAAAAAAAl0/dQWaOteS5XI/s1600-h/PDF+Filtering+Gaussian+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 291px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StMVhI8asRI/AAAAAAAAAl0/dQWaOteS5XI/s400/PDF+Filtering+Gaussian+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391676837973373202" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 4.  PDF of the restored image contaminated with Gaussian noise&lt;br /&gt;&lt;div style="text-align: justify;"&gt;From the restored images and their corresponding PDF, Gaussian noise was partially eliminated.  From the originally very noisy image, the different filters showed an enhancement of the image quality.  By observing the PDF of the restored images after using the 4 filters discussed above, it can be seen that the graylevels of the image became narrower in range.  However, the initially white part of the image was converted to some other grays values.&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/StMUcWSywUI/AAAAAAAAAkE/N0B2ANwu_9s/s1600-h/Filtering+Gamma+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 304px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/StMUcWSywUI/AAAAAAAAAkE/N0B2ANwu_9s/s400/Filtering+Gamma+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391675656145912130" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 5.  Restoration of image with Gamma noise&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StMVgmpsevI/AAAAAAAAAls/Z5Jn730v3uw/s1600-h/PDF+Filtering+Gamma+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 297px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StMVgmpsevI/AAAAAAAAAls/Z5Jn730v3uw/s400/PDF+Filtering+Gamma+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391676828768041714" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 6.  PDF of the restored image contaminated with Gamma noise&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;After applying the different filters on the image contaminated with Gamma noise, the characteristic of the image became better in such a manner that the PDF showed three peaks with graylevel values close to the original image.  Among the four filters, contraharmonic filter exhibit the worst restoration because the corresponding PDF of the image which was treated still showed a broad graylevel values.  This can be further improved by trying other values for Q.&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StMUcANiK9I/AAAAAAAAAj8/YdBKDcHHnvQ/s1600-h/Filtering+Exponential+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 307px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StMUcANiK9I/AAAAAAAAAj8/YdBKDcHHnvQ/s400/Filtering+Exponential+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391675650218273746" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 7.  Restoration of image with Exponential noise&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StMU47qDYNI/AAAAAAAAAk8/qiVAeCUM_Aw/s1600-h/PDF+Filtering+Exponential+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 287px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StMU47qDYNI/AAAAAAAAAk8/qiVAeCUM_Aw/s400/PDF+Filtering+Exponential+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391676147211919570" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 8.  PDF of the restored image contaminated with Exponential noise&lt;br /&gt;&lt;div style="text-align: justify;"&gt;For the exponential noise that was added to the image, the four filters were shown to be effective in restoring the originally uncontaminated image.  However, observing the PDF of the image treated with an arithmetic mean filter, there is an appearance of other peaks aside from the three high peaks.&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/StMU3-HGJOI/AAAAAAAAAks/G8zo1UUsBH0/s1600-h/Filtering+Uniform+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 312px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/StMU3-HGJOI/AAAAAAAAAks/G8zo1UUsBH0/s400/Filtering+Uniform+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391676130690737378" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 9.  Restoration of image with Uniform noise&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StMW69OHcRI/AAAAAAAAAmU/2JF3VnY5Z7g/s1600-h/PDF+Filtering+Uniform+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 294px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StMW69OHcRI/AAAAAAAAAmU/2JF3VnY5Z7g/s400/PDF+Filtering+Uniform+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391678381014610194" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 10.  PDF of the restored image contaminated with Uniform noise&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/StMUdDlQ3oI/AAAAAAAAAkU/q8k7OGmW6Gg/s1600-h/Filtering+Rayleigh+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 301px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/StMUdDlQ3oI/AAAAAAAAAkU/q8k7OGmW6Gg/s400/Filtering+Rayleigh+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391675668302978690" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 11.  Restoration of image with Rayleigh noise&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/StMVhuJ6O5I/AAAAAAAAAl8/HFSUmwo_Vxg/s1600-h/PDF+Filtering+Rayleigh+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 306px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/StMVhuJ6O5I/AAAAAAAAAl8/HFSUmwo_Vxg/s400/PDF+Filtering+Rayleigh+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391676847962078098" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 12.  PDF of the restored image contaminated with Rayleigh noise&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The restoration of the image with uniform and rayleigh noise was also successfully done the four spatial filters.  By comparing the PDF of the initially very noisy image when uniform noise is added and the PDF after applying the filter, we can see that there is a large improvement on the quality of the image.&lt;br /&gt;&lt;br /&gt;For the salt and pepper noise added to the image, it can be seen that contraharmonic mean filter works best among the four filters.  Further investigation was done when this filter is applied for different Q.  In order to evaluate the mechanism of the filter for every Q, I used four values of Q, from -2 to +2 with an increment of 1 and applied CMF to the image contaminated with salt and pepper noise. The corresponding images with their PDF are shown in Figures 15 and 16.&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StMU3m_ETDI/AAAAAAAAAkk/0O8W17fsuSg/s1600-h/Filtering+S%26P+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 309px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StMU3m_ETDI/AAAAAAAAAkk/0O8W17fsuSg/s400/Filtering+S%26P+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391676124483046450" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 13.  Restoration of image with Salt and Pepper noise&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/StMViX_00nI/AAAAAAAAAmM/A5Czu09MyIo/s1600-h/PDF+Filtering+S%26P+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 294px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/StMViX_00nI/AAAAAAAAAmM/A5Czu09MyIo/s400/PDF+Filtering+S%26P+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391676859194069618" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 14.  PDF of the restored image contaminated with Salt and Pepper noise&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/StMU3B8wLTI/AAAAAAAAAkc/9sl7eKLjx3M/s1600-h/Filtering+S%26P+noise+for+diff+Q.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 296px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/StMU3B8wLTI/AAAAAAAAAkc/9sl7eKLjx3M/s400/Filtering+S%26P+noise+for+diff+Q.bmp" alt="" id="BLOGGER_PHOTO_ID_5391676114541227314" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 15.  Restoration of image contaminated with salt and pepper noise using CMF at different Q.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/StMVhy9R5jI/AAAAAAAAAmE/9oBxL9Y-c2Y/s1600-h/PDF+Filtering+S%26P+noise+for+diff+Q.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 299px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/StMVhy9R5jI/AAAAAAAAAmE/9oBxL9Y-c2Y/s400/PDF+Filtering+S%26P+noise+for+diff+Q.bmp" alt="" id="BLOGGER_PHOTO_ID_5391676849251280434" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 16. PDF of the restored image after using CMF at different Q&lt;br /&gt;&lt;div style="text-align: justify;"&gt;From the plots above, notice that if Q is negative, salt noise is eliminated while for positive Q, pepper noise is removed.&lt;br /&gt;&lt;br /&gt;The different noise model and spatial filters for image restoration are again utilized for another image and the results are shown below.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/StM5f9kci_I/AAAAAAAAAo8/4IFrVA4S3lA/s1600-h/clean.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 167px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/StM5f9kci_I/AAAAAAAAAo8/4IFrVA4S3lA/s400/clean.bmp" alt="" id="BLOGGER_PHOTO_ID_5391716400158772210" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/StM51rciGnI/AAAAAAAAAp8/JVD4vWuuDw0/s1600-h/noise+set1.bmp"&gt;&lt;img style="cursor: pointer; width: 363px; height: 400px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/StM51rciGnI/AAAAAAAAAp8/JVD4vWuuDw0/s400/noise+set1.bmp" alt="" id="BLOGGER_PHOTO_ID_5391716773250865778" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StM51zFrLGI/AAAAAAAAAqE/ynUOsoQUyDc/s1600-h/noise+set2.bmp"&gt;&lt;img style="cursor: pointer; width: 356px; height: 400px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StM51zFrLGI/AAAAAAAAAqE/ynUOsoQUyDc/s400/noise+set2.bmp" alt="" id="BLOGGER_PHOTO_ID_5391716775302474850" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/StM5iJO4xSI/AAAAAAAAApc/ZKmDyIFWTXo/s1600-h/filtering+Gaussian+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 249px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/StM5iJO4xSI/AAAAAAAAApc/ZKmDyIFWTXo/s400/filtering+Gaussian+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391716437649311010" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/StNRV7VlCMI/AAAAAAAAAq0/ANoF-Gyu5Vo/s1600-h/PDF+filtering+Gaussian+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 236px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/StNRV7VlCMI/AAAAAAAAAq0/ANoF-Gyu5Vo/s400/PDF+filtering+Gaussian+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391742616039917762" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/StM5huQyu1I/AAAAAAAAApU/gIoMi9V_D20/s1600-h/filtering+Gamma+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 253px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/StM5huQyu1I/AAAAAAAAApU/gIoMi9V_D20/s400/filtering+Gamma+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391716430409546578" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/StNRVYZEvrI/AAAAAAAAAqs/PlYDYPZ3wD0/s1600-h/PDF+filtering+Gamma+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 246px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/StNRVYZEvrI/AAAAAAAAAqs/PlYDYPZ3wD0/s400/PDF+filtering+Gamma+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391742606659337906" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StM50DSe1MI/AAAAAAAAApk/wdKPbFrD-CY/s1600-h/filtering+rayleigh+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 251px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StM50DSe1MI/AAAAAAAAApk/wdKPbFrD-CY/s400/filtering+rayleigh+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391716745291420866" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/StNRWL4AYpI/AAAAAAAAAq8/N6ydF5QPh64/s1600-h/PDF+filtering+rayleigh+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 248px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/StNRWL4AYpI/AAAAAAAAAq8/N6ydF5QPh64/s400/PDF+filtering+rayleigh+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391742620479283858" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StM51ObSqwI/AAAAAAAAAp0/0JDCubhyxTY/s1600-h/filtering+uniform+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 247px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StM51ObSqwI/AAAAAAAAAp0/0JDCubhyxTY/s400/filtering+uniform+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391716765461031682" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StNV7_jL4TI/AAAAAAAAArM/zO0HbQDYrj8/s1600-h/PDF+filtering+uniform+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 246px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StNV7_jL4TI/AAAAAAAAArM/zO0HbQDYrj8/s400/PDF+filtering+uniform+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391747668052271410" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/StM50pthvgI/AAAAAAAAAps/AILeLDJcgEM/s1600-h/filtering+S%26P+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 245px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/StM50pthvgI/AAAAAAAAAps/AILeLDJcgEM/s400/filtering+S%26P+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391716755605405186" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/StNV7psR_BI/AAAAAAAAArE/TMXiA7eUbmA/s1600-h/PDF+filtering+S%26P+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 239px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/StNV7psR_BI/AAAAAAAAArE/TMXiA7eUbmA/s400/PDF+filtering+S%26P+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391747662184840210" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/StM5g--dUuI/AAAAAAAAApM/d40r8CLiE-c/s1600-h/filtering+exponential+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 247px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/StM5g--dUuI/AAAAAAAAApM/d40r8CLiE-c/s400/filtering+exponential+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391716417716179682" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/StNRU1bgQBI/AAAAAAAAAqk/JVifBWh0kmI/s1600-h/PDF+filtering+exponential+noise.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 235px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/StNRU1bgQBI/AAAAAAAAAqk/JVifBWh0kmI/s400/PDF+filtering+exponential+noise.bmp" alt="" id="BLOGGER_PHOTO_ID_5391742597274288146" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/StNOszkmmvI/AAAAAAAAAqU/vHXlndUcTDE/s1600-h/CMF+S%26P+noise+for+diff+Q.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 237px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/StNOszkmmvI/AAAAAAAAAqU/vHXlndUcTDE/s400/CMF+S%26P+noise+for+diff+Q.bmp" alt="" id="BLOGGER_PHOTO_ID_5391739710557559538" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StNRUTWFvfI/AAAAAAAAAqc/nv2f6S_rfHc/s1600-h/PDF+CMF+S%26P+noise+for+diff+Q.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 236px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StNRUTWFvfI/AAAAAAAAAqc/nv2f6S_rfHc/s400/PDF+CMF+S%26P+noise+for+diff+Q.bmp" alt="" id="BLOGGER_PHOTO_ID_5391742588124773874" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;For this activity, I was able to show the different noise models and their effects on the image as well as the image restoration using the discussed spatial filters.  Since the objective of the experiment was met, I give myself a grade of 10.&lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt;&lt;br /&gt;"Noise model and basic image restoration", Applied physics 186 Activity 18 Handout&lt;br /&gt;image:  http://www.inhabitat.com/wp-content/uploads/fostergianttower.jpg&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8100611507941163067-4858630682620854480?l=jrvitug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jrvitug.blogspot.com/feeds/4858630682620854480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jrvitug.blogspot.com/2009/10/activity-18-noise-model-and-basic-image.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/4858630682620854480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/4858630682620854480'/><link rel='alternate' type='text/html' href='http://jrvitug.blogspot.com/2009/10/activity-18-noise-model-and-basic-image.html' title='Activity 18 Noise model and basic image restoration'/><author><name>Jaziel</name><uri>http://www.blogger.com/profile/04691747960517842787</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_1iO_ypw66RA/Sj8P-fXMj5I/AAAAAAAAABQ/L-wUdz_4OJA/S220/DSC04020.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_1iO_ypw66RA/StMUbiNTluI/AAAAAAAAAj0/ywJaSbEyeAA/s72-c/clean.bmp' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8100611507941163067.post-7956281574817115221</id><published>2009-10-09T02:45:00.000-07:00</published><updated>2009-10-10T21:15:08.127-07:00</updated><title type='text'>Activity 17 Photometric Stereo</title><content type='html'>As from our previous activities, we know that the brightness of an object highly depends on the amount of light it receives from the source and the reflectance of the object's surface.&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/Ss8Onx2kByI/AAAAAAAAAg0/TqRaXRTS_dg/s1600-h/image+for+reflectance.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 184px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/Ss8Onx2kByI/AAAAAAAAAg0/TqRaXRTS_dg/s400/image+for+reflectance.bmp" alt="" id="BLOGGER_PHOTO_ID_5390543355545650978" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;Consider the image shown above.  The variable P resembles the point at the surface, p(P) is the reflectance, S(P) is the vector from P to the source, n(P) is the normal vector at point P, and r(P) is the distance from P to the source.  For a point source, the brightness decreases to 1/r^2 and this proportionality is more clearly seen for a nearby point source, wherein the brightness is given by:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/Ss8N6q9ILYI/AAAAAAAAAgM/EtqjH1KScEI/s1600-h/equation+for+B%28P%29.bmp"&gt;&lt;img style="cursor: pointer; width: 288px; height: 119px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/Ss8N6q9ILYI/AAAAAAAAAgM/EtqjH1KScEI/s400/equation+for+B%28P%29.bmp" alt="" id="BLOGGER_PHOTO_ID_5390542580600024450" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;If the light source is at infinity, the light wave approaching the object appears similar to a plane wave, and the brightness becomes:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/Ss8N7HV_QJI/AAAAAAAAAgU/XbiEo21oGwA/s1600-h/B%28P%29+for+infinite+source.bmp"&gt;&lt;img style="cursor: pointer; width: 273px; height: 58px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/Ss8N7HV_QJI/AAAAAAAAAgU/XbiEo21oGwA/s400/B%28P%29+for+infinite+source.bmp" alt="" id="BLOGGER_PHOTO_ID_5390542588220489874" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;where S(P) becomes equal for all direction.  Finally, for a line source, the brightness decreases proportional to 1/r.&lt;br /&gt;&lt;br /&gt;Given a light source shone to an object at different positions, we can reconstruct the 3D shape of the surface of the object.  The technique employed for this problem is Photometric Stereo.  In this method, we capture multiple images of the surface at different locations and use these images to generate the vectors normal to the surface.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In this activity, we reconstruct the 3D shape of an object which is illuminated by a source from a very far location.  We assume that the brightness of the object is proportional to the intensity I captured by the camera at different positions V which are  represented by the different images  and matrix shown below.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/Ss8QZRV687I/AAAAAAAAAhc/lj4NXxt1txI/s1600-h/images+for+diff+pos.bmp"&gt;&lt;img style="cursor: pointer; width: 385px; height: 95px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/Ss8QZRV687I/AAAAAAAAAhc/lj4NXxt1txI/s400/images+for+diff+pos.bmp" alt="" id="BLOGGER_PHOTO_ID_5390545305323893682" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/StFYDPgskRI/AAAAAAAAAhs/g85GDUQPrE0/s1600-h/V.PNG"&gt;&lt;img style="cursor: pointer; width: 378px; height: 102px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/StFYDPgskRI/AAAAAAAAAhs/g85GDUQPrE0/s400/V.PNG" alt="" id="BLOGGER_PHOTO_ID_5391187041665716498" border="0" /&gt;&lt;/a&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;We utilize the I and V values to the equations:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/Ss8N8EWRphI/AAAAAAAAAgk/3tgefYcKUiU/s1600-h/equation+for+I.bmp"&gt;&lt;img style="cursor: pointer; width: 290px; height: 91px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/Ss8N8EWRphI/AAAAAAAAAgk/3tgefYcKUiU/s400/equation+for+I.bmp" alt="" id="BLOGGER_PHOTO_ID_5390542604596258322" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;where g corresponds to the product of the reflectance and the normal vector.  We solve for this variable in order to determine the surface normal vector n.  The next two equation are used for this step.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/Ss8N7i8otXI/AAAAAAAAAgc/n7vGvSkTS-M/s1600-h/equation+for+g.bmp"&gt;&lt;img style="cursor: pointer; width: 219px; height: 61px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/Ss8N7i8otXI/AAAAAAAAAgc/n7vGvSkTS-M/s400/equation+for+g.bmp" alt="" id="BLOGGER_PHOTO_ID_5390542595630347634" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/Ss8N8ndXi8I/AAAAAAAAAgs/VVZbyWrDC-c/s1600-h/equation+for+n.bmp"&gt;&lt;img style="cursor: pointer; width: 92px; height: 79px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/Ss8N8ndXi8I/AAAAAAAAAgs/VVZbyWrDC-c/s400/equation+for+n.bmp" alt="" id="BLOGGER_PHOTO_ID_5390542614021245890" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Since the surface normals are related to the partial derivative of the elevation of the surface f, we can integrate the derivative to finally compute the surface elevation.  The equation given below represents the elevation at any point (u,v) .&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/Ss8OpwTyLqI/AAAAAAAAAhU/HBZTDdDnuxk/s1600-h/surface+elevation.bmp"&gt;&lt;img style="cursor: pointer; width: 326px; height: 83px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/Ss8OpwTyLqI/AAAAAAAAAhU/HBZTDdDnuxk/s400/surface+elevation.bmp" alt="" id="BLOGGER_PHOTO_ID_5390543389491080866" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Following the steps above, f(u,v) was calculated and plotted to arrive at the 3D shape of the object displayed below. &lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/Ss8OofefpAI/AAAAAAAAAg8/3CVyd-ehrts/s1600-h/image.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 302px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/Ss8OofefpAI/AAAAAAAAAg8/3CVyd-ehrts/s400/image.bmp" alt="" id="BLOGGER_PHOTO_ID_5390543367792731138" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The main objective of this activity which is the reconstruction of the 3D plot of the object was fulfilled so I am giving myself a grade of 10.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt;"Photometric Stereo",Activity 17 Manual in AP 186.&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8100611507941163067-7956281574817115221?l=jrvitug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jrvitug.blogspot.com/feeds/7956281574817115221/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jrvitug.blogspot.com/2009/10/activity-17-photometric-stereo.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/7956281574817115221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/7956281574817115221'/><link rel='alternate' type='text/html' href='http://jrvitug.blogspot.com/2009/10/activity-17-photometric-stereo.html' title='Activity 17 Photometric Stereo'/><author><name>Jaziel</name><uri>http://www.blogger.com/profile/04691747960517842787</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_1iO_ypw66RA/Sj8P-fXMj5I/AAAAAAAAABQ/L-wUdz_4OJA/S220/DSC04020.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_1iO_ypw66RA/Ss8Onx2kByI/AAAAAAAAAg0/TqRaXRTS_dg/s72-c/image+for+reflectance.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8100611507941163067.post-2768433783475434186</id><published>2009-09-23T18:59:00.000-07:00</published><updated>2009-09-23T21:37:01.920-07:00</updated><title type='text'>Activity 16 Neural Networks</title><content type='html'>In this activity, pattern recognition is employed by using neural networks...&lt;div style="text-align: justify;"&gt;        &lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;Neural network is a computational model that mimics the behavior of the neurons in the brain [1].&lt;span style=""&gt;  &lt;/span&gt;It is more advantageous than linear discriminant analysis because it also considers nonlinear systems.&lt;span style=""&gt;  &lt;/span&gt;It is able to model nonlinear functions containing large variables which make it useful to several applications such as detection of medical phenomena, stock market prediction, credit assignment, monitoring the condition of machinery, and engine machinery [2].&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;To implement neural network model, I considered 10 sample objects consisting of blue and red dinosaurs as shown in Figure 1. Four feature vectors, namely the red chromaticity value, green chromaticity value, blue chromaticity value, and area were utilized for classification.&lt;span style=""&gt;  &lt;/span&gt;The area values of the objects were normalized with respect to the highest value so the feature vectors can be correlated with one another.&lt;span style=""&gt;  &lt;/span&gt;The first five rows of each column correspond to the blue dinosaurs while the last five rows describe the feature vectors of the red dinosaurs.&lt;span style=""&gt;  &lt;/span&gt;The matrix below shows the arrangement of the training set and the feature vectors.&lt;span style=""&gt;  &lt;/span&gt;The first, second, third, and fourth columns are designated to red chromaticity value, green chromaticity value, blue chromaticity value, and normalized area, respectively.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt; &lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/SrrmfcTpv9I/AAAAAAAAAfk/VjswZhsv2xA/s1600-h/pictures.jpg"&gt;&lt;img style="cursor: pointer; width: 400px; height: 174px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/SrrmfcTpv9I/AAAAAAAAAfk/VjswZhsv2xA/s400/pictures.jpg" alt="" id="BLOGGER_PHOTO_ID_5384869732323803090" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Figure 1.  Image used for neural network&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/Srrm8rUyl_I/AAAAAAAAAf0/ntEkWZJgSfE/s1600-h/trainint+set+matrix.bmp"&gt;&lt;img style="cursor: pointer; width: 349px; height: 182px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/Srrm8rUyl_I/AAAAAAAAAf0/ntEkWZJgSfE/s400/trainint+set+matrix.bmp" alt="" id="BLOGGER_PHOTO_ID_5384870234571315186" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;For this case, I chose the red dinosaurs as my desired class, so the desired output is written such that the class of blue dinosaurs is set to 0 and red dinosaurs to 1.&lt;span style=""&gt;  &lt;/span&gt;By adopting the code of Mr. Jeric Tugaff for neural network posted in Mr. Cole’s blog [3], the results shown in Figure 2 and 3 were obtained.&lt;span style=""&gt;  &lt;/span&gt;The number of iterations (T) and learning rate (LR) were varied and their effects to the accuracy of recognition were observed.&lt;span style=""&gt;  &lt;/span&gt;The values for T were changed from 100 to 500 with an increment of 100, and it was found that more accurate pattern recognition is acquired for higher T, that is, blue-colored dinosaurs resulted to values nearest to 0 and red dinosaurs nearest to 1.&lt;span style=""&gt;  &lt;/span&gt;Thus, T=500 yield the most accurate pattern recognition ability from the range chosen, and it was utilized for determining the effect of LR to the accuracy of recognition (see Figure 3).&lt;span style=""&gt;  &lt;/span&gt;LR was varied from 0.1 to 2 and it can be observed that more accurate pattern recognition is attained as the LR is increased.&lt;span style=""&gt;  &lt;/span&gt;From the range of LR values, LR=2 yielded the highest accuracy for pattern recognition by having values of red dinosaurs closest to 1 and blue dinosaurs closest to 0.&lt;span style=""&gt;  &lt;/span&gt;However, it cannot be concluded that T=500 and LR=2 are the optimized parameters for acquiring the most accurate pattern recognition ability since we can still extend the range and seek for more combination of LR and T.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SrrnlkOHimI/AAAAAAAAAf8/q3aBZFJVyV4/s1600-h/LR%3D2.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 136px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SrrnlkOHimI/AAAAAAAAAf8/q3aBZFJVyV4/s400/LR%3D2.bmp" alt="" id="BLOGGER_PHOTO_ID_5384870937038916194" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Figure 2.  Results obtained for different T&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/Srrnl5j3rfI/AAAAAAAAAgE/GGGDIbGiL9o/s1600-h/T%3D500.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 136px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/Srrnl5j3rfI/AAAAAAAAAgE/GGGDIbGiL9o/s400/T%3D500.bmp" alt="" id="BLOGGER_PHOTO_ID_5384870942767295986" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3.  Results obtained for different LR&lt;br /&gt;&lt;div style="text-align: justify;"&gt;          &lt;p class="MsoNormal"&gt;Since I was able to meet the objective of the activity, I give myself a grade of 10.&lt;span style=""&gt;  &lt;/span&gt;I would like to acknowledge Master and Orly for helping me improve my results.&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;References:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;1.&lt;span style=""&gt;  &lt;/span&gt;"Neural Networks", Activity 16 Manual.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;2.&lt;span style=""&gt;  &lt;/span&gt;"Neural Networks", Statsoft Inc., &lt;a href="http://www.statsoft.com/textbook/stneunet.html#apps"&gt;http://www.statsoft.com/textbook/stneunet.html#apps&lt;/a&gt;.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;3.&lt;span style=""&gt;  &lt;/span&gt;http://cole-ap186.blogspot.com/&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;  &lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8100611507941163067-2768433783475434186?l=jrvitug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jrvitug.blogspot.com/feeds/2768433783475434186/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jrvitug.blogspot.com/2009/09/activity-16-neural-networks.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/2768433783475434186'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/2768433783475434186'/><link rel='alternate' type='text/html' href='http://jrvitug.blogspot.com/2009/09/activity-16-neural-networks.html' title='Activity 16 Neural Networks'/><author><name>Jaziel</name><uri>http://www.blogger.com/profile/04691747960517842787</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_1iO_ypw66RA/Sj8P-fXMj5I/AAAAAAAAABQ/L-wUdz_4OJA/S220/DSC04020.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_1iO_ypw66RA/SrrmfcTpv9I/AAAAAAAAAfk/VjswZhsv2xA/s72-c/pictures.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8100611507941163067.post-4546465810441327110</id><published>2009-09-12T22:57:00.000-07:00</published><updated>2009-09-13T01:29:16.855-07:00</updated><title type='text'>Activity 15 Probabilistic Classification</title><content type='html'>&lt;p style="text-align: center;" class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SqxFEjRpKXI/AAAAAAAAAbc/IYGUvuyHCSQ/s1600-h/pictures.bmp"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Pattern recognition was performed in the previous activity using the Euclidean distance. Now, we are going to employ Linear Discriminant Analysis (LDA) for classifying members of a certain group.  The image from the previous activity are reused for this purpose and is shown in Figure 1.  LDA shows that groups can be separated by a linear combination of features that are used to describe the members.&lt;br /&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SqxFEjRpKXI/AAAAAAAAAbc/IYGUvuyHCSQ/s1600-h/pictures.bmp"&gt;&lt;img style="cursor: pointer; width: 355px; height: 171px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SqxFEjRpKXI/AAAAAAAAAbc/IYGUvuyHCSQ/s400/pictures.bmp" alt="" id="BLOGGER_PHOTO_ID_5380751599291935090" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="text-align: center;"&gt;Figure1.  Image used for pattern recognition using LDA&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Using the object features, the members are assigned to the group with highest conditional probability. This is known as Baye's rule, which helps minimize the total error of classification (TEC). Mathematically, it is expressed as the object belong to group i where&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/SqyIEttCs1I/AAAAAAAAAdM/VgI1mG7mha0/s1600-h/LDA1.bmp"&gt;&lt;img style="cursor: pointer; width: 198px; height: 21px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/SqyIEttCs1I/AAAAAAAAAdM/VgI1mG7mha0/s400/LDA1.bmp" alt="" id="BLOGGER_PHOTO_ID_5380825269370270546" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: justify;"&gt;Thus, the probability that the member belongs to group i given a set of data x is determined.&lt;br /&gt;&lt;br /&gt;To implement LDA, we form a matrix x consisting of rows of objects and columns of features.  For this particular activity, I used the same objects (blue and red dinaosaurs) and same features as the previous activity, that is, r_values and area.  From this matrix, the two classes of objects are separated (x&lt;span style="font-size:78%;"&gt;1&lt;/span&gt; and x&lt;span style="font-size:78%;"&gt;2&lt;/span&gt;) with their corresponding features.  To visualize this, refer to the equation below.&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/SqyOukSbAyI/AAAAAAAAAdU/cns1gayLH58/s1600-h/x.bmp"&gt;&lt;img style="cursor: pointer; width: 181px; height: 192px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/SqyOukSbAyI/AAAAAAAAAdU/cns1gayLH58/s400/x.bmp" alt="" id="BLOGGER_PHOTO_ID_5380832585466970914" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/SqyRGPygJsI/AAAAAAAAAds/VMH_m8uoRUY/s1600-h/x1.bmp"&gt;&lt;img style="cursor: pointer; width: 167px; height: 74px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/SqyRGPygJsI/AAAAAAAAAds/VMH_m8uoRUY/s400/x1.bmp" alt="" id="BLOGGER_PHOTO_ID_5380835191304496834" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/SqyYj7rTkTI/AAAAAAAAAek/usx4gLZ5ztQ/s1600-h/x2.bmp"&gt;&lt;img style="cursor: pointer; width: 153px; height: 79px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/SqyYj7rTkTI/AAAAAAAAAek/usx4gLZ5ztQ/s400/x2.bmp" alt="" id="BLOGGER_PHOTO_ID_5380843397883072818" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p class="MsoNormal"&gt;&lt;!--[if gte msEquation 12]&gt;&lt;m:omathpara&gt;&lt;m:omath&gt;&lt;i style="'mso-bidi-font-style:normal'"&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;x&lt;/m:r&gt;&lt;m:r&gt;=&lt;/m:r&gt;&lt;/span&gt;&lt;/i&gt;&lt;m:d&gt;&lt;m:dpr&gt;&lt;m:begchr val="["&gt;&lt;m:endchr val="]"&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:dPr&gt;&lt;m:e&gt;&lt;m:m&gt;&lt;m:mpr&gt;&lt;m:mcs&gt;&lt;m:mc&gt;&lt;m:mcpr&gt;&lt;m:count val="2"&gt;&lt;m:mcjc val="center"&gt;&lt;/m:mcPr&gt;&lt;/m:mc&gt;&lt;/m:mcs&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:mPr&gt;&lt;m:mr&gt;&lt;m:e&gt;&lt;i style="'mso-bidi-font-style:normal'"&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;0.5050407&lt;/m:r&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;m:e&gt;&lt;i style="'mso-bidi-font-style:"&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;1337&lt;/m:r&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;/m:mr&gt;&lt;m:mr&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;0.5001485&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;1682&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;/m:mr&gt;&lt;m:mr&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;0.4871048&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;1918&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;/m:mr&gt;&lt;m:mr&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;0.4747831&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;2129&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;/m:mr&gt;&lt;m:mr&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;0.5030133&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;1465&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;/m:mr&gt;&lt;m:mr&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;0.2921445&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;3580&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;/m:mr&gt;&lt;m:mr&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;0.2832496&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;2629&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;/m:mr&gt;&lt;m:mr&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;0.2933738&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;3825&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;/m:mr&gt;&lt;m:mr&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;0.2964865&lt;/m:r&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;4206&lt;/m:r&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;/m:mr&gt;&lt;m:mr&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;0.292754&lt;/m:r&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;3449&lt;/m:r&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;/m:mr&gt;&lt;/m:m&gt;&lt;/m:e&gt;&lt;/m:d&gt;&lt;/m:oMath&gt;&lt;/m:oMathPara&gt;&lt;![endif]--&gt;&lt;!--[if !msEquation]--&gt;  &lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;!--[if gte msEquation 12]&gt;&lt;m:omathpara&gt;&lt;m:omath&gt;&lt;i style="'mso-bidi-font-style:normal'"&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;x&lt;/m:r&gt;&lt;m:r&gt;=&lt;/m:r&gt;&lt;/span&gt;&lt;/i&gt;&lt;m:d&gt;&lt;m:dpr&gt;&lt;m:begchr val="["&gt;&lt;m:endchr val="]"&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:dPr&gt;&lt;m:e&gt;&lt;m:m&gt;&lt;m:mpr&gt;&lt;m:mcs&gt;&lt;m:mc&gt;&lt;m:mcpr&gt;&lt;m:count val="2"&gt;&lt;m:mcjc val="center"&gt;&lt;/m:mcPr&gt;&lt;/m:mc&gt;&lt;/m:mcs&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:mPr&gt;&lt;m:mr&gt;&lt;m:e&gt;&lt;i style="'mso-bidi-font-style:normal'"&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;0.5050407&lt;/m:r&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;m:e&gt;&lt;i style="'mso-bidi-font-style:"&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;1337&lt;/m:r&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;/m:mr&gt;&lt;m:mr&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;0.5001485&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;1682&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;/m:mr&gt;&lt;m:mr&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;0.4871048&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;1918&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;/m:mr&gt;&lt;m:mr&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;0.4747831&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;2129&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;/m:mr&gt;&lt;m:mr&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;0.5030133&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;1465&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;/m:mr&gt;&lt;m:mr&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;0.2921445&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;3580&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;/m:mr&gt;&lt;m:mr&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;0.2832496&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;2629&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;/m:mr&gt;&lt;m:mr&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;0.2933738&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;3825&lt;/m:r&gt;&lt;/span&gt;&lt;span style="'font-family:"&gt;&lt;m:ctrlpr&gt;&lt;/m:ctrlPr&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;/m:mr&gt;&lt;m:mr&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;0.2964865&lt;/m:r&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;4206&lt;/m:r&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;/m:mr&gt;&lt;m:mr&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;0.292754&lt;/m:r&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;m:e&gt;&lt;span style="'font-family:"&gt;&lt;m:r&gt;&lt;m:rpr&gt;&lt;m:scr val="roman"&gt;&lt;m:sty val="p"&gt;&lt;/m:rPr&gt;3449&lt;/m:r&gt;&lt;/span&gt;&lt;/m:e&gt;&lt;/m:mr&gt;&lt;/m:m&gt;&lt;/m:e&gt;&lt;/m:d&gt;&lt;/m:oMath&gt;&lt;/m:oMathPara&gt;&lt;![endif]--&gt;&lt;!--[if !msEquation]--&gt;&lt;span style=""&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shapetype id="_x0000_t75" coordsize="21600,21600" spt="75" preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"&gt;  &lt;v:stroke joinstyle="miter"&gt;  &lt;v:formulas&gt;   &lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;   &lt;v:f eqn="sum @0 1 0"&gt;   &lt;v:f eqn="sum 0 0 @1"&gt;   &lt;v:f eqn="prod @2 1 2"&gt;   &lt;v:f eqn="prod @3 21600 pixelWidth"&gt;   &lt;v:f eqn="prod @3 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @0 0 1"&gt;   &lt;v:f eqn="prod @6 1 2"&gt;   &lt;v:f eqn="prod @7 21600 pixelWidth"&gt;   &lt;v:f eqn="sum @8 21600 0"&gt;   &lt;v:f eqn="prod @7 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @10 21600 0"&gt;  &lt;/v:formulas&gt;  &lt;v:path extrusionok="f" gradientshapeok="t" connecttype="rect"&gt;  &lt;o:lock ext="edit" aspectratio="t"&gt; &lt;/v:shapetype&gt;&lt;v:shape id="_x0000_i1025" type="#_x0000_t75" style="'width:125.25pt;"&gt;  &lt;v:imagedata src="file:///C:\DOCUME~1\Jaziel\LOCALS~1\Temp\msohtmlclip1\01\clip_image001.png" title="" chromakey="white"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt; &lt;/span&gt;&lt;!--[endif]--&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;!--[endif]--&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;From x&lt;span style="font-size:78%;"&gt;1&lt;/span&gt; and x&lt;span style="font-size:78%;"&gt;2&lt;/span&gt;, the mean features u&lt;span style="font-size:78%;"&gt;1&lt;/span&gt; and u&lt;span style="font-size:78%;"&gt;1&lt;/span&gt;, and global mean vector are determined which are used to get the mean corrected data x&lt;span style="font-size:78%;"&gt;1&lt;/span&gt;0 and x&lt;span style="font-size:78%;"&gt;2&lt;/span&gt;o.  From these values, the pooled covariance matrix are calculated using the equation&lt;/p&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/SqyeC4alDSI/AAAAAAAAAes/2u99jwE7IG4/s1600-h/covariance.bmp"&gt;&lt;img style="cursor: pointer; width: 164px; height: 58px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/SqyeC4alDSI/AAAAAAAAAes/2u99jwE7IG4/s400/covariance.bmp" alt="" id="BLOGGER_PHOTO_ID_5380849427141692706" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;where g is the number of groups c&lt;span style="font-size:78%;"&gt;i&lt;/span&gt;(r,s) is the covariance of each group.  Finally, the discriminant function is solved using the following formula:&lt;/p&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/SqyfcGOAIUI/AAAAAAAAAe8/evadhddomcw/s1600-h/disc+func.bmp"&gt;&lt;img style="cursor: pointer; width: 248px; height: 46px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/SqyfcGOAIUI/AAAAAAAAAe8/evadhddomcw/s400/disc+func.bmp" alt="" id="BLOGGER_PHOTO_ID_5380850959855395138" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;The selection of an object to a particular group is by choosing the Fi of the class with higher value.  Here, F1 correspond to the class of red dinosaurs while F2 to the blue dinosaurs.  Table 1 shows the result after performing LDA.&lt;br /&gt;&lt;/p&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/SqyXmfcBfhI/AAAAAAAAAeM/5at8f_iEkWk/s1600-h/result.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 147px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/SqyXmfcBfhI/AAAAAAAAAeM/5at8f_iEkWk/s400/result.bmp" alt="" id="BLOGGER_PHOTO_ID_5380842342330760722" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;Table 1.  Results obtained after applying LDA&lt;br /&gt;&lt;/div&gt;The percentage of correct prediction of the classification is 100%. &lt;br /&gt;For this activity, I am able to apply LDA to classify objects belonging to a certain class.  Since I met the objective, I give myself a grade of 10.&lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;http://people.revoledu.com/kardi/tutorial/LDA/&lt;br /&gt;http://www.craftkitsandsupplies.com/images/Foam_Shapes/Foam_Dinosaur_Shapes.jpg&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8100611507941163067-4546465810441327110?l=jrvitug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jrvitug.blogspot.com/feeds/4546465810441327110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jrvitug.blogspot.com/2009/09/activity-15-probabilistic_12.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/4546465810441327110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/4546465810441327110'/><link rel='alternate' type='text/html' href='http://jrvitug.blogspot.com/2009/09/activity-15-probabilistic_12.html' title='Activity 15 Probabilistic Classification'/><author><name>Jaziel</name><uri>http://www.blogger.com/profile/04691747960517842787</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_1iO_ypw66RA/Sj8P-fXMj5I/AAAAAAAAABQ/L-wUdz_4OJA/S220/DSC04020.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_1iO_ypw66RA/SqxFEjRpKXI/AAAAAAAAAbc/IYGUvuyHCSQ/s72-c/pictures.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8100611507941163067.post-6755559999243210463</id><published>2009-09-12T17:35:00.000-07:00</published><updated>2009-09-12T19:45:05.880-07:00</updated><title type='text'>Activity 14 Pattern Recognition</title><content type='html'>In image processing, it is important to distinguish sets of classes which share common features such as size, shape, color, and others.&lt;span style=""&gt;  &lt;/span&gt;These sets of features are known as pattern and the process of determining the set of features that will enable the separation of a set into classes in called pattern recognition.&lt;span style=""&gt;  &lt;/span&gt;In this activity, our task is to apply pattern recognition in images.&lt;span style=""&gt;  &lt;/span&gt;Careful choice of the class features is important in this activity since it helps simplify our problem.&lt;span style=""&gt;  &lt;/span&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Mathematically, patterns maybe arranged into ordered sets such as feature vectors.&lt;span style=""&gt;  &lt;/span&gt;If we let ω&lt;span style="font-size:78%;"&gt;j&lt;/span&gt;, where j=1, 2, 3, …, W be a set of classes and W the total number of classes, we can define a representative of class ω&lt;span style="font-size:78%;"&gt;j&lt;/span&gt; such that its mean feature vector is:&lt;/p&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/Sqw_YARv60I/AAAAAAAAAa8/V0Fj_K3jc4s/s1600-h/mean+feature+vector.bmp"&gt;&lt;img style="cursor: pointer; width: 131px; height: 57px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/Sqw_YARv60I/AAAAAAAAAa8/V0Fj_K3jc4s/s400/mean+feature+vector.bmp" alt="" id="BLOGGER_PHOTO_ID_5380745336424753986" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;where x&lt;span style="font-size:78%;"&gt;j&lt;/span&gt; is the set of all feature vectors in class ω&lt;span style="font-size:78%;"&gt;j&lt;/span&gt; and N&lt;span style="font-size:78%;"&gt;j&lt;/span&gt; is the number of sampls in ω&lt;span style="font-size:78%;"&gt;j&lt;/span&gt;.&lt;span style=""&gt;  &lt;/span&gt;The class membership is determined by classifying an unknown feature vector x to the class whose mean is nearest to it.&lt;span style=""&gt;  &lt;/span&gt;The Euclidean distance is used for this case and is equal to:&lt;/p&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/Sqw_Yku5E6I/AAAAAAAAAbE/ofUOnIOKQCI/s1600-h/euclidian+dist.bmp"&gt;&lt;img style="cursor: pointer; width: 255px; height: 56px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/Sqw_Yku5E6I/AAAAAAAAAbE/ofUOnIOKQCI/s400/euclidian+dist.bmp" alt="" id="BLOGGER_PHOTO_ID_5380745346210665378" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;where is the ||y|| = (y&lt;sup&gt;T&lt;/sup&gt;y)&lt;sup&gt;1/2 &lt;/sup&gt;Euclidean norm [1].&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;The image [2] chosen for this activity is shown in Figure 1.  As seen from the figure, the members of the entire class are dinosaurs of different types.  From these dinosaurs, two classes are chosen and are shown in Figure 2.  The figure consists of 5 blue dinosaurs and 5 red dinosaurs.  The first three pictures of each row served as the training sets while the last two are the test objects.  The classes are differentiated from each other in terms of color and area.  For the first feature in our pattern recognition, the RGB values of each training sets are determined.  Then, the normalized chromaticity for red (denoted as r_value) and the mean  r_value for the two classes are calculated.  For the second feature, i.e. area, the training objects are first converted to binary images (with proper thresholding).  Using the code for area calculation in activity 2, the area of each training object and the mean area for each class are obtained.  Table 1 shows a summary of the r_value and area for each training object.&lt;/p&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/SqxGq32j1vI/AAAAAAAAAbs/LP59jy4QwCA/s1600-h/Foam_Dinosaur_Shapes.jpg"&gt;&lt;img style="cursor: pointer; width: 350px; height: 350px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/SqxGq32j1vI/AAAAAAAAAbs/LP59jy4QwCA/s400/Foam_Dinosaur_Shapes.jpg" alt="" id="BLOGGER_PHOTO_ID_5380753357162141426" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1.  Image used for pattern recognition [2]&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SqxFEjRpKXI/AAAAAAAAAbc/IYGUvuyHCSQ/s1600-h/pictures.bmp"&gt;&lt;img style="cursor: pointer; width: 355px; height: 171px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SqxFEjRpKXI/AAAAAAAAAbc/IYGUvuyHCSQ/s400/pictures.bmp" alt="" id="BLOGGER_PHOTO_ID_5380751599291935090" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="text-align: center;"&gt;Figure 2.  Selected classes from image&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SqxKobDyxbI/AAAAAAAAAb8/AkQqs1PHcbo/s1600-h/training+set.bmp"&gt;&lt;img style="cursor: pointer; width: 394px; height: 119px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SqxKobDyxbI/AAAAAAAAAb8/AkQqs1PHcbo/s400/training+set.bmp" alt="" id="BLOGGER_PHOTO_ID_5380757713119790514" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Table 1.  r_value and area of the training set.&lt;br /&gt;&lt;/div&gt;&lt;p class="MsoNormal"&gt;To clearly see the separation between the two classes using the features selected, the r_values for differentarea of each training object are plotted and is shown in Figure 3.  Notice that the separation between the classes is large enough to classify the objects.  This signifies that the chosen features are reliable for pattern recognition.&lt;/p&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/Sqxbqo3_8RI/AAAAAAAAAc8/E9-7hlFLQYo/s1600-h/plot+for+training+objects2.bmp"&gt;&lt;img style="cursor: pointer; width: 354px; height: 260px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/Sqxbqo3_8RI/AAAAAAAAAc8/E9-7hlFLQYo/s400/plot+for+training+objects2.bmp" alt="" id="BLOGGER_PHOTO_ID_5380776442885828882" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;&lt;br /&gt;Figure 3.  Plot of r_values versus area of the training objects&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;For the test objects, the r_value and area are also calculated.  Using Euclidean distance, test objects are classified as to what class they belong.  The computed values and the classifications are shown in Table 2 and the plot of r_values vs. area is shown in Figure 4.&lt;/p&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/SqxKojCc7oI/AAAAAAAAAcE/F2ClUOAkWQU/s1600-h/test+objects.bmp"&gt;&lt;img style="cursor: pointer; width: 337px; height: 55px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/SqxKojCc7oI/AAAAAAAAAcE/F2ClUOAkWQU/s400/test+objects.bmp" alt="" id="BLOGGER_PHOTO_ID_5380757715261648514" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;Table 2.  Tabulated r_value and area of the test objects and their classifications&lt;/p&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/Sqxbq1HC98I/AAAAAAAAAdE/75Om4Sfmlj8/s1600-h/plot+for+test+objects2.bmp"&gt;&lt;img style="cursor: pointer; width: 340px; height: 276px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/Sqxbq1HC98I/AAAAAAAAAdE/75Om4Sfmlj8/s400/plot+for+test+objects2.bmp" alt="" id="BLOGGER_PHOTO_ID_5380776446170167234" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;Figure 4.  Plot of r_values vs. area of the test objects&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;From this activity, I was able to perform pattern recognition by supplying the right feature of each class and predicting the class from which the test objects belong.  I would like to thank Kaye Vergel for that good discussion.&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Since I am able to meet the objective of the activity, I give myself a grade of 10.&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;References:&lt;/p&gt;&lt;p class="MsoNormal"&gt;1.  Activity manual for Pattern recognition&lt;/p&gt;&lt;p class="MsoNormal"&gt;2.  http://www.craftkitsandsupplies.com/images/Foam_Shapes/Foam_Dinosaur_Shapes.jpg&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8100611507941163067-6755559999243210463?l=jrvitug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jrvitug.blogspot.com/feeds/6755559999243210463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jrvitug.blogspot.com/2009/09/activity-14-pattern-recognition.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/6755559999243210463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/6755559999243210463'/><link rel='alternate' type='text/html' href='http://jrvitug.blogspot.com/2009/09/activity-14-pattern-recognition.html' title='Activity 14 Pattern Recognition'/><author><name>Jaziel</name><uri>http://www.blogger.com/profile/04691747960517842787</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_1iO_ypw66RA/Sj8P-fXMj5I/AAAAAAAAABQ/L-wUdz_4OJA/S220/DSC04020.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_1iO_ypw66RA/Sqw_YARv60I/AAAAAAAAAa8/V0Fj_K3jc4s/s72-c/mean+feature+vector.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8100611507941163067.post-7692146183565809139</id><published>2009-08-07T10:20:00.001-07:00</published><updated>2009-08-07T12:42:13.931-07:00</updated><title type='text'>Preprocessing Text</title><content type='html'>Extracting information from handwritten texts is one of the problems in image processing.  Several steps and methods are usually used in order to get the desired information like the removal of embedded lines and text separation.  In this activity, previous knowledge regarding image processing techniques are applied to recognize handwriting from a given text document.&lt;br /&gt;&lt;br /&gt;Step by step procedure&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Download the text document and crop a certain portion which shows texts together with the horizontal lines. (See Figure 1)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Make a filter mask by taking the Fourier transform of the cropped image and modifying it using Gimp to remove the white vertical lines.  This would eliminate the horizontal lines in the image. (See Figure 2).  Filter out the image using the idea of correlation.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Binarize the resulting image and apply the different morphological operations to separate the letters of the texts (SeeFigure 3)&lt;/li&gt;&lt;li&gt;Using bwlabel, label out the enclosed surfaces.  Supposedly, each letter must have its own label.  However, for this case, this was not followed. The texts in the cropped image are written in cursive style which makes the letter separation harder.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/Snxi8d5gYHI/AAAAAAAAAYc/wYfKESh3xy0/s1600-h/im2.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 400px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/Snxi8d5gYHI/AAAAAAAAAYc/wYfKESh3xy0/s400/im2.jpg" alt="" id="BLOGGER_PHOTO_ID_5367273646876287090" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/Snxjh2t3OrI/AAAAAAAAAZE/_0JZ4jqEXRI/s1600-h/im2crop.jpg"&gt;&lt;img style="cursor: pointer; width: 202px; height: 109px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/Snxjh2t3OrI/AAAAAAAAAZE/_0JZ4jqEXRI/s400/im2crop.jpg" alt="" id="BLOGGER_PHOTO_ID_5367274289193499314" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;Figure 1. Original image and a cropped portion.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/Snxi9XHzlQI/AAAAAAAAAY8/LhFD7q7P05E/s1600-h/ftcrop.jpg"&gt;&lt;img style="cursor: pointer; width: 204px; height: 113px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/Snxi9XHzlQI/AAAAAAAAAY8/LhFD7q7P05E/s400/ftcrop.jpg" alt="" id="BLOGGER_PHOTO_ID_5367273662237086978" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.  Filter mask used&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/Snxi86iUW7I/AAAAAAAAAYs/0ocY3yYIVl0/s1600-h/cleanedtext2.bmp"&gt;&lt;img style="cursor: pointer; width: 204px; height: 113px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/Snxi86iUW7I/AAAAAAAAAYs/0ocY3yYIVl0/s400/cleanedtext2.bmp" alt="" id="BLOGGER_PHOTO_ID_5367273654563658674" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3.  Binarized text of the cropped image.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/Snxi9OMCdUI/AAAAAAAAAY0/dND7eWmQErs/s1600-h/colored+label.jpg"&gt;&lt;img style="cursor: pointer; width: 204px; height: 113px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/Snxi9OMCdUI/AAAAAAAAAY0/dND7eWmQErs/s400/colored+label.jpg" alt="" id="BLOGGER_PHOTO_ID_5367273659838920002" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 4.  Bwlabel of the image.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The procedures above are  also repeated for the next task which is detect where in the word "description" is found in the document.  The first image in the figure below shows the word "description" which is drawn in Paint.  The size of this image must be equal to the size of the document.  It is then binarized, with a threshold value similar to the threshold value utilized in the first part of the activity.  Using the correlation function, the recognition of the word "description" is achieved.  The red enclosures in the last image below show the portions where the word "description" appears.  For further enhancement, it is recommended that the word "description" in the first colum be placed exactly in the center.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In this activitty, I am giving myself a grade of 9 because I did not get the most desirable results.&lt;br /&gt;I would like to thank Winsome Rara and Thirdy Buno for giving useful suggestions in the activity.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SnxjhxskyQI/AAAAAAAAAZM/bAfacyyFjXY/s1600-h/description.bmp"&gt;&lt;img style="cursor: pointer; width: 221px; height: 275px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SnxjhxskyQI/AAAAAAAAAZM/bAfacyyFjXY/s400/description.bmp" alt="" id="BLOGGER_PHOTO_ID_5367274287845918978" border="0" /&gt;&lt;/a&gt;  &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/Snxi8d5gYHI/AAAAAAAAAYc/wYfKESh3xy0/s1600-h/im2.jpg"&gt;&lt;img style="cursor: pointer; width: 219px; height: 274px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/Snxi8d5gYHI/AAAAAAAAAYc/wYfKESh3xy0/s400/im2.jpg" alt="" id="BLOGGER_PHOTO_ID_5367273646876287090" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/Snx6XLd5_2I/AAAAAAAAAZ8/WvtBEHrhB58/s1600-h/template2.jpg"&gt; &lt;img style="cursor: pointer; width: 218px; height: 274px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/Snx6XLd5_2I/AAAAAAAAAZ8/WvtBEHrhB58/s400/template2.jpg" alt="" id="BLOGGER_PHOTO_ID_5367299394552594274" border="0" /&gt;  &lt;br /&gt;&lt;/a&gt;&lt;/div&gt;Figure 5.  Output image after applying correlation function to recognized the word "description" from the text document.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;/div&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8100611507941163067-7692146183565809139?l=jrvitug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jrvitug.blogspot.com/feeds/7692146183565809139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jrvitug.blogspot.com/2009/08/preprocessing-text.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/7692146183565809139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/7692146183565809139'/><link rel='alternate' type='text/html' href='http://jrvitug.blogspot.com/2009/08/preprocessing-text.html' title='Preprocessing Text'/><author><name>Jaziel</name><uri>http://www.blogger.com/profile/04691747960517842787</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_1iO_ypw66RA/Sj8P-fXMj5I/AAAAAAAAABQ/L-wUdz_4OJA/S220/DSC04020.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_1iO_ypw66RA/Snxi8d5gYHI/AAAAAAAAAYc/wYfKESh3xy0/s72-c/im2.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8100611507941163067.post-1432082513963943778</id><published>2009-08-07T08:31:00.000-07:00</published><updated>2009-08-07T19:22:53.982-07:00</updated><title type='text'>Color Image Segmentation</title><content type='html'>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///C:%5CUsers%5CWinsome%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///C:%5CUsers%5CWinsome%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///C:%5CUsers%5CWinsome%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&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-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&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:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="--"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&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="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:roman; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	text-align:justify; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman","serif"; 	mso-fareast-font-family:Calibri;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	font-size:10.0pt; 	mso-ansi-font-size:10.0pt; 	mso-bidi-font-size:10.0pt; 	mso-fareast-font-family:Calibri;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	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:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;From the past activities, the separation of the region of interest (ROI) from the background image has been done using binary operations.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;This was proven to be a useful segmentation tool.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;However, there are instances wherein the graylevels of the images overlap with that of the background.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;As an alternative technique, colors have been used to segment the ROI from the background.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;In fact, colors are used to divide images of the skin regions in face and hand recognition, land cover in remote sensing, and cells in microscopy.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Considering images of 3D objects, it can be observed that at different pixel locations, there are colors with different shades present within the object.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;To some extent, these shadows are seen as differing brightness levels of the same color.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;Thus, the color space can be represented by the parameters that can separate the brightness and chromaticity information.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;This color space is referred as normalized chromaticity coordinates (NCC).&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;NCC is expressed as the ratio of the individual RGB values and the sum of the RGB of the images.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;Mathematically, it is defined as:&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/SnxLC6mWwGI/AAAAAAAAAX8/pcJTtP6uN6g/s1600-h/NCC.bmp"&gt;&lt;img style="cursor: pointer; width: 382px; height: 81px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/SnxLC6mWwGI/AAAAAAAAAX8/pcJTtP6uN6g/s400/NCC.bmp" alt="" id="BLOGGER_PHOTO_ID_5367247369380741218" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///C:%5CUsers%5CWinsome%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///C:%5CUsers%5CWinsome%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///C:%5CUsers%5CWinsome%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&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-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&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:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="--"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&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="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:Wingdings; 	panose-1:5 0 0 0 0 0 0 0 0 0; 	mso-font-charset:2; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:0 268435456 0 0 -2147483648 0;} @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:roman; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	text-align:justify; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman","serif"; 	mso-fareast-font-family:Calibri;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	font-size:10.0pt; 	mso-ansi-font-size:10.0pt; 	mso-bidi-font-size:10.0pt; 	mso-fareast-font-family:Calibri;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;}  /* List Definitions */  @list l0 	{mso-list-id:278681515; 	mso-list-type:hybrid; 	mso-list-template-ids:296665656 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l0:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:none; 	mso-level-number-position:left; 	text-indent:-.25in; 	font-family:Symbol;} @list l1 	{mso-list-id:936720487; 	mso-list-type:hybrid; 	mso-list-template-ids:352619944 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l1:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:none; 	mso-level-number-position:left; 	text-indent:-.25in; 	font-family:Symbol;} ol 	{margin-bottom:0in;} ul 	{margin-bottom:0in;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	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:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman","serif";} &lt;/style&gt; &lt;![endif]--&gt;  &lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;where R, G, and B are the red, green, and blue color values of the image.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;From the equations above, we can say that the values of r, g, and b are only between 0 and 1.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;Also, we do not need to derive b from the RGB since it can be obtained from r and g. This means that we can compress the 3D object image into its 2D form which makes the processing simpler.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;The figure below shows the r-g color space.&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/SnxLD-fxqoI/AAAAAAAAAYU/SQuHEsb-ixc/s1600-h/Untitled.jpg"&gt;&lt;img style="cursor: pointer; width: 267px; height: 240px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/SnxLD-fxqoI/AAAAAAAAAYU/SQuHEsb-ixc/s400/Untitled.jpg" alt="" id="BLOGGER_PHOTO_ID_5367247387606755970" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;The different techniques that make use of the colors to segment images are the parametric and non-parametric methods.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;In parametric technique, the probability that a pixel belongs to a color distribution of interest is determined.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;This is done through the following steps:&lt;/span&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;From the 3D object, crop a      ROI and determine its r and g values (see the equation above).&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Calculate the mean μr μg      and standard deviations σr σg.&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Perform the equation      below.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;Take note that the r in the      equation is the r value of the image.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;       &lt;/span&gt;&lt;span style="font-size:100%;"&gt;This probability function is used to tag a pixel value whether it      belongs to the ROI or not.&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="text-align: center;"&gt;&lt;span style="font-size:100%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SnxLCuU9pvI/AAAAAAAAAX0/28hYrL9e1jM/s1600-h/Prob.bmp"&gt;&lt;img style="cursor: pointer; width: 322px; height: 84px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SnxLCuU9pvI/AAAAAAAAAX0/28hYrL9e1jM/s400/Prob.bmp" alt="" id="BLOGGER_PHOTO_ID_5367247366086567666" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Execute the same equation      for g of the image.&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Multiply the probability      p(r) and p(g).&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;In non-parametric technique, the 2D color histogram of the ROI is used to tag the membership of the pixels.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;Note that the histogram, when normalized, is equal to the probability distribution function of the color.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;To segment the image using non-parametric technique, the succeeding steps are followed:&lt;/span&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;From the 3D object, crop      the ROI and determine its r and g values.&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Get the 2D chromaticity      histogram of the ROI.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;The sample      code for 2D histogram is provided in the manual&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Segment the images using      backprojection.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;This is done by      first determining the r and g values of the image and finding the position      of each pixel in the histogram.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;       &lt;/span&gt;&lt;span style="font-size:100%;"&gt;After that, get the value of the histogram and use this to replace      the pixel value of the image.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;The following figures show the segmentation of different images using parametric and non-parametric techniques.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/SnzgHMzGoxI/AAAAAAAAAa0/B0SFzmuWb-o/s1600-h/jar.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 235px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/SnzgHMzGoxI/AAAAAAAAAa0/B0SFzmuWb-o/s400/jar.bmp" alt="" id="BLOGGER_PHOTO_ID_5367411270218064658" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Figure 2.  Segmentation of the image using parametric (2nd column) and non-parametric (3rd column) technique.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SnzgGq1VV7I/AAAAAAAAAas/qIIPMpAtJ9U/s1600-h/fwy+compiled.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 289px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SnzgGq1VV7I/AAAAAAAAAas/qIIPMpAtJ9U/s400/fwy+compiled.bmp" alt="" id="BLOGGER_PHOTO_ID_5367411261100611506" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Figure 3.  Segmentation of the images considering different color patch for parametric (2nd column) and non-parametric (3rd) column.  &lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;The results show that the segmentation of the images depend basically on the patch color that we choose and the number of bins of the histogram. The bright colors seen in the reconstruction of the images correspond to the pixels having close values with the pixel of the patch.  As observed from the two technique, the segmentation is better if non-parametric technique is used.  Proper choice of the number of bins yields good segmentation.&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;In this activity, I am giving myself a grade of 10 since the segmentation using the two techniques has been employed and yield desirable results.&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;I would like to thank Jica monsanto and Winsome Rara for helping me debug the code.&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;References:&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;1.  Applied 186 Activity 12 Handout&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;2.  http://blog.howdesign.com/content/binary/fwy.jpg&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;3.  http://images.google.com.ph/imgres?imgurl=http://www.archimuse.com/mw2003/papers/rowe/rowefig1.jpg&amp;amp;imgrefurl=http://www.archimuse.com/mw2003/papers/rowe/rowe.html&amp;amp;usg=__mD2GEzAUoSQ5kK0tr5HFl4xoXpk=&amp;amp;h=288&amp;amp;w=322&amp;amp;sz=43&amp;amp;hl=tl&amp;amp;start=50&amp;amp;sig2=l-1KWXaLREY5nWbYBlEkXA&amp;amp;um=1&amp;amp;tbnid=VsWVB6-IgKvt4M:&amp;amp;tbnh=106&amp;amp;tbnw=118&amp;amp;prev=/images%3Fq%3D3D%2Bobject%2B%252B%2Bball%26ndsp%3D18%26hl%3Dtl%26client%3Dfirefox-a%26rls%3Dorg.mozilla:en-US:official%26sa%3DN%26start%3D36%26um%3D1&amp;amp;ei=mXZ8SuSaGYqYkQXCydyNAw&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8100611507941163067-1432082513963943778?l=jrvitug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jrvitug.blogspot.com/feeds/1432082513963943778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jrvitug.blogspot.com/2009/08/color-image-segmentation.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/1432082513963943778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/1432082513963943778'/><link rel='alternate' type='text/html' href='http://jrvitug.blogspot.com/2009/08/color-image-segmentation.html' title='Color Image Segmentation'/><author><name>Jaziel</name><uri>http://www.blogger.com/profile/04691747960517842787</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_1iO_ypw66RA/Sj8P-fXMj5I/AAAAAAAAABQ/L-wUdz_4OJA/S220/DSC04020.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_1iO_ypw66RA/SnxLC6mWwGI/AAAAAAAAAX8/pcJTtP6uN6g/s72-c/NCC.bmp' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8100611507941163067.post-1648491459552063459</id><published>2009-08-06T10:58:00.000-07:00</published><updated>2009-08-07T11:19:50.966-07:00</updated><title type='text'>Binary Operations</title><content type='html'>&lt;div style="text-align: center;"&gt;  &lt;p style="text-align: justify;"&gt;It is always essential in image processing to specify the region of interest and separate it from the background.&lt;span style=""&gt;  &lt;/span&gt;The ROI is the selected subset of samples within a given dataset [1].&lt;span style=""&gt;  &lt;/span&gt;It is often detached from the background through various techniques.&lt;span style=""&gt;  &lt;/span&gt;One of these is through the use binary operations which necessitate proper thresholding.&lt;span style=""&gt;  &lt;/span&gt;However, in the case of an image with several ROI, further processing is still needed in order to account for the overlap in the graylevel distribution between the ROI and the background.&lt;span style=""&gt;  &lt;/span&gt;This is done by applying the different morphological operations onto the image.&lt;span style=""&gt;  &lt;/span&gt;Practical uses of all these techniques are area estimation of cells and tracking fingerprint ridges.&lt;/p&gt;  &lt;p style="text-align: justify;"&gt;In this activity, all the idea and knowledge learned in image processing are integrated to give a best estimate of the area of cells.&lt;/p&gt;  &lt;p style="text-align: justify;"&gt;The figure below shows the image of scattered punched papers which resemble the cells found in a glass slide.&lt;span style=""&gt;  &lt;/span&gt;The area estimation is done through the following procedures:&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-align: justify; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;The image is cut into 13 256 x 256 pixel overlapping subimages.&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-align: justify; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Plot the histogram of the subimages and give the best approximation of the threshold value.&lt;span style=""&gt;  &lt;/span&gt;For this case, the threshold is found ~0.8.&lt;span style=""&gt;  &lt;/span&gt;This will enable the separation of the ROI from the background.&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-align: justify; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Binarize the subimages using “im2bw” command.&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-align: justify; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;The ROI is enhanced using morphological operations.&lt;span style=""&gt;  &lt;/span&gt;Specifically, the “opening” operator is used since it is defined as the dilation of the erosion of the images.&lt;span style=""&gt;  &lt;/span&gt;This will remove the holes inside the cells, clean the isolated pixels and detach nearly touching cells.&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-align: justify; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Using “bwlabel” command of Scilab, enclosed contiguous blobs on the binary images are labeled.&lt;/p&gt;  &lt;p style="margin-left: 0.5in; text-align: justify; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Calculate the area of each blob.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/SnsfDWG-37I/AAAAAAAAAXM/vQ-dYgr6ZRM/s1600-h/fragmented+image.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 298px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/SnsfDWG-37I/AAAAAAAAAXM/vQ-dYgr6ZRM/s400/fragmented+image.bmp" alt="" id="BLOGGER_PHOTO_ID_5366917523277012914" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1.  Cropped images of the scattered punched papers.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SnsfDP30cUI/AAAAAAAAAXE/xf-B4p8VEFw/s1600-h/opening.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 296px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SnsfDP30cUI/AAAAAAAAAXE/xf-B4p8VEFw/s400/opening.bmp" alt="" id="BLOGGER_PHOTO_ID_5366917521602801986" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.  Enhancement of the images using the "opening" morphological operation.&lt;br /&gt;&lt;div style="text-align: justify;"&gt;By using the "opening " operator, the cells are cleaned up in such a way that holes from the enclosures are removed and partially connected blobs are separated.  Opening operator is chosen over the closing operator because it dilates the eroded cells.  So if there are small interconnections between the cells, the bond is broken and the cells are detached from each other.&lt;br /&gt;Note that this operator is used only after binarizing the images.  Proper threshold value was chosen from the histogram of each subimage.  An example of the histogram is shown below.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/SnxsznCO8yI/AAAAAAAAAZs/qcEwogsLZOw/s1600-h/hist.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 302px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/SnxsznCO8yI/AAAAAAAAAZs/qcEwogsLZOw/s400/hist.bmp" alt="" id="BLOGGER_PHOTO_ID_5367284489826267938" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3.  Histogram of the first subimage (uppermost left image from Fig.2)&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/SnsfDFaZWSI/AAAAAAAAAW8/oLyDyJvGlpo/s1600-h/bwlabel.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 298px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/SnsfDFaZWSI/AAAAAAAAAW8/oLyDyJvGlpo/s400/bwlabel.bmp" alt="" id="BLOGGER_PHOTO_ID_5366917518795036962" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Figure 4.  The corresponding images after using "bwlabel" command.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Once the blobs for each subimages are distinguished, the "bwlabel" command labels each contiguous blob.  The image in Figure 3 shows the variation in the graylevel of each blob.  It is recommended to use true colors in showing the images in order to clearly see how this command works.&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/SnxqWjke-CI/AAAAAAAAAZk/eGOELMyGHwI/s1600-h/hist+10+bins.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 302px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/SnxqWjke-CI/AAAAAAAAAZk/eGOELMyGHwI/s400/hist+10+bins.bmp" alt="" id="BLOGGER_PHOTO_ID_5367281791656720418" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;Figure 5.  Histogram of the cell area measurements&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The histogram plot shown above shows that most of the cell areas for all subimages are in the range of 440-540.  The average area of the whole image based from the subimage is ~491 with a standard deviation of 41.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;In this activity, I give myself a 10 for meeting the objectives.  I would like to thank Winsome Rara for giving useful comments.&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Reference:&lt;span style=""&gt;&lt;br /&gt;1.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;a href="http://en.wikipedia.org/wiki/Region_of_interest"&gt;http://en.wikipedia.org/wiki/Region_of_interest&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8100611507941163067-1648491459552063459?l=jrvitug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jrvitug.blogspot.com/feeds/1648491459552063459/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jrvitug.blogspot.com/2009/08/binary-operations.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/1648491459552063459'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/1648491459552063459'/><link rel='alternate' type='text/html' href='http://jrvitug.blogspot.com/2009/08/binary-operations.html' title='Binary Operations'/><author><name>Jaziel</name><uri>http://www.blogger.com/profile/04691747960517842787</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_1iO_ypw66RA/Sj8P-fXMj5I/AAAAAAAAABQ/L-wUdz_4OJA/S220/DSC04020.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_1iO_ypw66RA/SnsfDWG-37I/AAAAAAAAAXM/vQ-dYgr6ZRM/s72-c/fragmented+image.bmp' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8100611507941163067.post-4428841300823912461</id><published>2009-08-06T05:15:00.000-07:00</published><updated>2009-08-14T03:29:24.890-07:00</updated><title type='text'>Color Image Processing</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;  &lt;/div&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;In image processing, the attainment of a well-adjusted combination of colors is very important.&lt;span style=""&gt;  &lt;/span&gt;The quality of the ensemble of colors that are imaged from the detector depends on generation of the RGB colors which is a product of the spectral power distribution of the illuminant S(λ), reflectance of the surface ρ(λ) and the spectral sensitivity of the camera to red ηR, green ηG, and blue ηB color. &lt;span style=""&gt; &lt;/span&gt;Mathematically, this is expressed as:&lt;/p&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/Snt5yvJc-pI/AAAAAAAAAXU/LE_IomGO3Aw/s1600-h/RGB.bmp"&gt;&lt;img style="cursor: pointer; width: 219px; height: 111px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/Snt5yvJc-pI/AAAAAAAAAXU/LE_IomGO3Aw/s400/RGB.bmp" alt="" id="BLOGGER_PHOTO_ID_5367017293498612370" border="0" /&gt;&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: justify; font-weight: bold; color: rgb(0, 0, 0);" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/Snt5yvJc-pI/AAAAAAAAAXU/LE_IomGO3Aw/s1600-h/RGB.bmp"&gt;where&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt;  &lt;/div&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt;  &lt;/div&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/Snt5yyFUHPI/AAAAAAAAAXc/tR4Q941hLv0/s1600-h/K.bmp"&gt;&lt;img style="cursor: pointer; width: 166px; height: 58px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/Snt5yyFUHPI/AAAAAAAAAXc/tR4Q941hLv0/s400/K.bmp" alt="" id="BLOGGER_PHOTO_ID_5367017294286560498" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;The constant K is the white balancing constant.&lt;span style=""&gt;  &lt;/span&gt;By normalizing this constant, the pixel values of the image are said to be “white balanced” to the light source [1].&lt;/p&gt;&lt;div style="text-align: justify;"&gt;  &lt;/div&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt;  &lt;/div&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;White balance (WB) is the process of removing unrealistic color casts, so that the color of an object is retained when it is photographed.  On of the factors that affect white balancing is the "color temperature" of a light source, which refers to the relative warmth or coolness of white light [2].&lt;span style=""&gt;  &lt;/span&gt;Nowadays, digital cameras have a setting called “auto white balance (AWB)”.&lt;span style=""&gt;  &lt;/span&gt;This function of the camera allows it to adjust its white balance depending on the temperature of the illuminant.&lt;span style=""&gt;  &lt;/span&gt;However, the AWB does not always give the type of image that you want to have.&lt;span style=""&gt;  &lt;/span&gt;&lt;span style=""&gt;AWB does not provide maximum color accuracy and results to a problem when the color of the light is an integral part of the image&lt;/span&gt; [3]. This is why there are other white balancing options in cameras, such as incandescent, fluorescent, daylight, and cloudy.&lt;/p&gt;&lt;div style="text-align: justify;"&gt;  &lt;/div&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt;  &lt;/div&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;Correct white balance can be obtained using two algorithms, the White Patch Algorithm (WPA) and the Gray World Algorithm (GWA).&lt;span style=""&gt;  &lt;/span&gt;In WPA, an unbalanced camera image is captured and the RGB of the known white object is used as the divider.&lt;span style=""&gt;  &lt;/span&gt;On the other hand, GWA assumes that the average color of the world is gray.&lt;span style=""&gt;  &lt;/span&gt;Thus, by knowing the RGB of a gray object, it remains to be the RGB of the white until a constant factor.&lt;span style=""&gt;  &lt;/span&gt;The balancing constants are obtained by averaging the red, green and blue values and utilizing them as the balancing constants [1].&lt;/p&gt;&lt;div style="text-align: justify;"&gt;  &lt;/div&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt;  &lt;/div&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;For this activity, the two algorithms are applied to correct the white balance of the images taken under incandescent, fluorescent, daylight and cloudy illumination conditions.&lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;  &lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;The following images below are incorrectly white balanced.&lt;span style=""&gt;  &lt;/span&gt;The settings of the camera phone are incandescent, fluorescent, daylight and cloudy.&lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;  &lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;After using WPA and GWA, the following images are obtained.&lt;/p&gt;      &lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/SnrJ26a_ZdI/AAAAAAAAAV8/hew6x_JM3Mo/s1600-h/RGB+enhancement.bmp"&gt;&lt;img style="cursor: pointer; width: 424px; height: 237px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/SnrJ26a_ZdI/AAAAAAAAAV8/hew6x_JM3Mo/s400/RGB+enhancement.bmp" alt="" id="BLOGGER_PHOTO_ID_5366823851197949394" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Figure 2.  Processing unbalanced images using White patch and Gray world algorithm.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: justify;"&gt;  &lt;/div&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;In general, it is highly observed that the white balance of the original images has been corrected. The intensities of the colors have been adjusted such that higher image quality is obtained.&lt;span style=""&gt;  &lt;/span&gt;However, from the four different white balance settings, the illumination under a cloudy condition is white balanced in the poorest quality.&lt;span style=""&gt;  &lt;/span&gt;Although the white mat which appears slightly bluish in the original image has been reconstructed, it is still darker and the true white color is not obtained.&lt;span style=""&gt;  &lt;/span&gt;This could be attributed to the choice of the “white patch” and the normalizing constant.&lt;span style=""&gt;  &lt;/span&gt;It is also observed that the reconstructed images using GWA yields darker than the WPA.&lt;span style=""&gt;  &lt;/span&gt;This maybe enhanced by changing the normalizing constants used.&lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;  &lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;The next image shows objects with the same hues taken under incandescent setting.&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/SnrKYwaE47I/AAAAAAAAAWE/ho9JbXqXsVM/s1600-h/different+hues.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 158px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/SnrKYwaE47I/AAAAAAAAAWE/ho9JbXqXsVM/s400/different+hues.bmp" alt="" id="BLOGGER_PHOTO_ID_5366824432625312690" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.  Processing unbalanced image of objects having same hues.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;  &lt;p class="MsoNormal"&gt;Again, it can be seen that the image is enhanced such that the high intensity of blue light dominates the picture is lessened.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Upon doing the reconstruction of the images using WPA, I had some difficulty in choosing the correct white patch in order yield enhanced images.&lt;span style=""&gt;  &lt;/span&gt;This affects the total image quality because the white patch is used as the divider of the RGB colors.&lt;span style=""&gt;  &lt;/span&gt;Based from this, I would say that GWA is better than WPA because using this algorithm, the quality of the reconstructed image depends on the average of the R, G, and B.&lt;span style=""&gt;  &lt;/span&gt;The values can be modify such that if the quotient of the image layer over the RGB averages is greater than 1, we can set this value to 1 (For attainment of normalized values).&lt;/p&gt;  &lt;p class="MsoNormal"&gt;For this activity, I give myself a grade of 10 since all the objectives are met.&lt;span style=""&gt;  &lt;/span&gt;I would like to thank Jica Monsanto for capturing some of the images while I arrange the object to be photographed and Mr. Combinido for commenting on my code.&lt;span style=""&gt;  &lt;/span&gt;Thanks guys!&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;References:&lt;/p&gt;&lt;p class="MsoNormal"&gt;1.  Color Image Processing, Applied Physics 186 Handout.&lt;/p&gt;&lt;p class="MsoNormal"&gt;2.  http://www.cambridgeincolour.com/tutorials/white-balance.htm&lt;/p&gt;&lt;p class="MsoNormal"&gt;3.  http://www.ronbigelow.com/articles/white/white_balance.htm&lt;br /&gt;&lt;/p&gt;  &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8100611507941163067-4428841300823912461?l=jrvitug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jrvitug.blogspot.com/feeds/4428841300823912461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jrvitug.blogspot.com/2009/08/color-image-processing.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/4428841300823912461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/4428841300823912461'/><link rel='alternate' type='text/html' href='http://jrvitug.blogspot.com/2009/08/color-image-processing.html' title='Color Image Processing'/><author><name>Jaziel</name><uri>http://www.blogger.com/profile/04691747960517842787</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_1iO_ypw66RA/Sj8P-fXMj5I/AAAAAAAAABQ/L-wUdz_4OJA/S220/DSC04020.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_1iO_ypw66RA/Snt5yvJc-pI/AAAAAAAAAXU/LE_IomGO3Aw/s72-c/RGB.bmp' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8100611507941163067.post-6881763551741316866</id><published>2009-08-06T04:36:00.000-07:00</published><updated>2009-08-06T10:54:44.898-07:00</updated><title type='text'>Morphological Operation</title><content type='html'>&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:100%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SnrDh4rmqKI/AAAAAAAAAUk/PEOFH8PiI8U/s1600-h/circle+dilation.bmp"&gt;&lt;span style="display: block;" id="formatbar_Buttons"&gt;&lt;span class="on" style="display: block;" id="formatbar_JustifyCenter" title="Align Center" onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmouseup="" onmousedown="CheckFormatting(event);FormatbarButton('richeditorframe', this, 11);ButtonMouseDown(this);"&gt;&lt;img src="http://www.blogger.com/img/blank.gif" alt="Align Center" class="gl_align_center" border="0" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;In image processing, it is very important to get a full detail of the image.&lt;/span&gt;&lt;span style=";font-size:100%;" &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;In some cases such as normalization of images and eye feature extraction, morphological operations are very essential [1].&lt;/span&gt;&lt;span style=";font-size:100%;" &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;Morphology refers to the form, structure, shape, size, texture, and phase distribution of objects and images [2]. &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Since an image could be defined as an amplitude function consisting of a collection of either continuous or discrete coordinates [3], it contains pixels that are needed to be distinguished from the background.&lt;/span&gt;&lt;span style=";font-size:100%;" &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;These pixels which occupy the region of interest can be separated using different morphological operations such as erosion and dilation.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;/p&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;  &lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Dilation of an A by B is denoted as:&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SnsNwlWClOI/AAAAAAAAAWM/H2VF4Qx7UC4/s1600-h/dilation.bmp"&gt;&lt;img style="cursor: pointer; width: 302px; height: 52px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SnsNwlWClOI/AAAAAAAAAWM/H2VF4Qx7UC4/s400/dilation.bmp" alt="" id="BLOGGER_PHOTO_ID_5366898509251515618" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;which involves all z’s which are translations of reflected B, that when intersected with A is not the empty set.&lt;/span&gt;&lt;span style=";font-size:100%;" &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;B is called the structuring element.&lt;/span&gt;&lt;span style=";font-size:100%;" &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;In general, dilation causes an object to expand or elongate following the shape of the structuring element.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;On the other hand, erosion is defined as:&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-align: center;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SnsNwl5Ox7I/AAAAAAAAAWU/b2TNQ1nemP4/s1600-h/erosion.bmp"&gt;&lt;img style="cursor: pointer; width: 203px; height: 49px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SnsNwl5Ox7I/AAAAAAAAAWU/b2TNQ1nemP4/s400/erosion.bmp" alt="" id="BLOGGER_PHOTO_ID_5366898509399115698" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;which involved all z’s such that B translated by z is contained in A.&lt;/span&gt;&lt;span style=";font-size:100%;" &gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;The general effect of erosion is to shrink or reduce the image by the shape of the structuring element B [4]. &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:100%;"  &gt;In this activity, dilation and erosion are performed to different binary images, namely  a square (50×50) , a triangle (base = 50 , height = 30), a circle (radius 25), a hollow square (60×60, edges are 4 pixels thick), and a plus sign (8 pixels thick and 50 pixels long for each line).&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;The different structuring elements used are shown below.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/SnsPWsfJ3NI/AAAAAAAAAW0/IMiiDuD6w3w/s1600-h/4+ones.bmp"&gt;&lt;img style="cursor: pointer; width: 154px; height: 120px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/SnsPWsfJ3NI/AAAAAAAAAW0/IMiiDuD6w3w/s400/4+ones.bmp" alt="" id="BLOGGER_PHOTO_ID_5366900263515446482" border="0" /&gt;&lt;/a&gt;      &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SnsPWowuEnI/AAAAAAAAAWs/bhIkIbTCGE4/s1600-h/2+by+4.bmp"&gt;&lt;img style="cursor: pointer; width: 139px; height: 84px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SnsPWowuEnI/AAAAAAAAAWs/bhIkIbTCGE4/s400/2+by+4.bmp" alt="" id="BLOGGER_PHOTO_ID_5366900262515380850" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/SnsPWQ6GNpI/AAAAAAAAAWk/45xmhXda2Xc/s1600-h/4+by+2.bmp"&gt;&lt;img style="cursor: pointer; width: 86px; height: 126px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/SnsPWQ6GNpI/AAAAAAAAAWk/45xmhXda2Xc/s400/4+by+2.bmp" alt="" id="BLOGGER_PHOTO_ID_5366900256112260754" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/SnsPWAvvVPI/AAAAAAAAAWc/VZa5qVQcO48/s1600-h/cross+se.bmp"&gt;&lt;img style="cursor: pointer; width: 143px; height: 126px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/SnsPWAvvVPI/AAAAAAAAAWc/VZa5qVQcO48/s400/cross+se.bmp" alt="" id="BLOGGER_PHOTO_ID_5366900251773850866" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:100%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: &amp;quot;Helvetica&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;The succeeding figures shows what happen after  eroding and dilating  the  images with  the structure elements.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;          &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:100%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SnrDh4rmqKI/AAAAAAAAAUk/PEOFH8PiI8U/s1600-h/circle+dilation.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 88px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SnrDh4rmqKI/AAAAAAAAAUk/PEOFH8PiI8U/s400/circle+dilation.bmp" alt="" id="BLOGGER_PHOTO_ID_5366816892883740834" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size:100%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/SnrFYVkOL5I/AAAAAAAAAUs/MQcNqLPWZVs/s1600-h/circle+erosion.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 88px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/SnrFYVkOL5I/AAAAAAAAAUs/MQcNqLPWZVs/s400/circle+erosion.bmp" alt="" id="BLOGGER_PHOTO_ID_5366818927861968786" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:100%;"&gt;Figure 1.  Dilation (first row) and erosion (second row) of the circle.  The first  image of each row shows the original image.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SnrGJVssX3I/AAAAAAAAAU0/qDywAcGan5E/s1600-h/square+dilation.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 78px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SnrGJVssX3I/AAAAAAAAAU0/qDywAcGan5E/s400/square+dilation.bmp" alt="" id="BLOGGER_PHOTO_ID_5366819769711091570" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/SnrGdZ1KhTI/AAAAAAAAAU8/s5ppIpD-e4Y/s1600-h/square+erosion.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 72px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/SnrGdZ1KhTI/AAAAAAAAAU8/s5ppIpD-e4Y/s400/square+erosion.bmp" alt="" id="BLOGGER_PHOTO_ID_5366820114417747250" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2. Dilation (first row) and erosion (second row) of the square.  The first image of each row shows the original image.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/SnrG5OEKbxI/AAAAAAAAAVE/U-WaQIJ5mDk/s1600-h/triangle+dilation.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 33px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/SnrG5OEKbxI/AAAAAAAAAVE/U-WaQIJ5mDk/s400/triangle+dilation.bmp" alt="" id="BLOGGER_PHOTO_ID_5366820592295767826" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/SnrHNoZWErI/AAAAAAAAAVM/60ANdztweTU/s1600-h/triangle+erosion.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 34px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/SnrHNoZWErI/AAAAAAAAAVM/60ANdztweTU/s400/triangle+erosion.bmp" alt="" id="BLOGGER_PHOTO_ID_5366820942961316530" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3.  Dilation (first row) and erosion (second row) of the triangle.  The first image of each row shows the original image.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SnrHmGjpwgI/AAAAAAAAAVU/B9ckIcyp6OE/s1600-h/hollow+dilation.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 78px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SnrHmGjpwgI/AAAAAAAAAVU/B9ckIcyp6OE/s400/hollow+dilation.bmp" alt="" id="BLOGGER_PHOTO_ID_5366821363374473730" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/SnrH48KMAuI/AAAAAAAAAVc/l6L3tfAabS4/s1600-h/hollow+erosion.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 77px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/SnrH48KMAuI/AAAAAAAAAVc/l6L3tfAabS4/s400/hollow+erosion.bmp" alt="" id="BLOGGER_PHOTO_ID_5366821687000826594" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 4.  Dilation (first row) and erosion (second row) of the hollow square.  The first image of  each row shows the original image.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/SnrIPuPlRjI/AAAAAAAAAVk/UpvoopU-xZU/s1600-h/cross+dilation.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 77px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/SnrIPuPlRjI/AAAAAAAAAVk/UpvoopU-xZU/s400/cross+dilation.bmp" alt="" id="BLOGGER_PHOTO_ID_5366822078402348594" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SnrIaQtMFpI/AAAAAAAAAVs/yzQ58fEhe5w/s1600-h/cross+erosion.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 77px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SnrIaQtMFpI/AAAAAAAAAVs/yzQ58fEhe5w/s400/cross+erosion.bmp" alt="" id="BLOGGER_PHOTO_ID_5366822259452024466" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 5.  Dilation (first row) and erosion (second row) of the cross.  The first image of  each row shows the original image.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: justify;"&gt;It can be observed from the figures above that the statement regarding the general effect of dilation and erosion has been satisfied.  For the case of dilation, the image expands depending on the structuring element used.  The dilation using 4 x 4 square matrix of one as the structuring element results to the uniform expansion of the image (white color) in all sides.  However, using a 2 x 4 and 4 x 2 ones yields to the enlargement of the image in the vertical and horizontal sides, respectively.  Finally, using the cross as the structuring element results to the expansion of the image in all sides except at the corners.&lt;br /&gt;&lt;br /&gt;For the case of erosion, the same thing happen, only that instead of expansion or the addition of pixels, shrinking or elimination of some pixels in the sides of the images occurs.  Taking a look at the effect of erosion on the hollow square, it is noticed that the 2 x 4 matrix structuring element reduces the number of pixels in the left and right side of the image, while the 4 x 2 structuring element shrinks the top and bottom side.  Also, it is interesting to note that only the four pixels at the corners of the hollow square remains after eroding it to the cross structuring element.&lt;br /&gt;&lt;br /&gt;My predictions for the new images yielded after applying erosion and dilation using the four structuring elements above are correct only for the part of the dilation of the images using the first three structuring elements.  I had a hard time imagining for the output of the dilation and erosion of the images using the cross as the structuring element. &lt;br /&gt;&lt;br /&gt;After exploring and applying the "skel" function from Scilab in the five images, I arrived at the following outputs below.&lt;br /&gt;&lt;/div&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/SnrIpoUibfI/AAAAAAAAAV0/5Kqv0QnYh-M/s1600-h/skel.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 73px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/SnrIpoUibfI/AAAAAAAAAV0/5Kqv0QnYh-M/s400/skel.bmp" alt="" id="BLOGGER_PHOTO_ID_5366822523489119730" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 6.  Resulting images after applying "skel" function.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: justify;"&gt;For this activity, I give myself a grade of 9 because I failed to predict the dilation and erosion of the the images using the cross as the structuring elements.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:100%;"&gt;References:&lt;br /&gt;1.  http://www.ph.tn.tudelft.nl/Courses/FIP/noframes/fip-Techniqu.html&lt;br /&gt;2.  &lt;span style="font-size: 12pt; font-family: &amp;quot;Helvetica&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;http://en.wikipedia.org/wiki/Morphology&lt;br /&gt;3.  &lt;/span&gt;http://inperc.com/wiki/index.php?title=Special:Whatlinkshere/Dilation_and_erosion&lt;br /&gt;4.  &lt;span style="font-size: 12pt; font-family: &amp;quot;Helvetica&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;“Morphological operations”, Applied Physics 186 Activity 8 Manual.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8100611507941163067-6881763551741316866?l=jrvitug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jrvitug.blogspot.com/feeds/6881763551741316866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jrvitug.blogspot.com/2009/08/morphological-operation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/6881763551741316866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/6881763551741316866'/><link rel='alternate' type='text/html' href='http://jrvitug.blogspot.com/2009/08/morphological-operation.html' title='Morphological Operation'/><author><name>Jaziel</name><uri>http://www.blogger.com/profile/04691747960517842787</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_1iO_ypw66RA/Sj8P-fXMj5I/AAAAAAAAABQ/L-wUdz_4OJA/S220/DSC04020.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_1iO_ypw66RA/SnsNwlWClOI/AAAAAAAAAWM/H2VF4Qx7UC4/s72-c/dilation.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8100611507941163067.post-5995025992258073859</id><published>2009-07-23T09:57:00.001-07:00</published><updated>2009-08-07T19:45:58.996-07:00</updated><title type='text'>Enhancement in the Frequency Domain</title><content type='html'>&lt;div style="text-align: justify;"&gt;Image enhancement is any digital process which aims to improve the quality of images by adjusting the contrast, brightness, sharpness, boundaries and edges [1].&lt;span style=""&gt;  &lt;/span&gt;One of the techniques used to enhance the visual qualities of images is by filtering out unwanted frequencies. This is done through the use of a mask.&lt;span style=""&gt;  &lt;/span&gt;A mask is a small square window of values by which the current pixel and its neighbor are weighted to produce and output pixel [1].  &lt;/div&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SmiW2m5lg5I/AAAAAAAAASI/vap-z1jlwqY/s1600-h/dots.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 152px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SmiW2m5lg5I/AAAAAAAAASI/vap-z1jlwqY/s400/dots.bmp" alt="" id="BLOGGER_PHOTO_ID_5361701221283758994" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;Figure 1.  FT of  two dots.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;The image above shows that the modulus of the Fourier transform (FT) of a pair of dots is a sinusoid with frequency that depends on the separation of the dots.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SmiW2i0t63I/AAAAAAAAASQ/k0XSSekkNTk/s1600-h/circles.bmp"&gt;&lt;img style="cursor: pointer; width: 220px; height: 400px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SmiW2i0t63I/AAAAAAAAASQ/k0XSSekkNTk/s400/circles.bmp" alt="" id="BLOGGER_PHOTO_ID_5361701220189596530" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;Figure2. FT of circles with varying radius.&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;It can be seen that the FT of two circles is an airy disk that increases in radius as the radius of the original image decreases.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/SmiYw8Hm3MI/AAAAAAAAASY/xtMaTR7keBE/s1600-h/square.bmp"&gt;&lt;img style="cursor: pointer; width: 277px; height: 400px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/SmiYw8Hm3MI/AAAAAAAAASY/xtMaTR7keBE/s400/square.bmp" alt="" id="BLOGGER_PHOTO_ID_5361703322923752642" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size:78%;"&gt;Figure 3. FT of two squares with varying dimension&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: justify;"&gt;  &lt;/div&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;The modulus of the FT of the two squares is shown above.&lt;span style=""&gt;  &lt;/span&gt;It can be noticed that as the dimension of the original image increases, the dimension of the corresponding modulus of the FT decreases.&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/SmiZw7idkJI/AAAAAAAAASg/xDbMOLkn7JE/s1600-h/gaussian.bmp"&gt;&lt;img style="cursor: pointer; width: 233px; height: 400px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/SmiZw7idkJI/AAAAAAAAASg/xDbMOLkn7JE/s400/gaussian.bmp" alt="" id="BLOGGER_PHOTO_ID_5361704422279581842" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;&lt;span style="font-size:78%;"&gt;Figure 4. FT of Gaussian with varying variance.&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;Notice from Figure 4 that the FT of Gaussian is also Gaussian.  However, increasing the variance which broadens the Gaussian image results to the narrowing of the FT.&lt;/p&gt;&lt;p style="text-align: center;" class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/Smib053WHFI/AAAAAAAAAS4/heijD9cuk4Q/s1600-h/real+and+imag+of+gaussian+FT.bmp"&gt;&lt;img style="cursor: pointer; width: 357px; height: 400px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/Smib053WHFI/AAAAAAAAAS4/heijD9cuk4Q/s400/real+and+imag+of+gaussian+FT.bmp" alt="" id="BLOGGER_PHOTO_ID_5361706689573035090" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;Figure 5. Real (left) and imaginary (right) part of the FT of Gaussian image for different variances&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/SmibhdA9GBI/AAAAAAAAASw/pG_BsS3SUXE/s1600-h/inverted+gaussian.bmp"&gt;&lt;img style="cursor: pointer; width: 337px; height: 400px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/SmibhdA9GBI/AAAAAAAAASw/pG_BsS3SUXE/s400/inverted+gaussian.bmp" alt="" id="BLOGGER_PHOTO_ID_5361706355411195922" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;Figure 6. Real (left) and imaginary (right) part of the inverted Gaussian for different variances.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/Smibg2paT7I/AAAAAAAAASo/omd5ZJNyFAI/s1600-h/fingerprint.bmp"&gt;&lt;img style="cursor: pointer; width: 258px; height: 400px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/Smibg2paT7I/AAAAAAAAASo/omd5ZJNyFAI/s400/fingerprint.bmp" alt="" id="BLOGGER_PHOTO_ID_5361706345111900082" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size:78%;"&gt;Figure 7. Fingerprint enhancement [2]. Clockwise direction from top left: original image, FT modulus of the image, designed filter mask, enhanced fingerprint image.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/SmieMs2ueNI/AAAAAAAAATQ/1JuWANsXW3E/s1600-h/lunar.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 294px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/SmieMs2ueNI/AAAAAAAAATQ/1JuWANsXW3E/s400/lunar.bmp" alt="" id="BLOGGER_PHOTO_ID_5361709297420892370" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;Figure 8. Line removal from the lunar landing scanned image. Clockwise direction from top left: original image, FT modulus of the image, designed filter mask, enhanced lunar landing  image.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/SmieMXBr2tI/AAAAAAAAATI/kmC2-NMTqtg/s1600-h/canvas.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 289px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/SmieMXBr2tI/AAAAAAAAATI/kmC2-NMTqtg/s400/canvas.bmp" alt="" id="BLOGGER_PHOTO_ID_5361709291561278162" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;Figure 9. Canvas weave modeling. Clockwise direction from top left: grayscale of the original image, FT modulus of the image, designed filter mask, enhanced image.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/SmieL6PmNBI/AAAAAAAAATA/zIrlc8UBLX8/s1600-h/canvas+with+inverted+mask.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 286px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/SmieL6PmNBI/AAAAAAAAATA/zIrlc8UBLX8/s400/canvas+with+inverted+mask.bmp" alt="" id="BLOGGER_PHOTO_ID_5361709283834999826" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;Figure 10. Canvas weave modeling and removal. Clockwise direction from top left: grayscale of the original image, designed filter mask, inverted grayscale of the filter mask, inverse FT of the image after using the inverted grayscale filter mask.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: justify;"&gt;The figures above shows how the enhancement of different images are performed using different kinds of filters.  If vertical and horizontal lines are wanted to be eliminated, the horizontal and vetical white lines in the Fourier transform of the images are erased, respectively.  To remove the weave patterns, white dots in the FT of the images are erased, except of course the central bright spot.  After performing inverse FT and observing the modulus of the canvas in Figure 10, it is seen that generated image is close in appearance with the original image.&lt;br /&gt;&lt;br /&gt;In this activity, I give myself a grade of 10 since all the objectives regarding filtering have been done correctly.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;References:&lt;br /&gt;1.K. S. Thyagarajan, Digital image processing with application to digital cinema, Focal press.&lt;br /&gt;2. finger print:  http://www.wolfendales.com/f06/images/finger%20print%20background.jpg&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8100611507941163067-5995025992258073859?l=jrvitug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jrvitug.blogspot.com/feeds/5995025992258073859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jrvitug.blogspot.com/2009/07/enhancement-in-frequency-domain.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/5995025992258073859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/5995025992258073859'/><link rel='alternate' type='text/html' href='http://jrvitug.blogspot.com/2009/07/enhancement-in-frequency-domain.html' title='Enhancement in the Frequency Domain'/><author><name>Jaziel</name><uri>http://www.blogger.com/profile/04691747960517842787</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_1iO_ypw66RA/Sj8P-fXMj5I/AAAAAAAAABQ/L-wUdz_4OJA/S220/DSC04020.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_1iO_ypw66RA/SmiW2m5lg5I/AAAAAAAAASI/vap-z1jlwqY/s72-c/dots.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8100611507941163067.post-4468780168442135236</id><published>2009-07-08T23:46:00.000-07:00</published><updated>2009-08-07T19:48:58.034-07:00</updated><title type='text'>Properties of the 2D Fourier Transform</title><content type='html'>&lt;div style="text-align: justify;"&gt;The Fourier Transform of the different 2D images were taken and the results are shown in the figures below.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/SldL57fCsrI/AAAAAAAAAQY/Yq9rYmYILOY/s1600-h/FT.bmp"&gt;&lt;img style="cursor: pointer; width: 421px; height: 205px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/SldL57fCsrI/AAAAAAAAAQY/Yq9rYmYILOY/s320/FT.bmp" alt="" id="BLOGGER_PHOTO_ID_5356833740373013170" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The next figures show the images of the sinusoid with various frequencies.  It is highly seen that as the frequency of the sinusoid is increased, the distance between the two points corresponding to the frequency in the Fourier domain also increases.  The  points represent the transformation of the continuous signal to discrete signals upon undergoing Fourier Transform.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/SldMRUkmnhI/AAAAAAAAAQg/Wz22iJwiz3o/s1600-h/FT2.bmp"&gt;&lt;img style="cursor: pointer; width: 390px; height: 158px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/SldMRUkmnhI/AAAAAAAAAQg/Wz22iJwiz3o/s400/FT2.bmp" alt="" id="BLOGGER_PHOTO_ID_5356834142244216338" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;When a constant bias is added to the sinusoid, another peak located at the center between the two points. This is similar to a dirac-delta function centered at the middle of the two mirror imaged frequencies. In order to determine the peak frequencies, the 3D plot is performed.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/SldMp8BqIAI/AAAAAAAAAQo/xgdzt1jtaIU/s1600-h/FT3.bmp"&gt;&lt;img style="cursor: pointer; width: 270px; height: 400px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/SldMp8BqIAI/AAAAAAAAAQo/xgdzt1jtaIU/s400/FT3.bmp" alt="" id="BLOGGER_PHOTO_ID_5356834565151924226" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The result of the Fourier Transform of the additional non-constant bias to the sinusoid is the appearance of other peaks that are located at the frequency values of the bias.  Note that for every frequency, there are two peaks found because the Fourier transform consists of complex numbers, so the absolute value is taken.  Thus, the negative and positive values are considered.&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SldNCuFqItI/AAAAAAAAAQw/OMNc4OnlKQ8/s1600-h/FT4.bmp"&gt;&lt;img style="cursor: pointer; width: 381px; height: 400px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SldNCuFqItI/AAAAAAAAAQw/OMNc4OnlKQ8/s400/FT4.bmp" alt="" id="BLOGGER_PHOTO_ID_5356834990907335378" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;When the sinusoid is rotated, the corresponding Fourier transformed image is also rotated, the angle of which depends on the rotation angle of the input.  This is observed from the figures below.&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SldNui8aKbI/AAAAAAAAAQ4/UO0meIubRUw/s1600-h/FT5.bmp"&gt;&lt;img style="cursor: pointer; width: 223px; height: 204px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SldNui8aKbI/AAAAAAAAAQ4/UO0meIubRUw/s400/FT5.bmp" alt="" id="BLOGGER_PHOTO_ID_5356835743829993906" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The next two figures are the image of the Fourier transform (right) of the product of two sinusoid running in X and Y axes.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/SldXYmyvowI/AAAAAAAAARQ/bnFkGQWrL80/s1600-h/corrugatedf4.30deg.bmp"&gt;&lt;img style="cursor: pointer; width: 107px; height: 107px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/SldXYmyvowI/AAAAAAAAARQ/bnFkGQWrL80/s400/corrugatedf4.30deg.bmp" alt="" id="BLOGGER_PHOTO_ID_5356846362022355714" border="0" /&gt;&lt;/a&gt;  &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/SldXX6d4L3I/AAAAAAAAARI/m7e9ZJriSMM/s1600-h/xorrugeted+fourier.bmp"&gt;&lt;img style="cursor: pointer; width: 107px; height: 107px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/SldXX6d4L3I/AAAAAAAAARI/m7e9ZJriSMM/s400/xorrugeted+fourier.bmp" alt="" id="BLOGGER_PHOTO_ID_5356846350123675506" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The last four figures correspond to the addition of a non-constant bias at different rotation angles to the product of the two sinusoids above.  The bias used in the first two images is a sinusoid with frequency F=20 and rotated to theta=60 degrees.  The last two shows the image of the input sinusoid biased with another sinusoid at F=18 and theta=90degrees.  It was predicted that another two points will appear on the FT and these are rotated in angles equal to the rotation angle used.&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SldODf5D0dI/AAAAAAAAARA/FbQZ2Wh7YQU/s1600-h/FT6.bmp"&gt;&lt;img style="cursor: pointer; width: 230px; height: 189px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SldODf5D0dI/AAAAAAAAARA/FbQZ2Wh7YQU/s400/FT6.bmp" alt="" id="BLOGGER_PHOTO_ID_5356836103787893202" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;br /&gt;In this activity, I am giving myself a grade of 10 since all the tasks are completed and with desirable and correct results.&lt;br /&gt;&lt;br /&gt;I would like to thank Gary Garcia and Winsome Rara for helping me improve my images.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8100611507941163067-4468780168442135236?l=jrvitug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jrvitug.blogspot.com/feeds/4468780168442135236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jrvitug.blogspot.com/2009/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/8100611507941163067/posts/default/4468780168442135236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/4468780168442135236'/><link rel='alternate' type='text/html' href='http://jrvitug.blogspot.com/2009/07/properties-of-2d-fourier-transform.html' title='Properties of the 2D Fourier Transform'/><author><name>Jaziel</name><uri>http://www.blogger.com/profile/04691747960517842787</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_1iO_ypw66RA/Sj8P-fXMj5I/AAAAAAAAABQ/L-wUdz_4OJA/S220/DSC04020.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_1iO_ypw66RA/SldL57fCsrI/AAAAAAAAAQY/Yq9rYmYILOY/s72-c/FT.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8100611507941163067.post-6201541694651662777</id><published>2009-07-07T05:42:00.001-07:00</published><updated>2009-08-07T18:49:34.628-07:00</updated><title type='text'>Fourier Transform Model of Image Formation</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;div style="text-align: justify;"&gt;Fourier Transform (FT) is the transformation of any input signal found in spatial domain into its frequency domain (1).  For images, FT is used to decompose the each point into its corresponding sine or cosine components .  However, images do not fully show all the frequencies composing the images.  Thus, this activity is limited to the discrete Fourier Transform which shows limited number of frequencies but are enough to depict the spatial domain of the image.&lt;br /&gt;&lt;br /&gt;In this activity, the Fourier Transform of different images are taken.  Moreover, the properties and extension of Fourier Transform such as convolution and correlation are implemented.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/Slfh5n39eDI/AAAAAAAAARY/Tj2VyZNrul0/s1600-h/circle.bmp"&gt;&lt;img style="cursor: pointer; width: 415px; height: 158px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/Slfh5n39eDI/AAAAAAAAARY/Tj2VyZNrul0/s400/circle.bmp" alt="" id="BLOGGER_PHOTO_ID_5356998661852985394" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The figures above describe the transformation of the original image (first image) as it undergoes FFT2 and FFTSHIFT.  The third picture represents the Fourier transformed image which is a central bright spot.  This agrees with the ideal Fourier transformation of circle. Applying another fourier transformation to the previously transformed image inverts the image with respect to the horizontal axis.&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SlfiNeqjdNI/AAAAAAAAARg/Vo6IZOSE1dk/s1600-h/A.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 144px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SlfiNeqjdNI/AAAAAAAAARg/Vo6IZOSE1dk/s400/A.bmp" alt="" id="BLOGGER_PHOTO_ID_5356999002978219218" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Applying the same procedure to letter "A", I arrived at the figures above.  The inversion of "A" is still experience upon the application of another Fourier transform as shown in the last figure above.  The star-like spread of light in the image just above the last image shows the fftshift of "A".&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/SlfifLhSVzI/AAAAAAAAARo/hfTvcrxQY4U/s1600-h/fig2.bmp"&gt;&lt;img style="cursor: pointer; width: 253px; height: 484px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/SlfifLhSVzI/AAAAAAAAARo/hfTvcrxQY4U/s400/fig2.bmp" alt="" id="BLOGGER_PHOTO_ID_5356999307076720434" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The figure above shows the effect of the size of the aperture to the quality of the image.  Notice that as the aperture gets larger, the image's resolution becomes better.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/SnzZlCMy1VI/AAAAAAAAAaE/KV01rtmJ4M0/s1600-h/fig3.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 132px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/SnzZlCMy1VI/AAAAAAAAAaE/KV01rtmJ4M0/s400/fig3.bmp" alt="" id="BLOGGER_PHOTO_ID_5367404086187709778" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;For the images above, it can be seen that the sentence "The rain in Spain stays mainly in the plain" correlates with the letter "A" by producing more intense light in the part of the sentence which contains "A".&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/SlfjD3FQc-I/AAAAAAAAAR4/ZmPSCpVQCj0/s1600-h/fig4.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 155px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/SlfjD3FQc-I/AAAAAAAAAR4/ZmPSCpVQCj0/s400/fig4.bmp" alt="" id="BLOGGER_PHOTO_ID_5356999937245606882" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The Last three figures shows the corresponding image produced when an image pattern with a sum of zero is convolved with another image. It can be observed that some parts of the word "VIP" are lost depending on the location of the zeroed-sum in the matrix. The figures also show that the spot pattern gives out the best image quality among the three matrix patterns.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;I would like to thank Master and Jaya for reminding me of the deadline of this activity as well as Gary and Rara for giving suggestions on improving my blog.&lt;br /&gt;&lt;br /&gt;For this activity, I am giving myself a grade of 9.  I was not able to attend the class and I finished the activity in a later time.&lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;1.  http://homepages.inf.ed.ac.uk/rbf/HIPR2/fourier.htm&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8100611507941163067-6201541694651662777?l=jrvitug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jrvitug.blogspot.com/feeds/6201541694651662777/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jrvitug.blogspot.com/2009/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/8100611507941163067/posts/default/6201541694651662777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/6201541694651662777'/><link rel='alternate' type='text/html' href='http://jrvitug.blogspot.com/2009/07/fourier-transform-model-of-image.html' title='Fourier Transform Model of Image Formation'/><author><name>Jaziel</name><uri>http://www.blogger.com/profile/04691747960517842787</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_1iO_ypw66RA/Sj8P-fXMj5I/AAAAAAAAABQ/L-wUdz_4OJA/S220/DSC04020.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_1iO_ypw66RA/Slfh5n39eDI/AAAAAAAAARY/Tj2VyZNrul0/s72-c/circle.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8100611507941163067.post-8511950524508561973</id><published>2009-07-01T06:51:00.001-07:00</published><updated>2009-07-11T00:34:05.728-07:00</updated><title type='text'>Enhancement by histogram manipulation</title><content type='html'>&lt;div style="text-align: justify;"&gt;Not all images we capture have perfect contrast!... This is basically the motivation of this activity.  Several techniques have been implemented in order to enhance images qualities.  One of these is through histogram manipulation.&lt;br /&gt;Histogram shows the pixel number in the image, each having one of the 256 possible values (1).  The brightness of the images is shown in the histogram through the peaks in each pixel number. Histograms are manipulated by equalizing the distribution of the pixel numbers of the image.  New brightness values are reassigned in the image's pixel numbers but the relationship among the pixel numbers are retained, that is, the pixels darker than other pixels still appear darker.&lt;br /&gt;&lt;br /&gt;For this activity...&lt;br /&gt;&lt;br /&gt;First thing I did: Find a grayscale image in the web.  The chosen image is shown in Figure 1.&lt;br /&gt;Reference:                                                                                                       &lt;br /&gt;http://images.google.com.ph/imgres?imgurl=http://www.atpm.com/13.02/images/ps-grayscale-4.jpg&amp;amp;imgrefurl=http://www.atpm.com/13.02/photoshop.shtml&amp;amp;usg=__ToqI_jVS80Y4k_ezF1QCq2TI03k=&amp;amp;h=280&amp;amp;w=420&amp;amp;sz=44&amp;amp;hl=tl&amp;amp;start=116&amp;amp;sig2=JetPq2CRGpzxKvLgJe0AMg&amp;amp;um=1&amp;amp;tbnid=lpf4uDD45kW5kM:&amp;amp;tbnh=83&amp;amp;tbnw=125&amp;amp;prev=/images%3Fq%3Dgrayscale%252Bblur%2Bimage%26ndsp%3D20%26hl%3Dtl%26client%3Dfirefox-a%26rls%3Dorg.mozilla:en-US:official%26sa%3DN%26start%3D100%26um%3D1&amp;amp;ei=pWFJSqCEF4_6kAXB67TwCQ&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/Sktp8-yrSRI/AAAAAAAAAEI/EnlWqopXkgQ/s1600-h/act4+picture.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 304px; height: 201px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/Sktp8-yrSRI/AAAAAAAAAEI/EnlWqopXkgQ/s320/act4+picture.jpg" alt="" id="BLOGGER_PHOTO_ID_5353489078428584210" border="0" /&gt;&lt;span style="display: block;" id="formatbar_Buttons"&gt;&lt;span class="on" style="display: block;" id="formatbar_JustifyFull" title="Justify Full" onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmouseup="" onmousedown="CheckFormatting(event);FormatbarButton('richeditorframe', this, 13);ButtonMouseDown(this);"&gt;&lt;img src="http://www.blogger.com/img/blank.gif" alt="Justify Full" class="gl_align_full" border="0" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;Figure 1. Original image&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;My main goal in this activity is to enhance the image above. To achieve this, I used Scilab and find the histogram of the image, the normalized probability distribution function (PDF) of the graylevel.  Then, the PDF of the image is taken by simply dividing the frequencies by the total number of pixels of the image.  The cumulative sum of the PDF is the Cumulative Distribution Function (CDF).  Figures 2 and 3 show the histogram and CDF of the image, respectively.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SktxAtC6t5I/AAAAAAAAAEg/eP1b9zE_39I/s1600-h/hist.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 242px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SktxAtC6t5I/AAAAAAAAAEg/eP1b9zE_39I/s320/hist.bmp" alt="" id="BLOGGER_PHOTO_ID_5353496838965737362" border="0" /&gt;&lt;/a&gt;Figure 2. Histogram of the image&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SktxVYVP4SI/AAAAAAAAAEo/OL7XmHmUJeA/s1600-h/cdf.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 242px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SktxVYVP4SI/AAAAAAAAAEo/OL7XmHmUJeA/s320/cdf.bmp" alt="" id="BLOGGER_PHOTO_ID_5353497194182730018" border="0" /&gt;&lt;/a&gt;Figure 3. CDF of the image&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Each graylevel has a corresponding PDF value.  In order to enhance the image, I created a desired CDF.  In my case, I used the equation of a straight line.  The figure below is my desired CDF.&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/Sktyj-TPT_I/AAAAAAAAAEw/JSIMLD83E14/s1600-h/line.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 242px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/Sktyj-TPT_I/AAAAAAAAAEw/JSIMLD83E14/s320/line.bmp" alt="" id="BLOGGER_PHOTO_ID_5353498544404647922" border="0" /&gt;&lt;/a&gt;Figure 4. Desired CDF&lt;br /&gt;&lt;/div&gt;Each value in the image's CDF is then matched with the value of the desired CDF.  I did this by looking for the y-values of the CDF of the image that are equal to the y-axis of the desired CDF and then getting the grayscale value of the desired CDF and put these in a new matrix having the same size as the image.&lt;br /&gt;After reconstructing the image, I look for its corresponding histogram and CDF. The CDF of the new image must be in close relation with the desired CDF.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/Skwet0zrezI/AAAAAAAAAFw/N1jver8RPCA/s1600-h/image1+recon.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 213px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/Skwet0zrezI/AAAAAAAAAFw/N1jver8RPCA/s320/image1+recon.bmp" alt="" id="BLOGGER_PHOTO_ID_5353687829655026482" border="0" /&gt;&lt;/a&gt;Figure 5. Collated results of the simulation&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;image=imread('act4 picture.jpg');&lt;br /&gt;subplot(241)&lt;br /&gt;imshow(image,[]);&lt;br /&gt;//histogram&lt;br /&gt;H=[];&lt;br /&gt;counter=1;&lt;br /&gt;for i = 0:255;&lt;br /&gt;num=find(image==i);&lt;br /&gt;H(counter)=length(num);&lt;br /&gt;counter=counter+1;&lt;br /&gt;end;&lt;br /&gt;I=[1:256];//graylevel&lt;br /&gt;subplot(242);&lt;br /&gt;hist=plot(0:255,H);&lt;br /&gt;&lt;br /&gt;//CDF of the image&lt;br /&gt;tot=cumsum(H/length(image));&lt;br /&gt;subplot(243);&lt;br /&gt;cdf=plot(0:255,tot);&lt;br /&gt;&lt;br /&gt;//desired CDF&lt;br /&gt;j=[0:1:255];&lt;br /&gt;slope=1/255;&lt;br /&gt;line=slope*j;&lt;br /&gt;subplot(244);&lt;br /&gt;plot(j,line);&lt;br /&gt;&lt;br /&gt;//mapping&lt;br /&gt;s=size(image);&lt;br /&gt;mat=spzeros(s(1),s(2));&lt;br /&gt;for j=[1:length(I)];&lt;br /&gt;mat=mat+round(bool2s(image==I(j))*tot(j)/slope);&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;subplot(245);&lt;br /&gt;imshow(mat,[]);&lt;br /&gt;&lt;br /&gt;//histogram of the reconstructed image&lt;br /&gt;new=[];&lt;br /&gt;c=1;&lt;br /&gt;for i = 0:255;&lt;br /&gt;num2=find(mat==i);&lt;br /&gt;new(c)=length(num2);&lt;br /&gt;c=c+1;&lt;br /&gt;end;&lt;br /&gt;subplot(246);&lt;br /&gt;hist2=plot(0:255,new);&lt;br /&gt;//CDF of the new image&lt;br /&gt;tot2=cumsum(new/length(mat));&lt;br /&gt;subplot(247);&lt;br /&gt;cdf2=plot(0:255,tot2);&lt;br /&gt;&lt;br /&gt;The code was implemented to other images and these are the results.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/SkwgazK-xEI/AAAAAAAAAGA/mxAs7iT-9ic/s1600-h/result3.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 213px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/SkwgazK-xEI/AAAAAAAAAGA/mxAs7iT-9ic/s320/result3.bmp" alt="" id="BLOGGER_PHOTO_ID_5353689701821629506" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/Skwgasa-ebI/AAAAAAAAAF4/JUecKbmbTtM/s1600-h/result2.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 213px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/Skwgasa-ebI/AAAAAAAAAF4/JUecKbmbTtM/s320/result2.bmp" alt="" id="BLOGGER_PHOTO_ID_5353689700009671090" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 6.  The first three columns in the first row show the details of the original images, that is, the histogram and CDF.  The fourth column is the desired CDF and the second row shows the reconstructed image with its corresponding histogram and CDF.&lt;br /&gt;&lt;/div&gt;The human eyes respond to light in a nonlinear behavior.  Thus, choosing a CDF that fits the behavior of the human eyes, logarithmic function [y=log(x)] is applicable.  Replacing the desired CDF from a straight line into a logarithmic function, I arrived at the following results below.&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/Slg1inSKQnI/AAAAAAAAASA/0K3HJLCBE6c/s1600-h/nonlinear.bmp"&gt;&lt;img style="cursor: pointer; width: 400px; height: 343px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/Slg1inSKQnI/AAAAAAAAASA/0K3HJLCBE6c/s400/nonlinear.bmp" alt="" id="BLOGGER_PHOTO_ID_5357090625534182002" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;Figure 7. left- original image; right- reconstructed image&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;It can be noticed from the reconstructed images still show good contrast but are brighter at some regions.  This shows that the histograms of these reconstructed images are evenly distributed to the different gray levels, only that some gray level occurs more frequently than others at larger diffferences.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;I would like to acknowledge Gary Carcia, Jica Monsanto and Jaya Combinido for helping me improve my code and giving constructive criticisms to my work.&lt;br /&gt;I think I have performed all the tasks needed for this activity.  So I am giving myself a grade of 10.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Additional Information:&lt;br /&gt;&lt;/div&gt;I have found an article which performed image contrast enhancement based on the generalized histograms by relaxing the restriction of using the integer count.  The abstract of the paper reads,&lt;br /&gt;&lt;br /&gt;"We present an adaptive contrast enhancement method based on the generalized histogram, which is obtained by relaxing the restriction of using the integer count. For each pixel, the integer count 1 allocated to a pixel is split into the fractional count and the remainder count. The generalized histogram is generated by accumulating the fractional count for each intensity level and distributing the remainder count uniformly throughout the intensity levels. The intensity mapping function, which determines the contrast gain for each intensity level, is derived from the generalized histogram.  Since only the fractional part of the count allocated to each pixel is&lt;br /&gt;used for increasing the contrast gain of its intensity level, the amount of contrast enhancement is adjusted by varying the fractional count according to regional characteristics. The proposed&lt;br /&gt;scheme produces visually more pleasing results than the conventional histogram equalization."&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Title: Image contrast enhancement based on the generalized histogram&lt;br /&gt;Authors: Byoung-Woo Yoon and Woo-Jin Song&lt;br /&gt;&lt;br /&gt;References and Image url:&lt;br /&gt;1. J. Russ, The Image Processing Handbook, Fifth Edition, CRC Press.&lt;br /&gt;http://incisors.files.wordpress.com/2008/06/truecolor.jpg&lt;br /&gt;http://www.dolphinsc.com/images/Dolphin.jpg&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8100611507941163067-8511950524508561973?l=jrvitug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jrvitug.blogspot.com/feeds/8511950524508561973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jrvitug.blogspot.com/2009/07/enhancement-by-histogram-manipulation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/8511950524508561973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/8511950524508561973'/><link rel='alternate' type='text/html' href='http://jrvitug.blogspot.com/2009/07/enhancement-by-histogram-manipulation.html' title='Enhancement by histogram manipulation'/><author><name>Jaziel</name><uri>http://www.blogger.com/profile/04691747960517842787</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_1iO_ypw66RA/Sj8P-fXMj5I/AAAAAAAAABQ/L-wUdz_4OJA/S220/DSC04020.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_1iO_ypw66RA/Sktp8-yrSRI/AAAAAAAAAEI/EnlWqopXkgQ/s72-c/act4+picture.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8100611507941163067.post-7340544029571313888</id><published>2009-06-23T08:59:00.000-07:00</published><updated>2009-07-02T06:21:14.473-07:00</updated><title type='text'>Image types and basic image enhancement</title><content type='html'>Shown below are the examples of the different types of images with their corresponding properties.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/SkD8ciDDpcI/AAAAAAAAACo/QRWj2IzBMvM/s1600-h/true+color.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 263px; height: 320px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/SkD8ciDDpcI/AAAAAAAAACo/QRWj2IzBMvM/s320/true+color.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5350553924422313410" /&gt;&lt;/a&gt;&lt;br /&gt;                                   Figure1. True Image&lt;br /&gt;Image Properties:&lt;br /&gt;Truecolor Image    &lt;br /&gt;       FileName: true color.jpg&lt;br /&gt;       FileSize: 178712&lt;br /&gt;         Format: JPEG&lt;br /&gt;          Width: 411&lt;br /&gt;         Height: 500&lt;br /&gt;          Depth: 8&lt;br /&gt;    StorageType: truecolor&lt;br /&gt; NumberOfColors: 0&lt;br /&gt; ResolutionUnit: inch&lt;br /&gt;    XResolution: 72.000000&lt;br /&gt;    YResolution: 72.000000         &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/SknO4uXCpGI/AAAAAAAAAEA/kU03P7rrV5I/s1600-h/index_m.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 174px; height: 200px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/SknO4uXCpGI/AAAAAAAAAEA/kU03P7rrV5I/s320/index_m.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5353037106019214434" /&gt;&lt;/a&gt;&lt;br /&gt;                                  Figure2. Indexed Image&lt;br /&gt;Indexed Image&lt;br /&gt;       FileName: index_m.jpg&lt;br /&gt;       FileSize: 10590&lt;br /&gt;         Format: PNG&lt;br /&gt;          Width: 174&lt;br /&gt;         Height: 200&lt;br /&gt;          Depth: 8&lt;br /&gt;    StorageType: indexed&lt;br /&gt; NumberOfColors: 256&lt;br /&gt; ResolutionUnit: centimeter&lt;br /&gt;    XResolution: 72.000000&lt;br /&gt;    YResolution: 72.000000&lt;br /&gt;                          &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/SkD-nekol1I/AAAAAAAAADA/Kk3EZ7iagLk/s1600-h/200px-Breadfruit.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 200px; height: 257px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/SkD-nekol1I/AAAAAAAAADA/Kk3EZ7iagLk/s320/200px-Breadfruit.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5350556311491221330" /&gt;&lt;/a&gt;&lt;br /&gt;                                Figure3. Grayscale Image&lt;br /&gt;&lt;br /&gt;Size:   257 rows X 200 columns&lt;br /&gt;Indexed Image&lt;br /&gt;       FileName: 200px-Breadfruit.jpg&lt;br /&gt;       FileSize: 9272&lt;br /&gt;         Format: JPEG&lt;br /&gt;          Width: 200&lt;br /&gt;         Height: 257&lt;br /&gt;          Depth: 8&lt;br /&gt;    StorageType: indexed&lt;br /&gt; NumberOfColors: 256&lt;br /&gt; ResolutionUnit: inch&lt;br /&gt;    XResolution: 100.000000&lt;br /&gt;    YResolution: 100.000000&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/SkLt8RYh0sI/AAAAAAAAADQ/JEie5y-R1XA/s1600-h/Leopard_bw.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 319px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/SkLt8RYh0sI/AAAAAAAAADQ/JEie5y-R1XA/s320/Leopard_bw.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5351100926983787202" /&gt;&lt;/a&gt;&lt;br /&gt;                                Figure 4.  Binary Image&lt;br /&gt;Size:   352 rows X 353 columns&lt;br /&gt;Indexed Image&lt;br /&gt;       FileName: Leopard_bw.bmp&lt;br /&gt;       FileSize: 16960&lt;br /&gt;         Format: BMP&lt;br /&gt;          Width: 353&lt;br /&gt;         Height: 352&lt;br /&gt;          Depth: 8&lt;br /&gt;    StorageType: indexed&lt;br /&gt; NumberOfColors: 2&lt;br /&gt; ResolutionUnit: centimeter&lt;br /&gt;    XResolution: 118.080000&lt;br /&gt;    YResolution: 118.080000  &lt;br /&gt;&lt;br /&gt;The scanned image I chose was converted to grayscale type using GIMP software.  Here, the histogram is taken also by using GIMP.  These are shown in the figures below:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/SkyuTxhF0AI/AAAAAAAAAGw/huZWVapykSA/s1600-h/scilab+image.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/SkyuTxhF0AI/AAAAAAAAAGw/huZWVapykSA/s320/scilab+image.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5353845711769554946" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/SkyujJjSJNI/AAAAAAAAAG4/4B53OwvPu7E/s1600-h/histogramglasses.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 297px; height: 320px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/SkyujJjSJNI/AAAAAAAAAG4/4B53OwvPu7E/s320/histogramglasses.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5353845975919240402" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Notice from the histogram that all graylevels (0-255) are well distributed.  Thus, we can say that the region of interest (ROI) is well separated from the background. &lt;br /&gt;After this, the image was again converted to binary type with threshold level of 0.4.  This seems to be the best threshold since it still shows similar information of the image. From the code generated to find the area of several polygons in Activity 2, the area of the image was calculated.The theoretical value of the area was taken by counting the number of pixels in the binary image.  This was done by summing up all the 1's in the image, since the pixel values are only 1 and 0. &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/SkymQtdgvdI/AAAAAAAAAGY/FNKisPQcjkQ/s1600-h/b+and+w.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/SkymQtdgvdI/AAAAAAAAAGY/FNKisPQcjkQ/s320/b+and+w.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5353836863048170962" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/SkytpqVn-zI/AAAAAAAAAGo/ZSCVcVhToMg/s1600-h/area+comp.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 296px; height: 43px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/SkytpqVn-zI/AAAAAAAAAGo/ZSCVcVhToMg/s320/area+comp.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5353844988287908658" /&gt;&lt;/a&gt;&lt;br /&gt;The 9% error can be attributed to the curved contour of the image that was not included upon performing the formula in the Green's theorem.&lt;br /&gt;&lt;br /&gt;The histogram for the grayscale image can also be done using Scilab.  The following code shows how:&lt;br /&gt;//histogram&lt;br /&gt;hist=[];&lt;br /&gt;counter=1;&lt;br /&gt;for i=1:256;&lt;br /&gt;  num=find(scanimg==i);&lt;br /&gt;  hist(counter)=length(num);&lt;br /&gt;  counter=counter+1;&lt;br /&gt;end;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/SkyvfH9oa0I/AAAAAAAAAHA/fueT_vaeEKI/s1600-h/hist+using+scilab.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 242px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/SkyvfH9oa0I/AAAAAAAAAHA/fueT_vaeEKI/s320/hist+using+scilab.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5353847006285032258" /&gt;&lt;/a&gt;&lt;br /&gt;Notice the high correlation between the histogram from GIMP and Scilab.  This means that the code is correct.&lt;br /&gt;&lt;br /&gt;In this activity, I am giving myself a grade of 10 since all the tasks have been done with pretty good results.&lt;br /&gt;&lt;br /&gt;References for the images:&lt;br /&gt;true image: http://farm4.static.flickr.com/3272/2789704173_3bbc22342b.jpg&lt;br /&gt;&lt;br /&gt;indexed image: http://en.wikipedia.org/wiki/Indexed_color&lt;br /&gt;&lt;br /&gt;grayscale image: http://en.wikipedia.org/wiki/Black-and-white&lt;br /&gt;&lt;br /&gt;binary image: http://www.scouting.org.za/clipart/badges/cubadvancement/Leopard_bw.bmp&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8100611507941163067-7340544029571313888?l=jrvitug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jrvitug.blogspot.com/feeds/7340544029571313888/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jrvitug.blogspot.com/2009/06/image-types-and-basic-image-enhancement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/7340544029571313888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/7340544029571313888'/><link rel='alternate' type='text/html' href='http://jrvitug.blogspot.com/2009/06/image-types-and-basic-image-enhancement.html' title='Image types and basic image enhancement'/><author><name>Jaziel</name><uri>http://www.blogger.com/profile/04691747960517842787</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_1iO_ypw66RA/Sj8P-fXMj5I/AAAAAAAAABQ/L-wUdz_4OJA/S220/DSC04020.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_1iO_ypw66RA/SkD8ciDDpcI/AAAAAAAAACo/QRWj2IzBMvM/s72-c/true+color.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8100611507941163067.post-2899907141802940978</id><published>2009-06-22T19:23:00.000-07:00</published><updated>2009-06-30T00:07:13.386-07:00</updated><title type='text'>Area Estimation for Images with Defined Edges</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SkA91RTCmcI/AAAAAAAAACI/Fd5r8AH2bik/s1600-h/binary+image.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 316px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SkA91RTCmcI/AAAAAAAAACI/Fd5r8AH2bik/s320/binary+image.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5350344342701775298" /&gt;&lt;/a&gt;&lt;br /&gt;                          Figure 1.  Binary Image of a rectangle&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/SkA9-A9VfkI/AAAAAAAAACQ/qSM0iBZtnHs/s1600-h/circle.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 316px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/SkA9-A9VfkI/AAAAAAAAACQ/qSM0iBZtnHs/s320/circle.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5350344492934594114" /&gt;&lt;/a&gt;&lt;br /&gt;                        Figure 2. Binary Image of a Circle&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/SkA-D2NTxBI/AAAAAAAAACY/dtK8ONVDiy8/s1600-h/triangle.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 316px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/SkA-D2NTxBI/AAAAAAAAACY/dtK8ONVDiy8/s320/triangle.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5350344593128014866" /&gt;&lt;/a&gt;&lt;br /&gt;                         Figure 3. Binary image of a triangle&lt;br /&gt;&lt;br /&gt;In this activity, the first thing I did was draw a rectangle, circle and triangle using Paint.  These figures shown above are saved in JPG format.  Next, I opened Scilab 4.1.2 and imported all these images.  The image type of the figures is true color, so I converted them to binary type using the command “im2bw”.  From the SIP toolbox downloaded and installed, I utilized “follow” command in order to generate the contour and obtain the pixel values of the edges. The figures below are the generated contours of the images.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/SkVgAJYrpkI/AAAAAAAAADY/w-1C70ucYVo/s1600-h/rect+contour2.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 242px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/SkVgAJYrpkI/AAAAAAAAADY/w-1C70ucYVo/s320/rect+contour2.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5351789287835412034" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/SkVgV2n6kEI/AAAAAAAAADo/tLUZLhzLRk4/s1600-h/circle+contour.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 304px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/SkVgV2n6kEI/AAAAAAAAADo/tLUZLhzLRk4/s320/circle+contour.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5351789660756152386" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/SkVgOqmZkII/AAAAAAAAADg/4h722CcbllE/s1600-h/triangle+contour.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 242px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/SkVgOqmZkII/AAAAAAAAADg/4h722CcbllE/s320/triangle+contour.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5351789537269485698" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Using Green’s Theorem, the area was computed.  This was done by following the formula:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_1iO_ypw66RA/SkVioKkS1zI/AAAAAAAAAD4/mlkPNxgpO7Y/s1600-h/formula+for+greens.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 240px; height: 59px;" src="http://2.bp.blogspot.com/_1iO_ypw66RA/SkVioKkS1zI/AAAAAAAAAD4/mlkPNxgpO7Y/s320/formula+for+greens.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5351792174370576178" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;The corresponding code I made for this equation is: &lt;br /&gt;&lt;br /&gt;image1=imread('binary image.jpg');&lt;br /&gt;bw1=im2bw(image1,0.5);&lt;br /&gt;[x1,y1]=follow(bw1);&lt;br /&gt;Al=[];&lt;br /&gt;for i=1:length(x1)-1;&lt;br /&gt;  A1(i)=(x1(i)*y1(i+1))-(y1(i)*x1(i+1));&lt;br /&gt;  end&lt;br /&gt;area1=(sum(A1)*0.5)&lt;br /&gt;&lt;br /&gt;Basically, I sum up all the values generated from the distance between two contour points and divide them by 2.  The value in “area1” shows the area of the polygon.  To check if the measured area was reliable, I compared it with the theoretical value which was generated by counting all the 1’s in the binary type image.  Since the corresponding value of each pixel in the images are just 1 and zero, with 1 corresponding to the area polygon, by summing all 1’s, we can get the area.  The table below shows the theoretical and calculated values of the areas of each polygon and the % error.  &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1iO_ypw66RA/SkVie9INqgI/AAAAAAAAADw/irG7S4dJxUQ/s1600-h/table+for+area+computation.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 82px;" src="http://4.bp.blogspot.com/_1iO_ypw66RA/SkVie9INqgI/AAAAAAAAADw/irG7S4dJxUQ/s320/table+for+area+computation.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5351792016144312834" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The deviation of the calculated area from the theoretical value is small and is ~2%, which means that Green’s Theorem is accurate and precise in area measurement.  The errors are attributed to the boundary of the figures (contour lines) which are not considered in the formula I used.  The computation can be made more accurate by considering this boundary. Either add the contour line in the Green's formula or subtract it from the pixel count of the image.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I would like to acknowledge Mr. Gilbert Gubatan, Gary Garcia and Orly Tarun for giving wonderful insights regarding this activity.  And of course, to Dr. Soriano for assisting us and giving us some tips on area calculation. Thank you!&lt;br /&gt;In this activity, I give myself a 9 to account for the % error.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8100611507941163067-2899907141802940978?l=jrvitug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jrvitug.blogspot.com/feeds/2899907141802940978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jrvitug.blogspot.com/2009/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/8100611507941163067/posts/default/2899907141802940978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/2899907141802940978'/><link rel='alternate' type='text/html' href='http://jrvitug.blogspot.com/2009/06/area-estimation-for-images-with-defined.html' title='Area Estimation for Images with Defined Edges'/><author><name>Jaziel</name><uri>http://www.blogger.com/profile/04691747960517842787</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_1iO_ypw66RA/Sj8P-fXMj5I/AAAAAAAAABQ/L-wUdz_4OJA/S220/DSC04020.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_1iO_ypw66RA/SkA91RTCmcI/AAAAAAAAACI/Fd5r8AH2bik/s72-c/binary+image.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8100611507941163067.post-3387769924570505426</id><published>2009-06-17T20:14:00.000-07:00</published><updated>2009-06-18T08:01:53.513-07:00</updated><title type='text'>Digital Scanning</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1iO_ypw66RA/SjpVglnUUjI/AAAAAAAAAA0/EAMVqxJzD-g/s1600-h/from+excel.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 222px;" src="http://3.bp.blogspot.com/_1iO_ypw66RA/SjpVglnUUjI/AAAAAAAAAA0/EAMVqxJzD-g/s320/from+excel.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5348681525797081650" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/SjpVHAXUs_I/AAAAAAAAAAs/wbi6YqCgKgk/s1600-h/graph.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 231px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/SjpVHAXUs_I/AAAAAAAAAAs/wbi6YqCgKgk/s320/graph.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5348681086301156338" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1iO_ypw66RA/SjpVlWw7g4I/AAAAAAAAAA8/07n6W7JKQ3Y/s1600-h/overlaid.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 214px;" src="http://1.bp.blogspot.com/_1iO_ypw66RA/SjpVlWw7g4I/AAAAAAAAAA8/07n6W7JKQ3Y/s320/overlaid.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5348681607710212994" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In this activity, replication of the image of a graph was performed by relating the pixel locations and physical values of the data points.  By using Paint, the scanned image of the graph showing the number of observed asteroids (in logarithmic form) with brightness from 9.0 (magnitude) from the book entitled “The System of Minor Planets” by Gunter D. Roth (1962) was opened. The tick marks were recorded as well as their pixel locations. The x-axis which corresponds to the brightness of asteroids began at 9 and end to 17 with an increment of 1.  On the other hand, the y-axis of the graph which shows the number of asteroids in logarithmic form started from 0 up to 3.5 with an increment of 0.5.  Since the increments in each axis are equal, the difference between the pixel locations of the tick marks must also be the same.  However, there are small deviations from what I got using Paint. So, I took the average of the differences of the pixel locations of the tick marks in the x and y axes, noting that for the horizontal axis, the y-coordinates are the same and in the vertical axis, the x-coordinates are equal.  The average values for x and y-axis are 72.57 and 74.17, respectively.  The ratio between the increment of the physical value of the tick marks and their averaged pixel location difference were taken. This was used to measure the physical value of the points in the graph given their pixel locations.  &lt;br /&gt;&lt;br /&gt;For the physical value of the data points along the x-axis, the pixel location of each point was subtracted to the x-axis pixel location of (9, 0) since it is the starting point in the horizontal axis. This was then multiplied with the ratio obtained. Finally, 9 was added from the product to account for the starting point of the x-axis.  Similar procedure was done to obtain the physical value of the points in the y-axis.  However, it must be reminded that in Paint software, the value of the y-axis increases as we go downward (opposite of that in the graph).  So, the y-coordinate pixel location of the starting point (9, 0) was subtracted to the pixel location of the point and then multiplied with the ratio obtained.  All this computations were done using Microsoft Excel 2007.&lt;br /&gt;&lt;br /&gt;The physical x and y values of the data points in the graph were then plotted in Excel.  To check whether the obtained physical values matched with that in the scanned image of the graph, the image was overlaid from the plot.  This was done by right clicking the plot and choosing “Format Plot Area”.  From the dialog box, go to “Fill” and click “Picture of texture fill”. Then, insert the image from the File and then close the dialog box.  The scanned image must be cropped properly such that only the graph is being shown for accurate comparison with the reconstructed plot.  The last figure shows the scanned image overlaid with the reconstructed plot.  It can be seen that the calculated physical values of the data points matched almost perfectly with that from the image.&lt;br /&gt;&lt;br /&gt;I would like to acknowledge Mr. Jay Samuel Combinido for giving helpful suggestions in improving my plot and our teachers, Dr. Soriano and Dr. Perez for their assistance. For this activity, I give myself a grade of 8 because there is still very small difference between the scanned image and the reconstructed one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8100611507941163067-3387769924570505426?l=jrvitug.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jrvitug.blogspot.com/feeds/3387769924570505426/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jrvitug.blogspot.com/2009/06/digital-scanning.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/3387769924570505426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8100611507941163067/posts/default/3387769924570505426'/><link rel='alternate' type='text/html' href='http://jrvitug.blogspot.com/2009/06/digital-scanning.html' title='Digital Scanning'/><author><name>Jaziel</name><uri>http://www.blogger.com/profile/04691747960517842787</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_1iO_ypw66RA/Sj8P-fXMj5I/AAAAAAAAABQ/L-wUdz_4OJA/S220/DSC04020.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_1iO_ypw66RA/SjpVglnUUjI/AAAAAAAAAA0/EAMVqxJzD-g/s72-c/from+excel.JPG' height='72' width='72'/><thr:total>1</thr:total></entry></feed>
