<?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-5456440432957498316</id><updated>2011-07-30T23:55:06.226-07:00</updated><title type='text'>miguel  AP 186 blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ap186-msison.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://ap186-msison.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>miguel</name><uri>http://www.blogger.com/profile/15739169920727151183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5456440432957498316.post-1032968137258165581</id><published>2009-10-05T06:16:00.003-07:00</published><updated>2009-10-12T08:16:53.333-07:00</updated><title type='text'>Activity 19 Restoration of blurred image</title><content type='html'>&lt;div style="text-align: justify;"&gt;Our final activity is again about image restoration.  However unlike the previous activity, where we tackled images with additive noise, this time we will be restoring blurred images.  Basically a blurred image is due to the effect of a degradation function to a given image.  Let us also remember that in our earlier activities we have already encountered blurred images as a result of convolving apertures or filtering in the Fourier space.  In this activity we will only be focused on blurred images caused by uniform linear motion with an additive gaussian noise.&lt;br /&gt;&lt;br /&gt;Whatever the degradation process maybe, it can always be modeled as a convolution of the image and the degradation function such that in inverse space we obtained a blurred image given by&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/_O7bGRbkJNVY/SszLB4A65_I/AAAAAAAAAXg/tz9wn9mRSmI/s1600-h/eqn1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 33px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SszLB4A65_I/AAAAAAAAAXg/tz9wn9mRSmI/s400/eqn1.png" alt="" id="BLOGGER_PHOTO_ID_5389906087132194802" border="0" /&gt;&lt;/a&gt;Equation 1&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;where H is the transfer function of the blurring process and N is the additive noise.  For this activity we will be using the known degradation function of a uniform linear motion blur (equation 2).  In equation 2, parameters a and b are the total displacements along x and y directions respectively and T is the total exposure time.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SszLBnFg9cI/AAAAAAAAAXY/Zo2lb0YyZhM/s1600-h/eqn2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 46px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SszLBnFg9cI/AAAAAAAAAXY/Zo2lb0YyZhM/s400/eqn2.png" alt="" id="BLOGGER_PHOTO_ID_5389906082588063170" border="0" /&gt;&lt;/a&gt;Equation 2&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;Just like in our previous activity the restoration process involves applying a filter or operation to obtain an estimate of the image from the degraded one.  This time we will be using the Weiner (minimum mean square error) filter which incorporates both the degradation function and the statistics of the additive noise.  The application of this filter operates in inverse space and is given by&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SszLBL2ubcI/AAAAAAAAAXQ/Yoj0_vUhd5U/s1600-h/eqn3.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 153px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SszLBL2ubcI/AAAAAAAAAXQ/Yoj0_vUhd5U/s400/eqn3.png" alt="" id="BLOGGER_PHOTO_ID_5389906075278273986" border="0" /&gt;&lt;/a&gt;Equation 3&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;where Sn and Sf are the power spectra of the noise and the ideal (undegraded) image.  However, in real life situations it is highly improbable for us to have information on both the additive noise and the ideal (undegraded) image.  For such cases equation 3 will be approximated into&lt;br /&gt;&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/_O7bGRbkJNVY/SszLAzWCUHI/AAAAAAAAAXI/0SX_Sf0ks_c/s1600-h/eqn4.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 74px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SszLAzWCUHI/AAAAAAAAAXI/0SX_Sf0ks_c/s400/eqn4.png" alt="" id="BLOGGER_PHOTO_ID_5389906068698714226" border="0" /&gt;&lt;/a&gt;Equation 4&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;where Sn/Sf is replaced by a constant K.&lt;br /&gt;&lt;br /&gt;In this activity we use equations 1 and 2 on a gray scale image (figure 1) to produce a blurred image.  Then we restore this blurred image using equation 3 or equation 4 with different values of K.  We also do all of these for different gaussian noise strengths.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SszKq1l7dVI/AAAAAAAAAXA/shgDLGklYkU/s1600-h/Wikipedia-logo.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 262px; height: 320px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SszKq1l7dVI/AAAAAAAAAXA/shgDLGklYkU/s400/Wikipedia-logo.png" alt="" id="BLOGGER_PHOTO_ID_5389905691345122642" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Figure 1&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/StNEtxYpOMI/AAAAAAAAAbo/t7TF8QGIZjM/s1600-h/NewPicture2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 384px; height: 400px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/StNEtxYpOMI/AAAAAAAAAbo/t7TF8QGIZjM/s400/NewPicture2.png" alt="" id="BLOGGER_PHOTO_ID_5391728732034119874" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Figure 2.  Blurred and restored image for different values of K, T, a, and b.  We set the additive noise to be equal to zero&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Figures 2 shows our results if we only have an image that is motioned blurred and no additive noise is present.  From these images we clearly see that decreasing K improves the quality of our restoration.  Furthermore, at the extreme case when K = 0  we arrive at a perfect restoration.  These results are actually expected if we analyze equations 1 and 4.  Doing simple math, at K = 0, equation 4 reduces to equation 5.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SszKmUX1iaI/AAAAAAAAAWg/0t-UHacm67c/s1600-h/eqn5.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 61px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SszKmUX1iaI/AAAAAAAAAWg/0t-UHacm67c/s400/eqn5.png" alt="" id="BLOGGER_PHOTO_ID_5389905613708167586" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Equation 5&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;And since in this case we set the additive noise to zero, the last term in equation 5 vanishes and we are left with a perfect restoration.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/StND1oxVtAI/AAAAAAAAAbg/aNPy0wt2pVI/s1600-h/untitled.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 226px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/StND1oxVtAI/AAAAAAAAAbg/aNPy0wt2pVI/s400/untitled.PNG" alt="" id="BLOGGER_PHOTO_ID_5391727767649104898" border="0" /&gt;&lt;/a&gt;&lt;div style="text-align: center;"&gt;(click to enlarge)&lt;br /&gt;Figure 3.   Blurred and restored image for different values of K, T, a, and b. Noise strength is sigma=0.001&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;In figure 3 we show the results of restoration when we consider the blurred image with an additive gaussian noise.  Again similar to the case when there is no noise having a small value of K gives a very good quality of restoration.  However, in this case if we further decrease K we then start to obtain dark noisy images.  And, unlike the case of no noise, at K = 0 we obtain a meaningless restored image (almost pure noise). &lt;br /&gt;&lt;br /&gt;One more notable result shown here is that even by using the exact power spectra of the noise and the original image, as in equation 3, we still do not obtain a perfect reconstruction.  The restored image is indeed a significant improvement compared the blurred image but it is still not perfect.&lt;br /&gt;&lt;br /&gt;I give myself a grade of 9 in this activity.  The results we have obtained were very convincing but still left some questions unanswered.  I would like to thank Master, Jaya, Orly, and Thirdy for helping me realize that I was wrong.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Main reference&lt;br /&gt;&lt;br /&gt;A19 – Restoration of blurred image, AP186 2009&lt;br /&gt;&lt;br /&gt;&lt;br /&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/5456440432957498316-1032968137258165581?l=ap186-msison.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ap186-msison.blogspot.com/feeds/1032968137258165581/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ap186-msison.blogspot.com/2009/10/activity-19-restoration-of-blurred.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/1032968137258165581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/1032968137258165581'/><link rel='alternate' type='text/html' href='http://ap186-msison.blogspot.com/2009/10/activity-19-restoration-of-blurred.html' title='Activity 19 Restoration of blurred image'/><author><name>miguel</name><uri>http://www.blogger.com/profile/15739169920727151183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_O7bGRbkJNVY/SszLB4A65_I/AAAAAAAAAXg/tz9wn9mRSmI/s72-c/eqn1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456440432957498316.post-8408945706453854638</id><published>2009-10-05T06:16:00.001-07:00</published><updated>2009-10-06T08:11:26.715-07:00</updated><title type='text'>Activity 18 Noise models and basic image restoration</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;div style="text-align: justify;"&gt;Just like any other measuring device or data gathering techniques noise is present in almost all forms of digital image acquisition.  Noise, in general, is any unwanted aberration, random signal, or artifacts present in the image.  Some of our previous activities already involved dealing with poor quality images using image enhancements.  Previously we have used filtering in Fourier space, morphological operations, and even white balancing to improve the images.  In this activity we will be using different image restoration methods to improve images with additive noise.  In contrast to image enhancement, image restoration involves reversing the degradation process that produced the noise in the image.  This means that a priori knowledge of the noise is important for a successful image restoration.&lt;br /&gt;&lt;br /&gt;For this activity, we are tackling additive noise in the form of random variables following a specific probability distribution functions (PDF).  We will be using six different noise models specifically: gaussian, rayleigh, gamma, exponential, uniform, and impulse noise.&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/_O7bGRbkJNVY/SstVyQ8-lsI/AAAAAAAAAWQ/9HEPEHqqAYw/s1600-h/Figure+1.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 155px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SstVyQ8-lsI/AAAAAAAAAWQ/9HEPEHqqAYw/s400/Figure+1.png" alt="" id="BLOGGER_PHOTO_ID_5389495701111477954" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Figure 1&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;There are many different types and methods of image restoration but in our case we will limit ourselves with spatial filters since they are most suited for additive noise.  We will be using four types of filters namely, arithmetic, geometric, harmonic, and contraharmonic mean filters.  With this filters we are basically changing the pixel values using the information provided by the image.  All of this filters work by considering a subimage window centered at pixel(x,y) and using all the values within this window to calculate the new value of pixel(x,y) (figure 1).  Equation 1 shows the formula followed by the arithmetic mean filter.  This filter replaces the pixel value with the average of all the values in the window.  On the other hand the geometric mean filter uses the product of all the values and takes its Ath root where A is the total area of the window (equation 2).  The harmonic and contraharmonic mean filters follows equation 3 and 4 respectively.&lt;br /&gt;&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/_O7bGRbkJNVY/SstVO_jYh4I/AAAAAAAAAWI/GpfK4abAJTo/s1600-h/eqn1.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 108px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SstVO_jYh4I/AAAAAAAAAWI/GpfK4abAJTo/s400/eqn1.png" alt="" id="BLOGGER_PHOTO_ID_5389495095145301890" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Equation 1&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/_O7bGRbkJNVY/SstVOoQeQ9I/AAAAAAAAAWA/qRgv0TlDaC8/s1600-h/eqn2.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 147px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SstVOoQeQ9I/AAAAAAAAAWA/qRgv0TlDaC8/s400/eqn2.png" alt="" id="BLOGGER_PHOTO_ID_5389495088891970514" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Equation 2&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/SstVOBpAtqI/AAAAAAAAAV4/3FGsMSUEfmM/s1600-h/eqn3.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 120px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SstVOBpAtqI/AAAAAAAAAV4/3FGsMSUEfmM/s400/eqn3.png" alt="" id="BLOGGER_PHOTO_ID_5389495078525908642" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Equation 3&lt;br /&gt;&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/_O7bGRbkJNVY/SstVNjUKvBI/AAAAAAAAAVw/YJUiqBSUIqU/s1600-h/eqn4.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 79px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SstVNjUKvBI/AAAAAAAAAVw/YJUiqBSUIqU/s400/eqn4.png" alt="" id="BLOGGER_PHOTO_ID_5389495070385421330" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Equation 4&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;In this activity we first create a noisy image by adding noise to a grayscale image then apply a restoration filter.  We do this for each of the noise types and each of the restoration filters.  Furthermore, to aide us in assessing our results we also take the histograms of all our images before and after restoration.&lt;br /&gt;&lt;br /&gt;Figure 2 to 7 shows the result of applying the different restoration filters for each of the six noise types.  It is clearly seen that even though the result is slightly more blurred it is actually much closer to the original image.  This is further highlighted by looking at the image histograms.  The histograms of the restored images are much closer that of the original image.  The broadening or shifting introduced by the noise was greatly reduced by all the restoration filters.  The minor blurring is simply due to the windowing; that is a smaller window results in less blurring but sacrifices the efficacy of the restoration.  Here we used a 5x5 pixel window for a 256x256 pixel image.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SstVNWsCLbI/AAAAAAAAAVo/DVX8t2-A1d4/s1600-h/Figure+2.png"&gt;&lt;img style="cursor: pointer; width: 146px; height: 400px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SstVNWsCLbI/AAAAAAAAAVo/DVX8t2-A1d4/s400/Figure+2.png" alt="" id="BLOGGER_PHOTO_ID_5389495066995862962" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/SstUpLpUUmI/AAAAAAAAAVg/AZVuRlDf5QA/s1600-h/Figure+3.png"&gt;&lt;img style="cursor: pointer; width: 146px; height: 400px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SstUpLpUUmI/AAAAAAAAAVg/AZVuRlDf5QA/s400/Figure+3.png" alt="" id="BLOGGER_PHOTO_ID_5389494445556388450" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2                                             Figure 3&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/SstUonTcI3I/AAAAAAAAAVY/8VunrzKu7FQ/s1600-h/Figure+4.png"&gt;&lt;img style="cursor: pointer; width: 148px; height: 400px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SstUonTcI3I/AAAAAAAAAVY/8VunrzKu7FQ/s400/Figure+4.png" alt="" id="BLOGGER_PHOTO_ID_5389494435800949618" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SstUnxdScqI/AAAAAAAAAVQ/xLEC-wGvi1E/s1600-h/Figure+5.png"&gt;&lt;img style="cursor: pointer; width: 146px; height: 400px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SstUnxdScqI/AAAAAAAAAVQ/xLEC-wGvi1E/s400/Figure+5.png" alt="" id="BLOGGER_PHOTO_ID_5389494421346742946" border="0" /&gt;&lt;/a&gt;&lt;div style="text-align: left;"&gt;&lt;div style="text-align: center;"&gt;                                        Figure 4 Figure 5&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SstUnT4qWkI/AAAAAAAAAVI/IDpo7nLqOXI/s1600-h/Figure+6.png"&gt;&lt;img style="cursor: pointer; width: 146px; height: 400px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SstUnT4qWkI/AAAAAAAAAVI/IDpo7nLqOXI/s400/Figure+6.png" alt="" id="BLOGGER_PHOTO_ID_5389494413408492098" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SstUm_za7AI/AAAAAAAAAVA/_HkImNwBnCg/s1600-h/Figure+7.png"&gt;&lt;img style="cursor: pointer; width: 151px; height: 400px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SstUm_za7AI/AAAAAAAAAVA/_HkImNwBnCg/s400/Figure+7.png" alt="" id="BLOGGER_PHOTO_ID_5389494408017800194" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;                                        Figure 6                        Figure 7&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;However, looking at figure 7, we see that the restoration processes don't seem to negate the effect of the impulse (salt and pepper) noise.  comparing the images we see very little to no improvement after implementing the arithmetic and geometric mean filters.  Furthermore, looking at the histograms we even see that the restoration process degraded the image.  The only semblance of improvement we can see is that the harmonic filtering and contraharmonic filtering with negative Q were both able to completely remove salt noise but not pepper.  On the other hand using the contraharmonic filter with positive Q removes pepper noise but not salt.&lt;br /&gt;&lt;br /&gt;We also did this whole procedure for a real grayscale image obtained from the internet (figure 8).&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/Sstc9JPWdEI/AAAAAAAAAWY/JU_uas_7vYc/s1600-h/figure+8.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 399px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/Sstc9JPWdEI/AAAAAAAAAWY/JU_uas_7vYc/s400/figure+8.png" alt="" id="BLOGGER_PHOTO_ID_5389503584601011266" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;Figure 8&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;Overall this activity has been very enlightening and the results were very convincing.  We were able to show that the different spatial filters are indeed useful for image restoration except for salt and pepper noise.  I give myself a grade of 10 in this activity.&lt;br /&gt;&lt;br /&gt;Main Reference:&lt;br /&gt;AP186 "A18 – Noise models and basic image restoration", 2009&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&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/5456440432957498316-8408945706453854638?l=ap186-msison.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ap186-msison.blogspot.com/feeds/8408945706453854638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ap186-msison.blogspot.com/2009/10/activity-18-noise-models-and-basic.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/8408945706453854638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/8408945706453854638'/><link rel='alternate' type='text/html' href='http://ap186-msison.blogspot.com/2009/10/activity-18-noise-models-and-basic.html' title='Activity 18 Noise models and basic image restoration'/><author><name>miguel</name><uri>http://www.blogger.com/profile/15739169920727151183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_O7bGRbkJNVY/SstVyQ8-lsI/AAAAAAAAAWQ/9HEPEHqqAYw/s72-c/Figure+1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456440432957498316.post-4035103320438647871</id><published>2009-09-09T18:29:00.002-07:00</published><updated>2009-10-05T06:32:25.937-07:00</updated><title type='text'>Activity 17 Photometric Stereo</title><content type='html'>&lt;div style="text-align: justify;"&gt;Many of our previous activities involved using an objects reflectance, its interaction with a light source, to do color segmentation, white balancing, and even classification.  In this activity we will again use the this phenomenon to reconstruct a 3D surface.  The method we will be implementing is called photometric stereo.&lt;br /&gt;&lt;br /&gt;To give us a better understanding of our method it is best to backtrack a little.  Let us consider a camera, such as those we have benn using in our previous activities.  Esentially, the image obtained by a camerais simply the light intensity, I, reflected by its subject which is dependent on the materials reflectance.  However aside form its reflectance this intensity pattern is also dependent on the geometry of the object which results in light and dark (shadow) areas.  This is much more understood by looking at figure 1, where we can see that the reflected intensity at point P is affected by the angle at which the light hits the surface, resulting to either a bright area and/or a shadow.  Hence an intesity profile of an object also contains information on its geometry.  Equation 1 gives an expression for this intensity where rho is the reflectance and k is a scaling parameter.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/Ssnyv8AtXbI/AAAAAAAAAUQ/jU4J5-M5oA8/s1600-h/Figure1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 244px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/Ssnyv8AtXbI/AAAAAAAAAUQ/jU4J5-M5oA8/s400/Figure1.png" alt="" id="BLOGGER_PHOTO_ID_5389105334502383026" border="0" /&gt;&lt;/a&gt;Figure 1. Visualization of Reflection on a 3D surface&lt;br /&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/_O7bGRbkJNVY/SsnyvvWBfBI/AAAAAAAAAUI/LhB0wugR1YM/s1600-h/eqn1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 48px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SsnyvvWBfBI/AAAAAAAAAUI/LhB0wugR1YM/s400/eqn1.png" alt="" id="BLOGGER_PHOTO_ID_5389105331102120978" border="0" /&gt;&lt;/a&gt;Equation 1&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;Looking at our model on figure 1 and equation 1, it becomes apparent that we should also take into account the type or our light source.  That is, point sources, line sources, and area sources would result in different reflected intensity patterns since the light coming from them would arrive at the surface differently (different angles and intensities as a function of distance).  However in this activity we limit ourselves to an approximation that our point source is at infinity which results to equation 1 having the form&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/SsnyvOCsgoI/AAAAAAAAAUA/Q-USbQOEUcU/s1600-h/eqn2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 331px; height: 52px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SsnyvOCsgoI/AAAAAAAAAUA/Q-USbQOEUcU/s400/eqn2.png" alt="" id="BLOGGER_PHOTO_ID_5389105322162684546" border="0" /&gt;&lt;/a&gt;&lt;div style="text-align: center;"&gt;Equation 2.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Since we know the intensity profile from our image, if we have information on the location of the light source we can obtain the geometry of the surface by solving for the normal vector&lt;span style="font-weight: bold;"&gt; n&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;In this method, photometric stereo, we will be using multiple images of the same object but with light sources at different locations to obtain an estimate of an objects 3 dimensional geometry.  Since we have images for different light source locations we can rewrite equation 2 in matrix form where each row corresponds to a image (intensity profile) light source pair.  Solving for the normal vector &lt;span style="font-weight: bold;"&gt;n&lt;/span&gt; we obtain&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/_O7bGRbkJNVY/Ssnyu0FX3JI/AAAAAAAAAT4/Ebn3tYgH898/s1600-h/eqn3.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 243px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/Ssnyu0FX3JI/AAAAAAAAAT4/Ebn3tYgH898/s400/eqn3.png" alt="" id="BLOGGER_PHOTO_ID_5389105315194592402" border="0" /&gt;&lt;/a&gt;Equation 3&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SsnyORQM_II/AAAAAAAAATw/eM6WSIv_rTc/s1600-h/eqn4.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 166px; height: 66px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SsnyORQM_II/AAAAAAAAATw/eM6WSIv_rTc/s400/eqn4.png" alt="" id="BLOGGER_PHOTO_ID_5389104756088962178" border="0" /&gt;&lt;/a&gt;Equation 4&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;We also know that this normal vector n is related to the surface c by the taking the gradient of c such that&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SsnyNrc95WI/AAAAAAAAATo/cdKjHipO2n0/s1600-h/eqn5.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 72px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SsnyNrc95WI/AAAAAAAAATo/cdKjHipO2n0/s400/eqn5.png" alt="" id="BLOGGER_PHOTO_ID_5389104745941951842" border="0" /&gt;&lt;/a&gt;Equation 5&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Finally we obtain the surface f(x,y) by integrating&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/_O7bGRbkJNVY/SsnyNT-HySI/AAAAAAAAATg/a4b_n_MFlJk/s1600-h/eqn6.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 342px; height: 63px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SsnyNT-HySI/AAAAAAAAATg/a4b_n_MFlJk/s400/eqn6.png" alt="" id="BLOGGER_PHOTO_ID_5389104739638561058" border="0" /&gt;&lt;/a&gt;Equation 6&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;We implement this algorithm in Scilab and make use of matrix properties and operation to reduce the computation time.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/SsnyM1INjVI/AAAAAAAAATY/jlDofCXfPrI/s1600-h/Figure2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 397px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SsnyM1INjVI/AAAAAAAAATY/jlDofCXfPrI/s400/Figure2.png" alt="" id="BLOGGER_PHOTO_ID_5389104731359382866" border="0" /&gt;&lt;/a&gt;&lt;div style="text-align: center;"&gt;Figure 2. Images of the surface taken with 4 different location of the light source.  Their respective locations were previously provided.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Figure 2 shows the raw images we used to calculate the 3D surface.  We used 4 images with sources at different locations from the matlab file photos.mat.  It is easily seen from this images that indeed there is a noticeable difference with different light source position. &lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/SsnyMQd38UI/AAAAAAAAATQ/f_jM-SGdafY/s1600-h/Figure3.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 304px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SsnyMQd38UI/AAAAAAAAATQ/f_jM-SGdafY/s400/Figure3.png" alt="" id="BLOGGER_PHOTO_ID_5389104721518129474" border="0" /&gt;&lt;/a&gt;Figure 3.  3D plot of the calculated surface of the 3D object.  Errors are seen as spikes and dips over the surface&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Using the algorithm we discussed and the raw images shown in figure 2 we reconstruct a hemispherical surface shown in figure 3. The resulting surface we obtained is in good agreement with our expectation.  Notice that the shape is indeed that of a sphere and the background remains flat.  However we also see that the surface is very rough and there is even a gentle dip in a the shape of a cross over the hemishpere.  These imperfections is inherent to our method, since it is still only an approximation.  A much better result may be obtained by having more images (hence more information resulting to a better approximation).  Still overall we can say that the method is a success and is fairly simple to implement.&lt;br /&gt;&lt;br /&gt;I give myself a grade of 10 in this activity.  I thank Dr. Gay Pereze for her patience and useful adice.&lt;br /&gt;&lt;br /&gt;Main Reference&lt;br /&gt;&lt;br /&gt;A17– Photometric Stereo by Dr. Maricor Soriano, 2008&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/5456440432957498316-4035103320438647871?l=ap186-msison.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ap186-msison.blogspot.com/feeds/4035103320438647871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ap186-msison.blogspot.com/2009/09/activity-17-photometric-stereo.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/4035103320438647871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/4035103320438647871'/><link rel='alternate' type='text/html' href='http://ap186-msison.blogspot.com/2009/09/activity-17-photometric-stereo.html' title='Activity 17 Photometric Stereo'/><author><name>miguel</name><uri>http://www.blogger.com/profile/15739169920727151183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_O7bGRbkJNVY/Ssnyv8AtXbI/AAAAAAAAAUQ/jU4J5-M5oA8/s72-c/Figure1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456440432957498316.post-7150014516649980084</id><published>2009-09-09T18:29:00.001-07:00</published><updated>2009-10-11T08:12:36.913-07:00</updated><title type='text'>Activity 16 Neural Networks</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;span&gt;Do you remember when I said machines are stupid?  Well, I am not the first or the only one to believe so.  Genius scientists and programmers that came before us also believed that machines and computers are sorely lacking when compared to the human brain.  Just like in our pattern recognition activities (14 and 15), after creating our feature vectors we still needed to implement a formula so that the computer would classify the objects.  So the brilliant scientists and programmers of the 19th century developed the “Neural Network”.  The “Neural Network” works by mimicking how our own brain works; that is each neuron takes in multiple weighted inputs, processes the information, and then passes its output to a succeeding neuron.  A collection of many interconnected neurons forms a “Neural Network.”  The main advantage of using “Neural Network” over LDA and minimum distance classification is that we do not need to apply various classification rules and formulas. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;Although I said that we do not use formulas with “Neural Network”, strictly speaking we still do.  However this various calculations happen or exists within the structure of the network and the user won’t ever encounter it.  We use “Neural Network” by simply giving it examples of a class and telling it that that particular example is a member of a specific class.  For a given amount of time or iterations the “Neural Network” will adjusts the input weights of each neuron to minimize its error (identifying an object as a member of the wrong class).  After all the iterations the “Neural Network” has already “learned” and will identify an object as a member of any class it has learned. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;In this activity we will use Neural Networks from the ANN toolbox of SciLab to do pattern recognition.  Our input to the neural network is the feature vectors we have from activities 14 and 15.  We train the neural network by giving it 9 examples of each of the 4 classes and telling it which class each object belongs to (Activity 14 Table 1).  Also we test the accuracy of the “Neural Network” network by letting it classify 40 more objects, one for each class, and counting how many it classified correctly.  We test the accuracy of classification for different learning rates of the “Neural Network” from 0.01 to 0.99.     &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span&gt;&lt;span&gt;Table 1.  Classification result and percent accuracy at different learning rates.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;(click to enlarge)     &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/StH1abI-ztI/AAAAAAAAAbA/V3_eK-w-WW0/s1600-h/Table+1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 353px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/StH1abI-ztI/AAAAAAAAAbA/V3_eK-w-WW0/s400/Table+1.png" alt="" id="BLOGGER_PHOTO_ID_5391360063250026194" border="0" /&gt;&lt;/a&gt;&lt;span&gt;&lt;span&gt;Table 1 shows the results and accuracy of classification of the “Neural Network”.  We see that as expected as we increase learning rate the accuracy of classification also increases and reaches a maximum of 100% at a learning rate of 0.23 to 0.55. The red box over table 1 highlights the area with 100% accuracy.  However, as we increase the learning rate beyond 0.55 the accuracy slightly decrease to 97.5%.  This is not expected since a higher learning rate should result in better classification.  The classification accuracy versus learning rate is plotted in figure 1 and this trend of increase and slight decrease is observed much better.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/StH1t7_7eCI/AAAAAAAAAbY/fsEjKTHbftk/s1600-h/Figure+1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 319px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/StH1t7_7eCI/AAAAAAAAAbY/fsEjKTHbftk/s400/Figure+1.png" alt="" id="BLOGGER_PHOTO_ID_5391360398487943202" border="0" /&gt;&lt;/a&gt;&lt;div style="text-align: center;"&gt;&lt;span&gt;&lt;span&gt;Figure 1.  Classification accuracy versus Neural Network learning rate.&lt;/span&gt;&lt;/span&gt;  Red line highlights range with 100% accuracy&lt;br /&gt;&lt;/div&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;     It would have been better to do multiple trials at different seed values to determine the standard deviation of the classification accuracy for each learning rate.  If we have this information we might find out that this decrease in accuracy is not significant and is within the standard deviation.  It would have also been better if we explored the effect of number of learning iterations but this was not explored due to time constraints.I would like to thank Kaye for reminding me of what to do in this activity.  I give myself a grade of 10.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;     Main Reference:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;Maricor Soriano, A16 – Neural Networks, AP186 2008    &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;Cole’s AP186 Blog&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;  &lt;/span&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/5456440432957498316-7150014516649980084?l=ap186-msison.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ap186-msison.blogspot.com/feeds/7150014516649980084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ap186-msison.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/5456440432957498316/posts/default/7150014516649980084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/7150014516649980084'/><link rel='alternate' type='text/html' href='http://ap186-msison.blogspot.com/2009/09/activity-16-neural-networks.html' title='Activity 16 Neural Networks'/><author><name>miguel</name><uri>http://www.blogger.com/profile/15739169920727151183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_O7bGRbkJNVY/StH1abI-ztI/AAAAAAAAAbA/V3_eK-w-WW0/s72-c/Table+1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456440432957498316.post-6589888488910785506</id><published>2009-09-09T18:28:00.000-07:00</published><updated>2009-10-11T05:54:45.896-07:00</updated><title type='text'>Activity 15 Probabilistic Classification</title><content type='html'>&lt;div style="text-align: justify;"&gt;In the previous activity we used minimum distance classification to assign the classes of our objects.  However, even with our best choice of features, relying on the distances amongst feature vectors may still be ambiguous.  This was not a problem in our previous activity but such a scenario is indeed possible.  In activity 14 if we had just opted to use the normalized Red value and the Area/Perimeter^2 it would have been very difficult to differentiate between heart and diamond.  In this activity we implement another method of classification called Linear Discriminant Analysis (LDA).  We will still be using the same feature vectors that we described in activity 14 but this time we will use a different method for calculating an object’s class.&lt;br /&gt;&lt;br /&gt;In pattern recognition we may think of the all the events as having a given probability.  Let us consider two classes and a single object.  Assuming that the object and the classes have similar features we may consider that the error or accuracy of our classification is given by the probability of assigning the object to the wrong or correct class.  Moreover, the probability that an object came from a given class not only depends on its features but also the knowledge of how many objects belong to a given class.  LDA is simply a method of calculating the probability of an object to belong to a given class using their features.  The membership of an object is decided by the class that has the highest probability of containing it.  The LDA method is based on the assumption that each class has a multivariate Normal distribution and that all the classes share the same Covariance matrix.&lt;br /&gt;&lt;br /&gt;LDA calculates the probability, fij, of an object to belong in a class according to 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://4.bp.blogspot.com/_O7bGRbkJNVY/StHUlzipgSI/AAAAAAAAAaY/8YQ9YRXMXSU/s1600-h/Equation+1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 56px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/StHUlzipgSI/AAAAAAAAAaY/8YQ9YRXMXSU/s400/Equation+1.png" alt="" id="BLOGGER_PHOTO_ID_5391323974894977314" border="0" /&gt;&lt;/a&gt;Equation 1&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;In this equation wi is the feature vector of object i and mj is the mean feature vector of class j.  The value pj is the probability or ratio of the number of elements in class j over the total population of the classes.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/StHUmHvpHCI/AAAAAAAAAag/lPo89nT8SZw/s1600-h/Equation+2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 377px; height: 198px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/StHUmHvpHCI/AAAAAAAAAag/lPo89nT8SZw/s400/Equation+2.png" alt="" id="BLOGGER_PHOTO_ID_5391323980318186530" border="0" /&gt;&lt;/a&gt;Equation 2&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Matrix C is the shared covariance matrix of all the classes and is calculated as the weighted mean of all the covariance matrices, cj, of the classes.  We calculate the covariance matrix of each class following equation 3, where m is the mean feature vector of all the objects in all classes and Wj is the matrix containing all the feature vectors of all the members of class j. Finally nj is the number of membership in a given class. &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/_O7bGRbkJNVY/StHUmuFOTmI/AAAAAAAAAao/F-RnI9TjLY0/s1600-h/Equation+3.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 274px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/StHUmuFOTmI/AAAAAAAAAao/F-RnI9TjLY0/s400/Equation+3.png" alt="" id="BLOGGER_PHOTO_ID_5391323990609251938" border="0" /&gt;&lt;/a&gt;Equation 3&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Using the feature vectors we obtained in activity 14 we use LDA to classify the objects into the four classes of heart, diamond, spade, and club.  We used the nine training objects in activity 14 to determine the covariance matrices and mean feature vector of the classes.  All the raw data we used are shown in activity 14 Table 1 and Table 2.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;Table 1.  Resulting probability of each object per class and classification results.&lt;br /&gt;(click to enlarge)&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/StGIMG_AeHI/AAAAAAAAAZo/3HkGGHeum4U/s1600-h/Table+1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 213px; height: 400px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/StGIMG_AeHI/AAAAAAAAAZo/3HkGGHeum4U/s400/Table+1.png" alt="" id="BLOGGER_PHOTO_ID_5391239970553886834" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;The result of our classification is shown on Table 1.  Again we obtain a perfect 100% classification using this set of feature vectors.  We however did not implement this method on the other 140 objects we used in activity 14.  Still we believe that a very high classification accuracy will result if done so.&lt;br /&gt;&lt;br /&gt;I give myself a grade of 10 in this activity.  I want to thank Orly, Kaye, and Jaya for answering my questions.&lt;br /&gt;&lt;br /&gt;Main Reference&lt;br /&gt;Teknomo, Kardi. “Discriminant Analysis Tutorial”. http://people.revoledu.com/kardi/ tutorial/LDAKardi&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/StGIMG_AeHI/AAAAAAAAAZo/3HkGGHeum4U/s1600-h/Table+1.png"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456440432957498316-6589888488910785506?l=ap186-msison.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ap186-msison.blogspot.com/feeds/6589888488910785506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ap186-msison.blogspot.com/2009/09/activity-15-probabilistic.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/6589888488910785506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/6589888488910785506'/><link rel='alternate' type='text/html' href='http://ap186-msison.blogspot.com/2009/09/activity-15-probabilistic.html' title='Activity 15 Probabilistic Classification'/><author><name>miguel</name><uri>http://www.blogger.com/profile/15739169920727151183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_O7bGRbkJNVY/StHUlzipgSI/AAAAAAAAAaY/8YQ9YRXMXSU/s72-c/Equation+1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456440432957498316.post-1953388523964810623</id><published>2009-09-09T18:27:00.001-07:00</published><updated>2009-10-11T04:27:29.913-07:00</updated><title type='text'>Activity 14 Pattern Recognition</title><content type='html'>&lt;div style="text-align: justify;"&gt;Us humans already have the inborn instinct or skill that allows us to recognize or differentiate one thing from the other.  And most of the time, our own observations and experiences are enough for us to learn which is which.  However machines and computers do not posses this instinct (they don't have instincts); much like how we teach babies and kids, we must also exert effort to teach machines how to recognize various things it may encounter.  The difficulty with machines is that, although their language is based on math, they are still much harder to teach compared to kids (machines are stupid).  In spite of this, the growing demand to increase productivity through automation and the physical limitations of the human body (there is just so much our body can do) pushes us to rely on machines and computers for various tasks.  This demand and need for automated machine recognition resulted to a field known as machine vision.  One sub domain of machine vision is pattern recognition which, from the name implies, basically means having a machine recognize and classify/segregate objects of patterns.  In this activity we will be using Scilab to do pattern recognition of objects from an image.  Our method for classification we will be using is the minimum distance classification.&lt;br /&gt;&lt;br /&gt;All pattern recognition problems start with having a set of patterns or objects with a finite number of classification groups or classes.  Each group or class is differentiated from each other based on a set of identifiable features and parameters.  Hence in all pattern recognition tasks the first step is selecting the parameters or features we base our differentiation from.  Since we are dealing with images it is logical that we use visually obtained information as our features.  These features may be, color, shape, size, area, etc. and we may use as many as we see fit.  We just have to remember that we need to select features that are distinctive to our objects or patterns otherwise we wont be able to classify them.  In our method we place these features into vector form.  That for each object there corresponds a vector that contains all of its features (equation 1).&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/StHA27VtwbI/AAAAAAAAAaA/uRK0B7GjI3c/s1600-h/Equation+1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 327px; height: 255px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/StHA27VtwbI/AAAAAAAAAaA/uRK0B7GjI3c/s400/Equation+1.png" alt="" id="BLOGGER_PHOTO_ID_5391302278813434290" border="0" /&gt;&lt;/a&gt;Equation 1&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The next step is to train the computer to recognize the different patterns.  In our method this simply means that for each class we select a few samples and we take the average of their feature vectors (equation 2).  This mean vector serves as the representation of the whole class; that is, each class should have a unique mean feature vector.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/StHA3elqCgI/AAAAAAAAAaI/nIJ-EJ564ag/s1600-h/Equation+2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 227px; height: 149px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/StHA3elqCgI/AAAAAAAAAaI/nIJ-EJ564ag/s400/Equation+2.png" alt="" id="BLOGGER_PHOTO_ID_5391302288275540482" border="0" /&gt;&lt;/a&gt;&lt;div style="text-align: center;"&gt;Equation 2&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The final step is to test whether our feature selection and training was sufficient.  We do this by letting the computer classify the other objects (excluding those used in training).  The accuracy of classification depends on how much of the objects were classified into their proper classes.  The minimum distance classification, which we use in this activity works by following equation 3.&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/_O7bGRbkJNVY/StHA33p5j8I/AAAAAAAAAaQ/duUMyErEF4g/s1600-h/Equation+3.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 85px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/StHA33p5j8I/AAAAAAAAAaQ/duUMyErEF4g/s400/Equation+3.png" alt="" id="BLOGGER_PHOTO_ID_5391302295004221378" border="0" /&gt;&lt;/a&gt;Equation 3&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;As in equations 1 and 2 &lt;span style="font-style: italic;"&gt;wi&lt;/span&gt; is the feature vector of object &lt;span style="font-style: italic;"&gt;i&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;mj&lt;/span&gt; is the mean feature vector of class &lt;span style="font-style: italic;"&gt;j&lt;/span&gt;.  Using this equation we simply calculate &lt;span style="font-style: italic;"&gt;d&lt;/span&gt; for each object for each class.  We then classify object&lt;span style="font-style: italic;"&gt; i&lt;/span&gt; into the class that resulted in the highest value of &lt;span style="font-style: italic;"&gt;d&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;In this activity I chose the suites of playing cards as my object class.  Since I don't have a camera, I scanned the cards and this served as my raw data.  From this images I classified whether the pattern is heart, diamond, spade, or club.  Take note that I only consider the figures as my object and not the actual playing card (in other words the 10 of spades has 10 spade objects).&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/StGxYDpUvWI/AAAAAAAAAZ4/6K_j-SCg6WY/s1600-h/Figure+1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 226px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/StGxYDpUvWI/AAAAAAAAAZ4/6K_j-SCg6WY/s400/Figure+1.png" alt="" id="BLOGGER_PHOTO_ID_5391285255792803170" border="0" /&gt;&lt;/a&gt;Figure 1&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;I used three features to construct the vectors describing each object.  The first feature is their normalized R value (see activity 12).  As expected the R value of diamond and heart is the same and so is the value of spade and club.  Diamond and heart had a very high R value whereas club and spade had a low one.  This made it easy for me to segment these objects from the background (figure 1) and calculate the other features I used.  However, the segmentation was still not perfect so I used closing and opening  (activity 8 and 9) operations to further improve the quality.&lt;br /&gt;&lt;br /&gt;The next 2 features I used both characterizes the shape of each object.  I calculated the ratio of the total area of each object with the area of the minimum rectangle that can contain the object which served as the second feature.  The area of the minimum rectangle is simply the product of the maximum dimensions of the object ([max(x)-min(x)]*[max(y)-min(y)])  The final feature was simply the ratio of the object's total area with the square of its perimeter.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;Table 1. Features and Group of Training set&lt;br /&gt;(click to enlarge)&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/StF5qmD7yrI/AAAAAAAAAZQ/Iovjog65l6Y/s1600-h/Table+1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 245px; height: 400px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/StF5qmD7yrI/AAAAAAAAAZQ/Iovjog65l6Y/s400/Table+1.png" alt="" id="BLOGGER_PHOTO_ID_5391224001617709746" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Table 1 contains all the features and group classification of the 9 samples per class I used to construct the training set and the mean feature vector of each class.  I also labeled each group such that grp 1 are hearts, grp 2 diamonds, grp 3 spades, and grp 4 clubs.  Now using the feature vectors of the other 40 objects in figure 1 (10 per suite/class) I calculated the corresponding d for each class.  Table 2 shows the result of classifying these 40 objects and we clearly see a 100% accuracy of classification.  This is further highlighted in figure 2 where I plotted the feature vectors of each object.  Although the plot of Area/maxDim vs R could not distinguish between heart and diamond, it was compensated by the other parameters as seen in the 3D plot (figure 2d).&lt;br /&gt;&lt;div style="text-align: center;"&gt;Table 2.  Parameters and Classification Results of the 40 Test Objects&lt;br /&gt;(click to enlarge)&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/StF5qf76OvI/AAAAAAAAAZI/CBfIjWNMbkU/s1600-h/Table+2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 390px; height: 400px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/StF5qf76OvI/AAAAAAAAAZI/CBfIjWNMbkU/s400/Table+2.png" alt="" id="BLOGGER_PHOTO_ID_5391223999973440242" border="0" /&gt;&lt;/a&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/StF5sLOo2NI/AAAAAAAAAZg/4Yb4OdpdkVo/s1600-h/Figure+3.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 133px; height: 400px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/StF5sLOo2NI/AAAAAAAAAZg/4Yb4OdpdkVo/s400/Figure+3.png" alt="" id="BLOGGER_PHOTO_ID_5391224028774586578" border="0" /&gt;&lt;/a&gt;(click to enlarge)&lt;br /&gt;Figure 2.   a)Area/max Dimensions vs R, b) Area/Perimeter^2 vs R, c) Area/max Dimensions vs Area/Perimeter^2, d) 3D plot R (x axis), Area/max Dimensions (y axis),  Area/Perimeter^2 (z axis).  The classes heart, diamond, spade, club are represented by the red, green, blue, black markers respectively.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;Having tested the accuracy of our method I further tested its flexibility using larger images with mixed objects (figure 3) with a total of 140 objects.  The results shown in Table 3 and Figure 4 still shows a 100% accurate classification.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/StGxXC1PoLI/AAAAAAAAAZw/my09PadzyAk/s1600-h/Figure+2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 317px; height: 400px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/StGxXC1PoLI/AAAAAAAAAZw/my09PadzyAk/s400/Figure+2.png" alt="" id="BLOGGER_PHOTO_ID_5391285238394495154" border="0" /&gt;&lt;/a&gt;Figure 3.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Table 2.  Classification Results of the 140 Test Objects in figure 3&lt;br /&gt;(click to enlarge)&lt;br /&gt;&lt;/div&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/StF5p6JhRpI/AAAAAAAAAZA/uhGbwnQsnPQ/s1600-h/Table+3.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 208px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/StF5p6JhRpI/AAAAAAAAAZA/uhGbwnQsnPQ/s400/Table+3.png" alt="" id="BLOGGER_PHOTO_ID_5391223989829977746" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/StF5riUmHqI/AAAAAAAAAZY/uMS5h-uudZo/s1600-h/Figure+4.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 132px; height: 400px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/StF5riUmHqI/AAAAAAAAAZY/uMS5h-uudZo/s400/Figure+4.png" alt="" id="BLOGGER_PHOTO_ID_5391224017793719970" border="0" /&gt;&lt;/a&gt;&lt;div style="text-align: center;"&gt;(click to enlarge)&lt;br /&gt;Figure 4.   a)Area/max Dimensions vs R, b) Area/Perimeter^2 vs R, c) Area/max Dimensions vs Area/Perimeter^2, d) 3D plot R (x axis), Area/max Dimensions (y axis), Area/Perimeter^2 (z axis).&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;I give myself a grade of 10 in this activity for a job well done.  I would like to thank Ms. Cindy Liza Esporlas for helping me scan the cards and sending me the images.  I also would like to thank Mr. Jay Samuel Combinido for teaching me to do 3D plots.&lt;br /&gt;&lt;br /&gt;Main Reference&lt;br /&gt;&lt;br /&gt;Maricor Soriano, A14 - Pattern Recognition, AP186 2008&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/5456440432957498316-1953388523964810623?l=ap186-msison.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ap186-msison.blogspot.com/feeds/1953388523964810623/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ap186-msison.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/5456440432957498316/posts/default/1953388523964810623'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/1953388523964810623'/><link rel='alternate' type='text/html' href='http://ap186-msison.blogspot.com/2009/09/activity-14-pattern-recognition.html' title='Activity 14 Pattern Recognition'/><author><name>miguel</name><uri>http://www.blogger.com/profile/15739169920727151183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_O7bGRbkJNVY/StHA27VtwbI/AAAAAAAAAaA/uRK0B7GjI3c/s72-c/Equation+1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456440432957498316.post-8410986598024614987</id><published>2009-09-09T18:26:00.000-07:00</published><updated>2009-10-09T09:15:08.996-07:00</updated><title type='text'>Activity 13 Correcting Geometric Distortion</title><content type='html'>&lt;div style="text-align: justify;"&gt;Have you ever tried looking through one of those door peepholes, the ones that allow you to see who is knocking on your door?  I, myself, have only tried it ones when I visited my cousin who lived in a hotel and the door of their room had one.  Anyway, for those of you who have tried using one, I am sure that you have also noticed that the image you see through it is highly distorted.  This geometric distortion is similar to that found in some cameras (in a much lower degree) and other instruments that use spherical lenses.  Basically geometric distortion results from the varying magnification as the distance from the optical axis increases.  The two most common forms of this optical abberation is the barrel (magnification decreases farther from the optical axis) and pincushion distortion (magnification increases farther from the optical axis).  In photography barrel distortion is commonly encountered when taking wide angle photos.  In this activity we will be correcting geometrically distorted images numerically.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/Ss9e-J1VOSI/AAAAAAAAAYI/U07DVSBtuW0/s1600-h/Figure+1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 164px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/Ss9e-J1VOSI/AAAAAAAAAYI/U07DVSBtuW0/s400/Figure+1.png" alt="" id="BLOGGER_PHOTO_ID_5390631700870281506" border="0" /&gt;&lt;/a&gt;Figure 1. Example of distorted images&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Our method of correcting geometric distortion involves two main steps.  The first step is correcting the pixel coordinates, which refers to mapping the coordinates of the distorted image back to the ideal undistorted image.  Our experience with image processing allows us to  understand that the process of distortion simply involves the ideal undistorted image and a distorting transfer function such that&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/Ss9g5O4_fUI/AAAAAAAAAYY/vrI6XWLhQ9E/s1600-h/eqn1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 327px; height: 51px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/Ss9g5O4_fUI/AAAAAAAAAYY/vrI6XWLhQ9E/s400/eqn1.png" alt="" id="BLOGGER_PHOTO_ID_5390633815351721282" border="0" /&gt;&lt;/a&gt;Equation 1&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Where T is the transfer function and f and g are the undistorted and distorted images respectively.  So given the distorted image we just need the transfer function to recover our ideal image.  However the process to determine the transfer function requires us to have information on the undistorted image.  Our method allows us to calculate the transfer function using only vertices of polygons or regularly occurring patterns present in our image.&lt;br /&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/_O7bGRbkJNVY/Ss9e9TQ0QmI/AAAAAAAAAYA/iPtrzwNkn_0/s1600-h/Figure+2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 215px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/Ss9e9TQ0QmI/AAAAAAAAAYA/iPtrzwNkn_0/s400/Figure+2.png" alt="" id="BLOGGER_PHOTO_ID_5390631686221611618" border="0" /&gt;&lt;/a&gt;Figure 2&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Consider figure 2 above where we show an undistorted and distorted polygon/grid.  assuming that the area of the polygon is not to large we can approximate the transformation as&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/Ss9g5Rau6NI/AAAAAAAAAYg/D-2wmfn5O5Q/s1600-h/eqn2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 81px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/Ss9g5Rau6NI/AAAAAAAAAYg/D-2wmfn5O5Q/s400/eqn2.png" alt="" id="BLOGGER_PHOTO_ID_5390633816030111954" border="0" /&gt;&lt;/a&gt;Equation 2&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The 8 unknown coefficients in this transformation can be solved using the for vertices of the polygon such that in matrix form&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/Ss9g56nzyBI/AAAAAAAAAYo/wSV7ZtdEDWw/s1600-h/eqn3.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 347px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/Ss9g56nzyBI/AAAAAAAAAYo/wSV7ZtdEDWw/s400/eqn3.png" alt="" id="BLOGGER_PHOTO_ID_5390633827090810898" border="0" /&gt;&lt;/a&gt;Equation 3&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;This resulting transfer function is valid for all points with in the polygon as long as it is not to large.&lt;br /&gt;&lt;br /&gt;The ideal grid required in this method can easily be generated using the least distorted area in the distorted image.  The dimensions of the least distorted "box" can be used to construct the ideal grid.  We would then just need to determine the transfer function for each pair of distorted and undistorted "boxes."  Using these transfer function we can now solve equation 2 to determine the distorted coordinates of each point in the ideal image.  That is we can now determine the graylevel values for each ideal undistorted image coordinate by copying the graylevel value of its corresponding distorted coordinate.  This is the second step of our correction process.&lt;br /&gt;&lt;br /&gt;However, most of the time our calculated distorted coordinates are not integers.  For such cases we need to interpolate the graylevel value for our ideal undistorted image.  Three commonly used interpolation techniques are the nearest neighbor, bilinear interpolation, and cubic convolution.  In this activity we choose to implement bilinear interpolation which has a much better quality than nearest neighbor and is much faster compared to cubic convolution.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/Ss9g6b8h_XI/AAAAAAAAAYw/afutuwT5hkk/s1600-h/eqn4.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 38px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/Ss9g6b8h_XI/AAAAAAAAAYw/afutuwT5hkk/s400/eqn4.png" alt="" id="BLOGGER_PHOTO_ID_5390633836036095346" border="0" /&gt;&lt;/a&gt;Equation 4&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/Ss9g6qa52oI/AAAAAAAAAY4/qoWGNlAt6II/s1600-h/eqn5.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 146px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/Ss9g6qa52oI/AAAAAAAAAY4/qoWGNlAt6II/s400/eqn5.png" alt="" id="BLOGGER_PHOTO_ID_5390633839921584770" border="0" /&gt;&lt;/a&gt;Equation 5&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Bilinear interpolation works as in equation 4.  That is, the greylevel v is assigned to the coordinate (xhat,yhat).  so by solving equation 4 we can obtain the gray values even for non-integer coordinates.  The unknown coefficients of equation 4 can likewise be determined similar to equation 3 but know we use the four nearest pixels around (xhat,yhat) (figure 3, equation 5).&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/Ss9e89C0wQI/AAAAAAAAAX4/fZaMRH8RxrU/s1600-h/Figure+3.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 253px; height: 207px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/Ss9e89C0wQI/AAAAAAAAAX4/fZaMRH8RxrU/s400/Figure+3.png" alt="" id="BLOGGER_PHOTO_ID_5390631680257343746" border="0" /&gt;&lt;/a&gt;Figure 3.  Visualization of Bilinear Interpolation&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;In this activity I used an image with barrel distortion downloaded from the internet.  Figure 4 shows the original image and the ideal grid I generated using the least distorted area in the image.  After implementing the method we have discussed I was able to remove the obvious barrel distortion of the image.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/Ss9e8Tgv0zI/AAAAAAAAAXw/qY6rvS_n2pc/s1600-h/Figure+4n5.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 119px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/Ss9e8Tgv0zI/AAAAAAAAAXw/qY6rvS_n2pc/s400/Figure+4n5.png" alt="" id="BLOGGER_PHOTO_ID_5390631669108560690" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/Ss9gphrU0gI/AAAAAAAAAYQ/awptuznCyJ4/s1600-h/result.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 339px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/Ss9gphrU0gI/AAAAAAAAAYQ/awptuznCyJ4/s400/result.png" alt="" id="BLOGGER_PHOTO_ID_5390633545516765698" border="0" /&gt;&lt;/a&gt;Figure 4.  (left) Original distorted image with indication of corrected area (red box) and area of least distortion (yellow box). (center) Ideal grid generated from area of least distortion. (right and bottom) Resulting corrected image.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The result presented in figure 4 shows that our method is very effective in removing barrel distortion.  It is clearly seen that the previously curved lines are now vertically and horizontally straight.  The bricks that previously had different sizes are now more uniform.  The only inaccuracy we can see is that some of the bricks are slightly tilted.  It is hard to determine whether they should be tilted or not but I believe it is safe to assume that most of them are squarely laid-out.  Still, even with this slight error, we see very promising and convincing results.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/Ss9e77FcREI/AAAAAAAAAXo/i6vl-DOO1qg/s1600-h/Figure+6.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 335px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/Ss9e77FcREI/AAAAAAAAAXo/i6vl-DOO1qg/s400/Figure+6.png" alt="" id="BLOGGER_PHOTO_ID_5390631662551581762" border="0" /&gt;&lt;/a&gt;&lt;div style="text-align: center;"&gt;Figure 5.  Corrected image with color.  The red circles identify areas with erroneous color.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Figure 5 shows a colored version of our result.  This was generated by implementing the correction process for the 3 color channels and combining them into one image.  This colored result shows one more error.  We clearly see that at some points have colors that are obviously not accurate.  This is because at these points one or two of the three color components are not properly represented.  Using the same reference points in all the color channels may result in some points having the wrong color component values.  In other words although the gray scale result looks almost perfect it cannot be directly implemented to a colored image and expect the same level of accuracy.&lt;br /&gt;&lt;br /&gt;I thank Ate Cherry for helping me understand the correction procedure.  I give my self a grade of 10!!&lt;br /&gt;&lt;br /&gt;Image source:&lt;br /&gt;http://www.nicovandijk.net/lenses.htm&lt;br /&gt;&lt;br /&gt;Main Reference:&lt;br /&gt;A13 – Correcting Geometric Distortions by Maricor Soriano, AP186 2009&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456440432957498316-8410986598024614987?l=ap186-msison.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ap186-msison.blogspot.com/feeds/8410986598024614987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ap186-msison.blogspot.com/2009/09/activity-13-correcting-geometric.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/8410986598024614987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/8410986598024614987'/><link rel='alternate' type='text/html' href='http://ap186-msison.blogspot.com/2009/09/activity-13-correcting-geometric.html' title='Activity 13 Correcting Geometric Distortion'/><author><name>miguel</name><uri>http://www.blogger.com/profile/15739169920727151183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_O7bGRbkJNVY/Ss9e-J1VOSI/AAAAAAAAAYI/U07DVSBtuW0/s72-c/Figure+1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456440432957498316.post-6987579605039829683</id><published>2009-08-06T09:11:00.002-07:00</published><updated>2009-08-07T04:31:57.441-07:00</updated><title type='text'>Activity 12 Color Image Segmentation</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;div style="text-align: justify;"&gt;So far we have been doing image segmentation and morphology on binary and gray-scale images.  In the past activities simple thresholding is enough to seperate our region of interest (ROI) but in some cases this wont be sufficient.  In image processing there instances where binarizing an image or converting it into gray-scale wont separate it from the background, in such cases we need to utilize its color information.  In this activity we use normalized chromaticity coordinates to do segmentation via color information.&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/_O7bGRbkJNVY/SnsOZdQdBhI/AAAAAAAAARU/sI5Pd_NcQ0A/s1600-h/chromaticity.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SnsOZdQdBhI/AAAAAAAAARU/sI5Pd_NcQ0A/s400/chromaticity.png" alt="" id="BLOGGER_PHOTO_ID_5366899211455235602" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1.  Normalize Chromaticity Coordinates&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;The normalized chromaticity coordinates (NCC), shown in figure 1, can be thought of as a way of expressing 3 dimensional RGB information to a simpler 2 Dimensional r-g color space.  The basis for this transform is that r+g+b=1 (done by normalizing RGB), hence the third value is redundant and it is enough to express color by only two values, in this case r and g.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt; After expressing an image in NCC we can now do the segmentation by using the probability distribution function (PDF) of the ROI in NCC.  By mapping the image to the PDF of the ROI we are able to separate the ROI from the rest of the image.  In this activity we calculate the PDF of the ROI using two methods, one of these is the parametric method which assumes that the PDF is a gaussian.  In the parametric method we simply obtain the mean and standard deviation of the r and g of the ROI and use this to calculate its 2 dimensional PDF.  The other method is the non-parametric method, here we do not assume any form of the PDF and we simply use the r and g (2 dimensional) histogram of the image and use this as the PDF.  In both methods we obtain the PDF of the ROI by only taking a patch of it.&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;I used an image of multicolored candies to test these two methods for color image segmentation.  Excluding the background, there are only three main colors in this image; red, orange, and green.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Figure 2 below shows the results of the segmentation using both parametric and non-parametric methods.  For both methods separating the green region was accomplished almost perfectly.  The pixelated result for the parametric method is caused by the  actual texture of the  candy and the parametric method wont be able to compensate for such a feature.  On the otherhand the holes on the result of non-parametric method are most likely due to the patch I used to sample the ROI.  This simply means that there are other colors which are part of the ROI that were not included in the sample patch.  Using a better sampled patch would improve the result in this case.&lt;br /&gt;&lt;br /&gt;Compared to the non-parametric the parametric method did not fare as well when segmenting the red or orange regions of the image.  Since the parametric method assumes a gaussian PDF it is higly probable that the PDF of the red or orange ROI includes each other.  Hence the parametric method fails when we try to separate colors that are very close to each other.&lt;br /&gt;&lt;br /&gt;The non-parametric method does not suffer from the same problem as the parametric method since it uses the actual histogram of the ROI as the PDF for mapping.  This means that even if the two colors are very close to each other there wont be any confusion as long as the other color does not appear frequently inside the ROI.  As we can see from the histograms the orange and red are very close to each other but their histograms are almost mutually exclusive.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SnsOYjwdN1I/AAAAAAAAARE/U9guV6Ga9dI/s1600-h/result_green.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 112px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SnsOYjwdN1I/AAAAAAAAARE/U9guV6Ga9dI/s400/result_green.png" alt="" id="BLOGGER_PHOTO_ID_5366899196020209490" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SnsOYIavmXI/AAAAAAAAAQ8/lTm6cN5RXlA/s1600-h/result_red.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 112px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SnsOYIavmXI/AAAAAAAAAQ8/lTm6cN5RXlA/s400/result_red.png" alt="" id="BLOGGER_PHOTO_ID_5366899188681382258" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SnsOXnNv6WI/AAAAAAAAAQ0/ulydDPNMfP0/s1600-h/result_orange.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 112px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SnsOXnNv6WI/AAAAAAAAAQ0/ulydDPNMfP0/s400/result_orange.png" alt="" id="BLOGGER_PHOTO_ID_5366899179768506722" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.  Original unsegmented image with the results of both parametric and non-parametric color segmentation.  The patch of the ROI is also included as well as its histogram.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Overall, by looking at the results, I have to say that the non-parametric method is a much better color segmentation technique.  Compared to the parametric method, the non-parametric is much more versatile, accurate, and the quality is also better.&lt;br /&gt;&lt;br /&gt;I give myself a grade of 10 in this activity.&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/5456440432957498316-6987579605039829683?l=ap186-msison.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ap186-msison.blogspot.com/feeds/6987579605039829683/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ap186-msison.blogspot.com/2009/08/activity-12-color-image-segmentation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/6987579605039829683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/6987579605039829683'/><link rel='alternate' type='text/html' href='http://ap186-msison.blogspot.com/2009/08/activity-12-color-image-segmentation.html' title='Activity 12 Color Image Segmentation'/><author><name>miguel</name><uri>http://www.blogger.com/profile/15739169920727151183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_O7bGRbkJNVY/SnsOZdQdBhI/AAAAAAAAARU/sI5Pd_NcQ0A/s72-c/chromaticity.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456440432957498316.post-1069467327613988420</id><published>2009-08-06T09:11:00.001-07:00</published><updated>2009-08-07T04:31:30.645-07:00</updated><title type='text'>Activity 11 Color Image Processing</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;div style="text-align: justify;"&gt;We have learned in our Applied Physics 187 course that an image captured by a color digital camera is composed of an array of pixels each having R, G, and B information.  These three color information are each a product of the spectral profile of the light source, objects reflectivity and the cameras spectral reflectivity for R, G, and B.  To obtain the actual appearance of the object we must divide these R, G, and B values with a scaling/balancing factor equivalent to the R, G, and B values of purely white imaged captured by the camera.  This scaling factor is just the product of the cameras sensitivity and the illuminator's spectral profile.  If the wrong scaling factor is used or it is miscalculated then the resulting image would not appear as good.  The process of applying these scaling factors to a digital image is called White Balancing.  In this activity we try out the White Patch and Gray World algorithms in doing White Balancing.&lt;br /&gt;&lt;br /&gt;To test the effectiveness of these algorithms; we take pictures of objects containing the major hues which are obviously not properly balanced.  We do so by not using the "auto white balance" function of the camera and just selecting the different balancing conditions.  In the camera we used these conditions are called "daylight", "cloudy", "fluorescent", and "incandescent".&lt;br /&gt;&lt;br /&gt;The White Patch algorithm makes use of information "obviously white" regions in the image.  That is we calculate the balancing factor by taking the average R, G, and B values within a white patch of the image.  On the other hand the Gray World algorithm assumes that the average color of the world is gray.  Since the ratio of the R, G, and B values for gray is the same as white or black, this method takes the RGB of gray and uses it for White Balancing.  In the Gray World algorithm the RGB values of gray is taken as the average R, G, and B of the whole image (whole world).&lt;br /&gt;&lt;br /&gt;We must remember though that  these White Balancing Methods wont work if the captured image is saturated, even for just a single color channel.  A saturated image actually contains no color information and would not be useful in calculating the balancing factor. &lt;br /&gt;&lt;br /&gt;Figure 1 below shows samples of captured images and their corresponding RGB channels.  The blacked out regions on the RGB channels indicate the areas of saturation and wont be useful for our purposes.  Therefore, in selecting the white patch we create a composite image (figure 1 last column) using the RGB channels that blacks out all the areas that are not useful.  For the Gray World algorithm we simply take out the saturated regions in calculating the white balancing factors.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/Snv3-yMqJGI/AAAAAAAAARs/FzHw-8vr4yY/s1600-h/Picture3.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 138px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/Snv3-yMqJGI/AAAAAAAAARs/FzHw-8vr4yY/s400/Picture3.png" alt="" id="BLOGGER_PHOTO_ID_5367156038940894306" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1.  Sample captured images with their RGB channels and a composite image&lt;br /&gt;indicating (blacked out) the areas that saturated.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Taking into account the saturated regions the results of applying the White Patch and Gray world algorithms on an image containing the major hues (RGB) are shown in figure 2 .  First let us note that the results for both White Patch and Gray world algorithms  for the incandescent and fluorescent settings are obviously wrong.  The resulting image takes on an extreme shade of blue (or red) which is clearly not the true color of the objects.  This error is mainly due to the fact that the original images taken with these settings were mostly saturated on the blue channel.  On the other hand the images taken with Daylight and Cloudy settings  were seen to improve by using the White Patch algorithm.  In the daylight setting the original image is slightly bluish which after processing took on more accurate colors of the object.s  This was also observed in the cloudy setting which initially had a reddish or brownish that was cured after processing.  As for the Gray world algorithm, it was only seen to improve the images taken with cloudy setting resulting to a final image that displayed white as "white" even better than the White Patch algorithm.&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/Snv39XTYnPI/AAAAAAAAARk/UbwC6kWTs_U/s1600-h/Picture1_a.png"&gt;&lt;img style="cursor: pointer; width: 388px; height: 400px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/Snv39XTYnPI/AAAAAAAAARk/UbwC6kWTs_U/s400/Picture1_a.png" alt="" id="BLOGGER_PHOTO_ID_5367156014541479154" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.  Original image taken with different white balancing settings and&lt;br /&gt;their respective results after applying White Patch and Gray World.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Next, figure 3 shows the results of applying White Patch and Gray World on images that had a dominant color, which in this case is blue.  Again it is observed that applying a white balance on the images taken with fluorescent and incandescent settings resulted in a dark image.  But even though these processed images are darker they are stilled considered improvements on the original since the original pictures are actually very bluish are actually worse representations of the true color of the image.  As for the results of the Daylight settings we first note that the original image actually seems to be properly white balanced.  We also see very little difference in comparing the original with the result after the White patch algorithm.  But looking at the results of the Gray world algorithm we see that the image lost its yellowish color after it was processed.  It is though to determine which is the more correct result.  Finally the image taken with the cloudy setting has a very yellowish color which is obviously not correct.  After doing the White patch we see that the yellowish color is removed which is  a significant improvement.  But after doing the Gray world algorithm the final image completely lost its yellowish shade but also became darker.&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/Snv37H6J6eI/AAAAAAAAARc/51yumTEeokE/s1600-h/Picture2_a.png"&gt;&lt;img style="cursor: pointer; width: 388px; height: 400px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/Snv37H6J6eI/AAAAAAAAARc/51yumTEeokE/s400/Picture2_a.png" alt="" id="BLOGGER_PHOTO_ID_5367155976049388002" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3.  Original image taken with different white balancing settings and their respective results after applying White Patch and Gray World.  The images have blue as the dominant color&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Overall the results suggest that in general the White Patch algorithm results in a much better white balancing.  The results of the gray world algorithm is seen to be highly dependent on the dominant color of the image.&lt;br /&gt;&lt;br /&gt;I thank ate Cherry for lending us her camera and Irene for taking the pictures.  I give my self a grade of 10 in this activity.&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/5456440432957498316-1069467327613988420?l=ap186-msison.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ap186-msison.blogspot.com/feeds/1069467327613988420/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ap186-msison.blogspot.com/2009/08/activity-11-color-image-processing.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/1069467327613988420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/1069467327613988420'/><link rel='alternate' type='text/html' href='http://ap186-msison.blogspot.com/2009/08/activity-11-color-image-processing.html' title='Activity 11 Color Image Processing'/><author><name>miguel</name><uri>http://www.blogger.com/profile/15739169920727151183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_O7bGRbkJNVY/Snv3-yMqJGI/AAAAAAAAARs/FzHw-8vr4yY/s72-c/Picture3.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456440432957498316.post-4466536093305025712</id><published>2009-08-06T09:08:00.001-07:00</published><updated>2009-08-07T10:49:09.175-07:00</updated><title type='text'>Activity 10 Preprocessing Text</title><content type='html'>&lt;div style="text-align: justify;"&gt;In our past few activities we learned various ways of manipulating images both in the frequency domain and the morphologically.  This time we will use all that we have learned to extract handwriting and other texts from a scanned document.&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/_O7bGRbkJNVY/SnxJOMPqgzI/AAAAAAAAASM/CSwS4NF6svk/s1600-h/Picture1.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 296px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SnxJOMPqgzI/AAAAAAAAASM/CSwS4NF6svk/s400/Picture1.png" alt="" id="BLOGGER_PHOTO_ID_5367245364072710962" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1. (Left) Original document and (Right) the schematic&lt;br /&gt;on how the tilt angle was calculated.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;Looking at the given document we first notice that it is slightly rotated so our first task is to straighten the document.  We do this by using the 'rotate' argument of the mogrify() function in Scilab.  This is a function that edits or distorts an image in numerous ways, in this case we do rotation.  But before we do the rotation, we must first determine the angle of tilt of the image.  We measure this angle by creating a horizontal line across the lines of the document and we calculate the angle by simple trigonometry (figure 1).  And doing this method the angle we calculated was 1.05 degrees.  The results of the rotation are shown on figure 2.&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/_O7bGRbkJNVY/SnxKqkjgAQI/AAAAAAAAASU/gNzYpoFvkM4/s1600-h/Picture2.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 283px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SnxKqkjgAQI/AAAAAAAAASU/gNzYpoFvkM4/s400/Picture2.png" alt="" id="BLOGGER_PHOTO_ID_5367246951146324226" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Figure 2.  The result of rectifying the whole image and also a selected area.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;We also note that the horizontal lines of the image are actually not needed and that it interferes with our objective.  To remove these lines we must first invert our image (white over black) and convert it to gray-scale then apply a filter or mask in inverse space.  This is similar to what we did in activity 7 and since we already know that the FT of horizontal lines would be along the vertical we simply create a mask that removes this portion of the images FT. After we apply the mask we then binarize the image to remove the background.  The mask and resulting images are shown on figure 3, Fourier transform of the image is also included.&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/_O7bGRbkJNVY/SnxR4w-4ObI/AAAAAAAAASc/CoW_JmmzknI/s1600-h/Picture3.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 195px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SnxR4w-4ObI/AAAAAAAAASc/CoW_JmmzknI/s400/Picture3.png" alt="" id="BLOGGER_PHOTO_ID_5367254891581946290" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3.  (top) The inverted image with its Fourier transform and (below) to the right is the mask used to filter the lines.  To the left is the resulting binarized image after filtering.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;After removing the lines we now go on to extracting the handwritings. We only cut a select  few regions in the image where we will extract the handwritings.  Our first step is to binarize the selected regions using a threshold just like in the past activities.  Then we did some morphological operations hoping that it would result to a clear, readable, and distinct letter characters separated from each other.  Then we label each character using bwlabel().  Unfortunately this task is very very difficult to accomplish.  The handwriting through out the document overlaps with unwanted structures.  And since the handwriting also has a lower gray value compared to the  unwanted structures separating them becomes even more difficult.  Further more if we are not careful the morphological operations destroy the letters instead of making them more distinct.  Figure 4 shows the results after morphology, here I used the skel() function of Scilab to reduce the characters to single pixel width. The results, however, show that the final product does not actually look like letters.  Still it is also true that these are actually similar to the original handwriting and to some degree each character was separated from each other.&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/_O7bGRbkJNVY/SnxoP3V4ZfI/AAAAAAAAASs/5QIgM5hCIXM/s1600-h/Picture5.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 198px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SnxoP3V4ZfI/AAAAAAAAASs/5QIgM5hCIXM/s400/Picture5.png" alt="" id="BLOGGER_PHOTO_ID_5367279477681841650" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Figure 4.  (Left) The slected area of the document with handwriting and (Right) the result by extracting the handwriting using different morphological operations.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Our last task is to find instances of the word &lt;span style="font-style: italic;"&gt;description&lt;/span&gt; with in the document.  We did this by taking a template of the word &lt;span style="font-style: italic;"&gt;description&lt;/span&gt; and correlating it with the image.  The correlation is done similar to how we did it in activity 5.  We simply multiply the FT of the template and the conjugate of the FT of the image and then take the FT of this product.  If the correlation is correct it would result to an image that have the highest value at the instances of the word &lt;span style="font-style: italic;"&gt;description&lt;/span&gt;. Figure 5 shows the template and the result of locating the instances of the word &lt;span style="font-style: italic;"&gt;description&lt;/span&gt;.  By comparing the image with the result of the correlation we see that as expected the correlation peaks at the locations of the word &lt;span style="font-style: italic;"&gt;description&lt;/span&gt;. This result means that our method for locating a template works even if the quality of the image is not ideal.&lt;br /&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/_O7bGRbkJNVY/SnxX_sQagNI/AAAAAAAAASk/k9rbIZIoaic/s1600-h/Picture4.png"&gt;&lt;img style="cursor: pointer; width: 270px; height: 400px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SnxX_sQagNI/AAAAAAAAASk/k9rbIZIoaic/s400/Picture4.png" alt="" id="BLOGGER_PHOTO_ID_5367261607642169554" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 5.  The binarized image and mask used to locate the instances of the word &lt;span style="font-style: italic;"&gt;description&lt;/span&gt;.  The result of the correlation indicating the instances is also shown at the bottom.&lt;span style="font-style: italic;"&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div style="text-align: justify;"&gt;I give myself a grade of 9 in this activity.&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/5456440432957498316-4466536093305025712?l=ap186-msison.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ap186-msison.blogspot.com/feeds/4466536093305025712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ap186-msison.blogspot.com/2009/08/activity-10-preprocessing-text.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/4466536093305025712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/4466536093305025712'/><link rel='alternate' type='text/html' href='http://ap186-msison.blogspot.com/2009/08/activity-10-preprocessing-text.html' title='Activity 10 Preprocessing Text'/><author><name>miguel</name><uri>http://www.blogger.com/profile/15739169920727151183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_O7bGRbkJNVY/SnxJOMPqgzI/AAAAAAAAASM/CSwS4NF6svk/s72-c/Picture1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456440432957498316.post-3793930769039687139</id><published>2009-08-06T08:33:00.001-07:00</published><updated>2009-08-07T07:30:00.546-07:00</updated><title type='text'>Activity 9 Binary Operations</title><content type='html'>&lt;div style="text-align: justify;"&gt;In image processing it is often more efficient if we are able to separate our region of interest (ROI) from the rest of the image. The simplest way of doing this is by binarizing the image using a threshold.  But even in binarized images having multiple ROIs offers some problems in the analysis.  Overlaps among ROIs or noise introduced by insufficient thresholding would hinder the analysis of the image.  Such problems can be addressed using different morphological operators, such us those we explored in the previous activity.  The opening operator can be used to separate ROIs that overlap while the closing operator is used to fill in holes within the ROI.  In this activity we make us of different morphological operations in improving an image of multiple disks/circles for  area estimation.&lt;br /&gt;&lt;br /&gt;To do the opening operation we first erode the image then dilate it.  This would have an effect of separating objects that were initially adjacent or slightly overlapping.  On the other hand the closing operation first erodes the image then dilates its.  The effect of this operation would be to fill in holes of solid objects.&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/_O7bGRbkJNVY/SnwxPOPdqtI/AAAAAAAAAR0/k8BBhXOIUvo/s1600-h/Circles001.jpg"&gt;&lt;img style="cursor: pointer; width: 400px; height: 330px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SnwxPOPdqtI/AAAAAAAAAR0/k8BBhXOIUvo/s400/Circles001.jpg" alt="" id="BLOGGER_PHOTO_ID_5367218993509542610" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1.  Original gray-scale image of disks.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;Our image is a gray-scale ensemble of circular disks with some that are overlapping (figure 1).  In this activity we aim to estimate the area of a single disk by taking the mean and standard deviation of the measured areas. Our first step is to cut the image into smaller images to make it more manageable for Scilab.  We cut the image in way such that the slices overlap, this increases our sampling and prevents loss of information.  Next we binarize each slice to exclude the background and highlight the disks.  Then we do opening and closing operations to separate overlapping disks and also remove the noise left after binarizing.  The structuring element I used is also a circle but is much smaller compared to those in the image.  Finally for each slice we label each white area using the function bwlabel() and then measure its area and store the information.  The results for each step we did are shown in figure 2.&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/_O7bGRbkJNVY/Snw5bpv4hJI/AAAAAAAAASE/GpUn-XRR6eE/s1600-h/sample.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 120px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/Snw5bpv4hJI/AAAAAAAAASE/GpUn-XRR6eE/s400/sample.png" alt="" id="BLOGGER_PHOTO_ID_5367228003144729746" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.  From left to right: a slice of the image, a binarized version of the slice,&lt;br /&gt;image after morphological operations, and the gray-scale labeled slice.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;After we have completed the area measurements we now express our results in the form of a histogram (figure 3 left).  Looking at the histogram we see that there are area measurements that are extremely large or small.  Intuitively we know that this are not correct measurements and are mainly due to disks that were not properly separated or those that were cut in when we sliced the image.  These measurements are outliers and we can discard them when we calculate the mean and standard deviation of the area.  Another histogram is shown on the right side of figure 3 excluding these outliers.&lt;br /&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/_O7bGRbkJNVY/Snw5bNDUxAI/AAAAAAAAAR8/9PHWqJaOsM4/s1600-h/hist.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 160px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/Snw5bNDUxAI/AAAAAAAAAR8/9PHWqJaOsM4/s400/hist.png" alt="" id="BLOGGER_PHOTO_ID_5367227995441644546" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Figure 3.  (Left) Histogram of all the measured areas and&lt;br /&gt;(Right) histogram of the measured areas excluding the outliers.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;We know calculate the mean and the standard deviation of the measured areas excluding the outliers.  Doing so we obtain a value of 501.8585      for the mean and     70.24116 for the standard deviation.  These values are well within the expected value since the disks from the raw image have a radius ranging from 12 to 14 pixels.  The mean area is the best estimate we obtained for the area of the disks whereas the standard deviation provides the range at which we can consider the areas equal or the objects the same.  That is the area of the disks is 501.8585 ± 70.24116.&lt;br /&gt;&lt;br /&gt;I will give myself a 10 in this activity.  It was difficult but I think the results I obtained were accurate enough.&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/5456440432957498316-3793930769039687139?l=ap186-msison.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ap186-msison.blogspot.com/feeds/3793930769039687139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ap186-msison.blogspot.com/2009/08/activity-9-binary-operations.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/3793930769039687139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/3793930769039687139'/><link rel='alternate' type='text/html' href='http://ap186-msison.blogspot.com/2009/08/activity-9-binary-operations.html' title='Activity 9 Binary Operations'/><author><name>miguel</name><uri>http://www.blogger.com/profile/15739169920727151183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_O7bGRbkJNVY/SnwxPOPdqtI/AAAAAAAAAR0/k8BBhXOIUvo/s72-c/Circles001.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456440432957498316.post-7254686900791043209</id><published>2009-08-06T03:45:00.000-07:00</published><updated>2009-08-06T08:32:28.466-07:00</updated><title type='text'>Activity 8 Morphological Operations</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;logic&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/SnrqlmmN89I/AAAAAAAAAQs/Chi3ZDfXL10/s1600-h/eqn.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 83px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SnrqlmmN89I/AAAAAAAAAQs/Chi3ZDfXL10/s400/eqn.png" alt="" id="BLOGGER_PHOTO_ID_5366859837702271954" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/logic&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Our previous activities dwelled  on operations, enhancements, and other image processing techniques  done in the Fourier space.  This time our activity involves morphological operations to augment or distort binary images.  In this activity we will be 'eroding' and 'dilating' binary images of a square, triangle, circle, hollow square, and a cross using different structuring elements.  But before we do this operations in Scilab we will first do some manual, 'pen and paper', predictions.&lt;br /&gt;&lt;br /&gt;A structuring element (SE) can be thought of as the distorting pattern used in morphological operations. The dilate operation results in an increase in the size of the dilated object whereas the erode operation decreases the its size. Both operations follow the shape of the structuring element.  The result of a dilation can be thought of as the collection of points that the center of the SE can occupy such that the SE and the dilated object intersects.  On the other hand the result of an erosion is the collection of points the center of the SE can occupy such that the whole SE is inside the object.&lt;br /&gt;&lt;br /&gt;The structuring elements we use in this activity are a 4x4 square, 2x4 and 4x2 rectangles, and a cross 1pixel thick and 5 pixels long per arm.  We apply the morphological operations to five shapes namely: 50x50 square, 50x30 triangle (base x height), radius 25 circle, 60x60 hollow square with 4 pixel thick arms, and a large cross 8 pixels thick and 50 pixels long per arm.&lt;br /&gt;&lt;br /&gt;Figure 1 shows the result of the dilation of these shapes.  My predictions for the square, circle, hollow square, and cross were all correct.  I was able to predict both the shape and the actual size (pixel counts) perfectly.  The square SE increased the sizes of these four shapes along the horizontal and vertical uniformly.  Hence all retained their general shape except for the circle which became slightly squarish.  As for the rectangle SE's they distorted the shapes more along their dominant axis.  Finally, the cross SE caused the shapes to have a hole on the corners similar to the cross whereas the circle slightly had a greater increase along the horizontal and vertical.&lt;br /&gt;&lt;br /&gt;I only made a mistake in predicting the result of the triangle.  I got the proper shape right but the actual dimensions were off.  I was confused on how the edges and the corners of the triangle would result.  Compared to the results my predictions were slightly smaller.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/Snq5aa7S1UI/AAAAAAAAAQk/rAQdVJ8SU3Y/s1600-h/Dilation.png"&gt;&lt;img style="cursor: pointer; width: 349px; height: 400px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/Snq5aa7S1UI/AAAAAAAAAQk/rAQdVJ8SU3Y/s400/Dilation.png" alt="" id="BLOGGER_PHOTO_ID_5366805769521124674" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1.  Result of the dilation of five shapes (left column)&lt;br /&gt;with four different structuring elements (top row).&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Next, figure 2 shows the result when the shapes are eroded.  Again my predictions were mostly correct but this time I was only wrong for the circle eroded with the cross SE.  The results for erosion using the square and rectangle SE were simply the opposite of their dilation.  The interesting result here is for the cross SE on the hollow square and cross.  As I predicted only the corners of the hollow square can fit the cross SE, hence its edges would vanish upon erosion.  As for the cross SE on cross it is interesting to see that near the center the resulting shape is thicker.  This is because near the intersection of the cross there are more points where the cross SE can fit.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/Snq5aOzEgDI/AAAAAAAAAQc/HvvXfdrbf3Y/s1600-h/Erotion.png"&gt;&lt;img style="cursor: pointer; width: 349px; height: 400px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/Snq5aOzEgDI/AAAAAAAAAQc/HvvXfdrbf3Y/s400/Erotion.png" alt="" id="BLOGGER_PHOTO_ID_5366805766265405490" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.  Result of the erosion of five shapes (left column)&lt;br /&gt;with four different structuring elements (top row).&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The last part of this activity involves exploring the thin and skel functions of Scilab.  Figure 3 shows an image included in the SIP package which we chose to apply thin and skel on.  Figure 4 shows the result of thin,  just like in its description thin removes the edges of a figure until it becomes a skeleton of the original image.  But the result seen in figure 4 is not actually a good skeleton of figure 3, which is part of the limitations of thin.  Finally figure 5 shows the result of using the skel function on figure 3.  skel is a better function that thin because (1) you can controll what type of algorithm is used and (2) both exterior and interior skeletons can be obtained.  The output of skel is also in gray-scale which means we can controll the sensitivity of the resulting skeleton using im2bw() with variable threshold.  Further more skel is an actual function designed to take the skeleton of an image not like thin.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/Snq5Z9IQkPI/AAAAAAAAAQU/tRO1etnmt_U/s1600-h/birds.png"&gt;&lt;img style="cursor: pointer; width: 300px; height: 279px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/Snq5Z9IQkPI/AAAAAAAAAQU/tRO1etnmt_U/s400/birds.png" alt="" id="BLOGGER_PHOTO_ID_5366805761522438386" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3.  Image of Birds (Escher)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/Snq5ZeRHVII/AAAAAAAAAQM/FSKxrSR3R4A/s1600-h/thin.png"&gt;&lt;img style="cursor: pointer; width: 300px; height: 279px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/Snq5ZeRHVII/AAAAAAAAAQM/FSKxrSR3R4A/s400/thin.png" alt="" id="BLOGGER_PHOTO_ID_5366805753238082690" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 4.  Result of applying thin on figure 4.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/Snq5Ze0epYI/AAAAAAAAAQE/BK_bwfjGIbk/s1600-h/skel.png"&gt;&lt;img style="cursor: pointer; width: 300px; height: 279px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/Snq5Ze0epYI/AAAAAAAAAQE/BK_bwfjGIbk/s400/skel.png" alt="" id="BLOGGER_PHOTO_ID_5366805753386411394" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 5.  Result of applying skel on figure 4, taking both&lt;br /&gt;exterior and interior skeletons and using exact euclidian algorithm.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Information on the functions skel and thin is included in the help and documentation of Scilab.&lt;br /&gt;&lt;br /&gt;I give my self a grade of 10 in this activity.&lt;br /&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/5456440432957498316-7254686900791043209?l=ap186-msison.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ap186-msison.blogspot.com/feeds/7254686900791043209/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ap186-msison.blogspot.com/2009/08/activity-8-morphological-operations.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/7254686900791043209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/7254686900791043209'/><link rel='alternate' type='text/html' href='http://ap186-msison.blogspot.com/2009/08/activity-8-morphological-operations.html' title='Activity 8 Morphological Operations'/><author><name>miguel</name><uri>http://www.blogger.com/profile/15739169920727151183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_O7bGRbkJNVY/SnrqlmmN89I/AAAAAAAAAQs/Chi3ZDfXL10/s72-c/eqn.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456440432957498316.post-2475805122919589670</id><published>2009-07-20T18:29:00.001-07:00</published><updated>2009-08-06T07:15:43.144-07:00</updated><title type='text'>Activity 7 Enhancement in the Frequency Domain</title><content type='html'>&lt;div style="text-align: justify;"&gt;In the past few activities we familiarized ourselves with the use and applications of the 2-dimensional Fourier Transform.  Along with the basic properties of the 2-dimensional FT,we also learned and observed the effects of imaging with convolutions and correlations.  When we think about it, the past few activities were exercises geared to build on our skills for manipulation in the inverse space or frequency domain.  In this activity we utilize the skills we learned to do image enhancements in inverse space.&lt;br /&gt;&lt;br /&gt;Most of the time, when we do image processing and analysis, it is more appropriate to do manipulations in the frequency domain.  For example, unwanted repetitive patterns over an image would be very difficult to remove without loss of important information.  Such tasks can be easily handled when by going into the frequency domain. As we have seen in the previous activities, repetitive patterns are just represented by a few points or lines in inverse space and removing them becomes much simpler.  In this activity we will be doing similar tasks in enhancing images of fingerprints, paintings, etc.&lt;br /&gt;&lt;br /&gt;The first part of this activity is again aimed to further familiarize ourselves with inverse space.  Here we compare the FT of different structures, namely: single points, circles, squares, and gaussians.  We can see on Figure 1 below shows the Fourier transform of two single pixel dots compared with the Fourier transforms of two circles of different radius.  As expected the Ft of the single pixel dots are multiple parallel lines just like a sinusoid in activity 6.  On the other hand the FT of the two circles are very similar to the multiplication of the FT of the two dots and that of a circle (airy disk).  When we think about it the image of these two circles is just like the convolution of the two dots and a circle of the same radius.  Hence in inverse space the result should be the product of their FT, as seen in figure 1.  Increasing the radius of the circle simply results to a decrease in the size of the FT pattern, similar to our results in previous activities.&lt;br /&gt;&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/_O7bGRbkJNVY/Snqn0AQHaWI/AAAAAAAAAP8/O3s3SLTn5OU/s1600-h/circles.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 158px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/Snqn0AQHaWI/AAAAAAAAAP8/O3s3SLTn5OU/s400/circles.png" alt="" id="BLOGGER_PHOTO_ID_5366786417827998050" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1.  1st column: Two single pixel dots and its FT.&lt;br /&gt;2nd-5th column: Two circles of varying radius with FT&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Figures 2 and 3 below are just like figure 1 except that the objects are squares and gaussians respectively.  Again as expected the FT patterns are simply the product of the FT of the two dots and the objects.  That is the FT of a square is two perpendicular sinc patterns and for a gaussian the FT is also a gaussian.  The behavior of the FT with varying object size is still the same (inversely proportional).&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/Snqnzq24dNI/AAAAAAAAAP0/rKYZGeaIaLk/s1600-h/squares.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 158px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/Snqnzq24dNI/AAAAAAAAAP0/rKYZGeaIaLk/s400/squares.png" alt="" id="BLOGGER_PHOTO_ID_5366786412085015762" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2.  1st column: Two single pixel dots and its FT.&lt;br /&gt;2nd-5th column: Two squares of varying side length with FT&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/SnqnzVTeTwI/AAAAAAAAAPs/4xa5NACpd0E/s1600-h/gaussians.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 158px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SnqnzVTeTwI/AAAAAAAAAPs/4xa5NACpd0E/s400/gaussians.png" alt="" id="BLOGGER_PHOTO_ID_5366786406299356930" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3.  1st column: Two single pixel dots and its FT.   2nd-5th column:&lt;br /&gt;Two gaussians of varying spread (standard deviation/sigma) with FT&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: justify;"&gt;Next we explore the difference in the FT of an inverted gaussian.  Figure 4 shows the gaussian and inverted gaussian patterns with different standard deviations.  When we look at their normalized FT we see no difference at all so instead we compare their Real and Imaginary parts.&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/Snqny_tLDDI/AAAAAAAAAPk/xJr3UjqEyzM/s1600-h/InvGaus.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 200px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/Snqny_tLDDI/AAAAAAAAAPk/xJr3UjqEyzM/s400/InvGaus.png" alt="" id="BLOGGER_PHOTO_ID_5366786400501566514" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 4.  Double Gaussian pattern of different spreads and their inverted counterparts.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Figure 4 and 5 shows the comparison of the real and imaginary parts of the gaussian and inverted gaussian FT's.  First let me say that though the images look like they are just flat gray images there are actually fine detail around the center which can be seen when the images are enlarged.  Still even with very close inspection there are hardly any difference with the gaussian and inverted gaussian.  But this is actually expected since inverting the gaussian simply involves multiplying by -1 which can be factored out of the transform.  This simply results to a switching of the high and low values of the FT Real and Imaginary parts which is, in this case, hardly distinguishable.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/Snqm7UeEi3I/AAAAAAAAAPc/8Fv6wKsNjUg/s1600-h/Real.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 343px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/Snqm7UeEi3I/AAAAAAAAAPc/8Fv6wKsNjUg/s400/Real.png" alt="" id="BLOGGER_PHOTO_ID_5366785444002696050" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 5.  Real part of the Fourier transform of the gaussian and inverted gaussian.  The large image corresponds to the first gaussian and inverse gaussian pattern (figure 4) and the other three pairs are for the succeeding gaussian patterns.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/Snqm67RXI5I/AAAAAAAAAPU/qwxCcy3YXqE/s1600-h/Imag.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 342px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/Snqm67RXI5I/AAAAAAAAAPU/qwxCcy3YXqE/s400/Imag.png" alt="" id="BLOGGER_PHOTO_ID_5366785437238502290" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 6.  Imaginary part of the Fourier transform of the gaussian and inverted gaussian.  The large image corresponds to the first gaussian and inverse gaussian pattern (figure 4) and the other three pairs are for the succeeding gaussian patterns.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The second part of this activity involves enhancing a fingerprint image using inverse space filtering.  We do this by applying a mask to remove the &lt;span style="font-style: italic;"&gt;'unwanted' &lt;/span&gt;regions in the FT of the finger print.  Then we take the inverse Fourier transform of the masked FT and hope to obtain clearer and sharper fingerprint pattern.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Figure 7 shows the original fingerprint image and its Fourier transform.  Looking at the original image we see that aside from the fingerprint a background pattern is present.  This background  pattern is probably the grain of the paper which  only interferes with the fingerprint pattern.  We will remove this background by applying a mask on the FT of the image.  To create the mask we must first observe the FT pattern and determine which regions most likely contribute to the fingerprint.  Once we have determined this region we will create a mask that only retains this part of the FT.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/Snqm6NxNCOI/AAAAAAAAAPM/OWoWTq7igx4/s1600-h/finger.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 195px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/Snqm6NxNCOI/AAAAAAAAAPM/OWoWTq7igx4/s400/finger.png" alt="" id="BLOGGER_PHOTO_ID_5366785425024026850" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 7.  Original fingerprint image and its FT.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;We can see from the FT in figure 7 that the center, having a much higher magnitude, contains most of the information of the image.  Removing the center would result to losing not only the background but virtually the whole image.  We also note that there are also two curved regions in the FT that are brighter than the other areas and most likely contain information on the fingerprint.  Using these observations we now create a mask that enhances this regions hoping that it would result to an enhanced fingerprint.&lt;br /&gt;&lt;br /&gt;Figure 8 below shows three different filtering masks I used, hoping to enhance the fingerprint.   The first mask was made by simply blacking out all unwanted regions in the FT.  The second  mask was generated by creating two gaussians and rotating them about the center.  Finally  the last mask is a convolution of 2 gaussians with the first mask.  Each of these masks highlights the regions I mentioned above and should produce an enhanced fingerprint.  But as I found out using just one of these masks did not enhance the fingerprint enough to be considered a successful enhancement.  So after numerous trials and even more errors I ended up using a combination of these three patterns, multiplying them with different scaling factors, to produce a good enough enhancement of the fingerprint (figure 9).&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/Snqm54RIwEI/AAAAAAAAAPE/uL6V2nWfx3w/s1600-h/finger_masks.png"&gt;&lt;img style="cursor: pointer; width: 131px; height: 400px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/Snqm54RIwEI/AAAAAAAAAPE/uL6V2nWfx3w/s400/finger_masks.png" alt="" id="BLOGGER_PHOTO_ID_5366785419252383810" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 8.  Three different filtering mask used together to&lt;br /&gt;obtain an enhanced fingerprint pattern.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Figure 9 is a comparison of the original fingerprint and the enhanced one.  The left image is the original fingerprint which was inverted and cropped.  The right image is the resulting enhancement after the left image was filtered with the masks in figure 8.  Comparing the two images we first note that in the enhanced fingerprint the background paper grain patter is not visible anymore.  Moreover the text on the background have been significantly reduced.  The most notable improvement though is that the fingerprint itself is much clearer.  The lines are thinner and sharper,  the overall fingerprint is also more uniform in color, and some lines are now distinguishable.  But looking at the right edge of the fingerprint we can see some loss.  A small part of the lower right edge of the fingerprint can not be seen clearly.  Still this is a considerable improvement from the original.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/Snqm5UI1niI/AAAAAAAAAO8/y1-cJQX73Go/s1600-h/finger_result.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 198px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/Snqm5UI1niI/AAAAAAAAAO8/y1-cJQX73Go/s400/finger_result.png" alt="" id="BLOGGER_PHOTO_ID_5366785409553899042" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 9.  Inverted original fingerprint image and the enhanced fingerprint image using frequency domain filtering.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The third part of the activity involves removing vertical lines found in a composite image of stitched photographs of the moon.  This task is considerably much simpler compared to the enhancing a fingerprint.  For this task it is clear what structure of the image we do not want and we simply need to create a mask that removes this in the frequency domain.&lt;br /&gt;&lt;br /&gt;Figure 10 shows the original and gray-scale image of the moon and in this two images the unwanted vertical lines are clearly seen.  But from our previous activities we know that this array of vertical lines is represented by areas along the horizontal of the FT so we create a mask to filter this region out (figure 10).&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/Snql-3h48SI/AAAAAAAAAO0/ScIo4X9eF1k/s1600-h/moon.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 302px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/Snql-3h48SI/AAAAAAAAAO0/ScIo4X9eF1k/s400/moon.png" alt="" id="BLOGGER_PHOTO_ID_5366784405441933602" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 10.  Original moon image and below it is the gray-scale image.&lt;br /&gt;To the right is the FT and to the lower right is the filtering mask used.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Using the mask in figure 10 we removed the vertical lines and the result is seen on figure 11.  The left image in figure 11 shows the resulting image after the mask was applied.  It is clearly seen that there are no more vertical lines present in the image.  But the final image is also seen to be darker than the original and the lighting is also different.  This is probably due to some losses caused by the mask but was not enough to distort the detail in the photograph.  Still the objective was achieved and there was very little lost information.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/Snql9jirX5I/AAAAAAAAAOs/kXH2zFOk7yU/s1600-h/moon_result.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 149px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/Snql9jirX5I/AAAAAAAAAOs/kXH2zFOk7yU/s400/moon_result.png" alt="" id="BLOGGER_PHOTO_ID_5366784382896660370" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 11.  Gray-scale images of the original moon surface and&lt;br /&gt;the resulting image after the mask was applied.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The last part of this activity is aimed to enhance an image of a section of a painting.  The canvass weave is clearly seen in this image and distorts the brush strokes and the actual painting.  Again we use a mask to remove this canvass weave and recover a clearer image.  Figure 12 shows the original and gray-scale image of the painting as well as the FT.  We know that since the canvass weave is repetitive then its image in the inverse space are probably symmetric points.  So from the FT we identify areas that might be part of the weave and then create a mask to remove this areas.  The mask I used is also shown in figure 12.  We can see that the mask removes only selected symmetric bright points in the FT.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/Snql8mm76BI/AAAAAAAAAOk/TbW0BFl4u_4/s1600-h/canvass.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 290px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/Snql8mm76BI/AAAAAAAAAOk/TbW0BFl4u_4/s400/canvass.png" alt="" id="BLOGGER_PHOTO_ID_5366784366539958290" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 12.  Original and Gray-scale image of the painting, the Fourier transform&lt;br /&gt;and the mask used to remove the canvass weave.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Figure 13 shows the resulting image after the mask was applied.  It is clearly seen that most of the canvass weave has been removed and the painting has much more distinguishable detail.  But when we look closely there are still some traces of the canvass weave.  The enhancement may not be perfect but the canvass weaved was sufficiently removed, enough to highlight the brushstrokes and details of the painting.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/Snql7nCbFgI/AAAAAAAAAOc/r_vL9C4dZkk/s1600-h/canvass_result.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 144px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/Snql7nCbFgI/AAAAAAAAAOc/r_vL9C4dZkk/s400/canvass_result.png" alt="" id="BLOGGER_PHOTO_ID_5366784349475378690" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 13.  Gray-scale image of the painting and the&lt;br /&gt;resulting image after applying the filtering mask.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Finally we look at the Fourier transform of the mask with the idea that it should result to the canvass weave,  but as seen in figure 14 this is not exactly the case.  The FT of the mask does resemble the canvass weave but the intensity is not uniform.  An elliptic figure seems to be distort the canvass weave pattern.  And also along the edges there are lines that cut across the uniformity of the pattern.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/Snql636jjNI/AAAAAAAAAOU/y-Kggbm-uIM/s1600-h/canvass_weave.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 144px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/Snql636jjNI/AAAAAAAAAOU/y-Kggbm-uIM/s400/canvass_weave.png" alt="" id="BLOGGER_PHOTO_ID_5366784336825912530" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Figure 14.  Inverted image of the mask and the FT.  The FT mimics&lt;br /&gt;the canvass weave pattern with some obvious distortions.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;I got the fingerprint image using google image search but I forgot where (sorry).  I give my self a grade of 9 in this activity since the results were not perfect.&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/5456440432957498316-2475805122919589670?l=ap186-msison.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ap186-msison.blogspot.com/feeds/2475805122919589670/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ap186-msison.blogspot.com/2009/07/activity-7-enhancement-in-frequency.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/2475805122919589670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/2475805122919589670'/><link rel='alternate' type='text/html' href='http://ap186-msison.blogspot.com/2009/07/activity-7-enhancement-in-frequency.html' title='Activity 7 Enhancement in the Frequency Domain'/><author><name>miguel</name><uri>http://www.blogger.com/profile/15739169920727151183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_O7bGRbkJNVY/Snqn0AQHaWI/AAAAAAAAAP8/O3s3SLTn5OU/s72-c/circles.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456440432957498316.post-7896141005579685194</id><published>2009-07-08T19:37:00.000-07:00</published><updated>2009-07-09T07:03:25.742-07:00</updated><title type='text'>Activity 6 Properties of the 2D Fourier Transform</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;div style="text-align: justify;"&gt;In Physics, the Fourier Transform is widely used in various applications, including signal processing and analysis, modeling, and many more.  The 2D Fourier Transform, in particular, is very useful in optics; calculations in the inverse space utilizes the Fourier Transform.  In this activity we further improve our familiarity with the Fast Fourier Transform functions of Scilab and also the properties of the 2D Fourier Transform.&lt;br /&gt;&lt;br /&gt;For the first part of this activity we generate some common shapes with familiar Fourier Transforms; figure 1 shows these shapes together with their 2D Fourier Transform.  Note that the  FT of a circle is an airy disk, while the FT of a double slit look very much like Young's double slit experiment.  As for the square, we know that the Ft of a rectangular wave is the sinc function so the Ft of a square will resemble sinc functions along the x axis and y axis.  Finally we can see that the FT of two dots is very much like a sinusoid (or cosine) pattern which is expected since the FT of a cosine is 2 peaks.&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlVY4pp8iAI/AAAAAAAAAJc/Yv3dUp4w-Ik/s1600-h/square.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlVY4pp8iAI/AAAAAAAAAJc/Yv3dUp4w-Ik/s400/square.png" alt="" id="BLOGGER_PHOTO_ID_5356285062104778754" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/SlVY5AOoPOI/AAAAAAAAAJs/DRkLp_dxn8g/s1600-h/Fsquare.png"&gt; &lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SlVY5AOoPOI/AAAAAAAAAJs/DRkLp_dxn8g/s400/Fsquare.png" alt="" id="BLOGGER_PHOTO_ID_5356285068164218082" border="0" /&gt;&lt;/a&gt;&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/_O7bGRbkJNVY/SlVY438Lr7I/AAAAAAAAAJk/xEXs1Ebt-wc/s1600-h/square_a.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlVY438Lr7I/AAAAAAAAAJk/xEXs1Ebt-wc/s400/square_a.png" alt="" id="BLOGGER_PHOTO_ID_5356285065939365810" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlVY5HNVHOI/AAAAAAAAAJ0/86KdrwBmJLQ/s1600-h/Fsquare_a.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlVY5HNVHOI/AAAAAAAAAJ0/86KdrwBmJLQ/s400/Fsquare_a.png" alt="" id="BLOGGER_PHOTO_ID_5356285070037818594" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlVY5cQReLI/AAAAAAAAAJ8/6fy3EOanzNE/s1600-h/cirlce.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlVY5cQReLI/AAAAAAAAAJ8/6fy3EOanzNE/s400/cirlce.png" alt="" id="BLOGGER_PHOTO_ID_5356285075687307442" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlVZI27e7JI/AAAAAAAAAKM/rG_3kgi9XrE/s1600-h/Fcircle.png"&gt; &lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlVZI27e7JI/AAAAAAAAAKM/rG_3kgi9XrE/s400/Fcircle.png" alt="" id="BLOGGER_PHOTO_ID_5356285340545903762" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlVZInNVsjI/AAAAAAAAAKE/raeB_-2SBDA/s1600-h/cirlce_a.png"&gt; &lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlVZInNVsjI/AAAAAAAAAKE/raeB_-2SBDA/s400/cirlce_a.png" alt="" id="BLOGGER_PHOTO_ID_5356285336325829170" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlVZJE1exmI/AAAAAAAAAKU/_NkjaGjMIQE/s1600-h/Fcircle_a.png"&gt; &lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlVZJE1exmI/AAAAAAAAAKU/_NkjaGjMIQE/s400/Fcircle_a.png" alt="" id="BLOGGER_PHOTO_ID_5356285344278824546" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlVZJJB1UoI/AAAAAAAAAKc/eRiTJTSSTBE/s1600-h/dots.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlVZJJB1UoI/AAAAAAAAAKc/eRiTJTSSTBE/s400/dots.png" alt="" id="BLOGGER_PHOTO_ID_5356285345404375682" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/SlVZevyyDrI/AAAAAAAAAK0/go-jCuXlUZA/s1600-h/Fdots.png"&gt; &lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SlVZevyyDrI/AAAAAAAAAK0/go-jCuXlUZA/s400/Fdots.png" alt="" id="BLOGGER_PHOTO_ID_5356285716587482802" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlVZJWFVIoI/AAAAAAAAAKk/VhQv7r5-2Qk/s1600-h/slit.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlVZJWFVIoI/AAAAAAAAAKk/VhQv7r5-2Qk/s400/slit.png" alt="" id="BLOGGER_PHOTO_ID_5356285348908704386" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlVZeYCN9JI/AAAAAAAAAKs/F6jL3zb9lCI/s1600-h/Fslit.png"&gt; &lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlVZeYCN9JI/AAAAAAAAAKs/F6jL3zb9lCI/s400/Fslit.png" alt="" id="BLOGGER_PHOTO_ID_5356285710209774738" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1. Different shapes or patterns generated using Scilab&lt;br /&gt;and their corresponding Fourier Transform&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The second part of the activity is aimed to familiarize ourselves with the properties of the 2D Fourier Transform using 2D sinusoid patterns.  The sine function was chosen since, as I have said, the absolute value of the FT of a sinusoid (or cosine) is known to be 2 peaks.&lt;br /&gt;&lt;br /&gt;Figure 2 below shows the 2D Fourier Transform of sinusoid patterns with different frequencies.  As expected, the FT images contain 2 peaks vertically symmetric about the center.  Also as the frequency of the sinusoid is increased we observe that the peaks move away from the center.  This is also the expected result since low frequencies are concentrated on the center.  Finally we see that with higher frequency the FT deviates slightly from a spot.  For the higher frequencies the spots of the FT is less distinct and is slightly spread, which is probably due to aliasing.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/SlVZe-0RI6I/AAAAAAAAAK8/hX0-vgrvJHs/s1600-h/sin_1.png"&gt;&lt;img style="cursor: pointer; width: 100px; height: 100px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SlVZe-0RI6I/AAAAAAAAAK8/hX0-vgrvJHs/s400/sin_1.png" alt="" id="BLOGGER_PHOTO_ID_5356285720620245922" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlVZ0wZjaYI/AAAAAAAAALU/8Z1bniCMy9o/s1600-h/Fsin_1.png"&gt;&lt;img style="cursor: pointer; width: 100px; height: 100px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlVZ0wZjaYI/AAAAAAAAALU/8Z1bniCMy9o/s400/Fsin_1.png" alt="" id="BLOGGER_PHOTO_ID_5356286094707222914" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlVZe4TTBbI/AAAAAAAAALE/buuNQRIR1gg/s1600-h/sin_4.png"&gt;&lt;img style="cursor: pointer; width: 100px; height: 100px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlVZe4TTBbI/AAAAAAAAALE/buuNQRIR1gg/s400/sin_4.png" alt="" id="BLOGGER_PHOTO_ID_5356285718871344562" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlVZ1EoJwVI/AAAAAAAAALc/RTtigIXHuT8/s1600-h/Fsin_4.png"&gt;&lt;img style="cursor: pointer; width: 100px; height: 100px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlVZ1EoJwVI/AAAAAAAAALc/RTtigIXHuT8/s400/Fsin_4.png" alt="" id="BLOGGER_PHOTO_ID_5356286100137165138" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlVZfVumuGI/AAAAAAAAALM/3Mk7Wbflvys/s1600-h/sin_40.png"&gt;&lt;img style="cursor: pointer; width: 100px; height: 100px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlVZfVumuGI/AAAAAAAAALM/3Mk7Wbflvys/s400/sin_40.png" alt="" id="BLOGGER_PHOTO_ID_5356285726770509922" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlVZ1MKN_jI/AAAAAAAAALk/-jwYAuD_Yg8/s1600-h/Fsin_40.png"&gt;&lt;img style="cursor: pointer; width: 100px; height: 100px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlVZ1MKN_jI/AAAAAAAAALk/-jwYAuD_Yg8/s400/Fsin_40.png" alt="" id="BLOGGER_PHOTO_ID_5356286102159097394" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2. Sinusoid patterns of different frequencies with their Fourier Transforms.&lt;br /&gt;The frequencies are 1, 4, 40, from top to bottom.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;For the next part we explore the effect of combining different functions, specifically a sine with an added constant bias and 2 sine functions with different frequencies.  The base sinusoid we used has a frequency of 4 (figure 2 mid row) and we see that by adding a constant bias (figure 3 top row) that the FT only differs by the appearance of a central spot.  This central spot corresponds to a 0 frequency signal which is exactly the constant bias.  As for the 2 sinusoids, we simply added the sinusoid with frequencies 4 and 1.  And again we see that the resulting FT is simply  just the addition or superposition of their FT seen on figure 2.  There for in general we can say that in 2D Fourier Transform the FT of an addition of 2 functions is just the addition of their FT. &lt;br /&gt;&lt;br /&gt;Real life signals obtained from actual sensors usually contain a constant bias.  For example, an interferogram as detected by a photodiode most likely rides above a bias.  In trying to recover the frequencies of such a signal by taking its Fourier Transform, you would sure obtain a high valued zero order or zero frequency term just like in the top row of figure 3.  If we want to recover the signal we can just ignore the zero order.  But if it is too strong that it floods out the signal it would be better to just center your signal at zero.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/SlVdjUc3MeI/AAAAAAAAANk/G8qsUDE6twM/s1600-h/B_sin.png"&gt;&lt;img style="cursor: pointer; width: 100px; height: 100px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SlVdjUc3MeI/AAAAAAAAANk/G8qsUDE6twM/s400/B_sin.png" alt="" id="BLOGGER_PHOTO_ID_5356290193193644514" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlVZ1qkozwI/AAAAAAAAAL0/AiNFTFS8_LE/s1600-h/FB_sin.png"&gt;&lt;img style="cursor: pointer; width: 100px; height: 100px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlVZ1qkozwI/AAAAAAAAAL0/AiNFTFS8_LE/s400/FB_sin.png" alt="" id="BLOGGER_PHOTO_ID_5356286110322970370" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlVa5BpLrFI/AAAAAAAAAM8/-BqBlaABVeg/s1600-h/2_sin.png"&gt;&lt;img style="cursor: pointer; width: 100px; height: 100px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlVa5BpLrFI/AAAAAAAAAM8/-BqBlaABVeg/s400/2_sin.png" alt="" id="BLOGGER_PHOTO_ID_5356287267567283282" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlVa5HCz4aI/AAAAAAAAANE/k71gSzXa7Ow/s1600-h/F2_sin.png"&gt;&lt;img style="cursor: pointer; width: 100px; height: 100px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlVa5HCz4aI/AAAAAAAAANE/k71gSzXa7Ow/s400/F2_sin.png" alt="" id="BLOGGER_PHOTO_ID_5356287269016953250" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3.  (top) A sinusoid of frequency 4 with a constant bias and&lt;br /&gt;(bottom) addition of sinusoids with frequencies 1 and 4.  Beside them are their FT.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;In figure 4 we see the effect of rotating the sinusoid pattern.  Looking at the images we see that the FT is still 2 peaks except that it is also rotated.  And just like in figure 2 the location of the peaks are symmetric about the center, also the line joining the 2 peaks is perpendicular to the pattern (same with figure 2).&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlVaFPnC4QI/AAAAAAAAAMM/ehRVuJTpzcQ/s1600-h/sin_rotate.png"&gt;&lt;img style="cursor: pointer; width: 100px; height: 100px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlVaFPnC4QI/AAAAAAAAAMM/ehRVuJTpzcQ/s400/sin_rotate.png" alt="" id="BLOGGER_PHOTO_ID_5356286377963217154" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlVaFVjqRII/AAAAAAAAAMU/POJ_HKg_5bk/s1600-h/Fsin_rotate.png"&gt;&lt;img style="cursor: pointer; width: 100px; height: 100px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlVaFVjqRII/AAAAAAAAAMU/POJ_HKg_5bk/s400/Fsin_rotate.png" alt="" id="BLOGGER_PHOTO_ID_5356286379559634050" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 4. Rotated sinusoid and its Fourier Transform.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;We know look at the effect of combining a sinusoid pattern along the horizontal and the vertical.  The first result is a multiplication of the two patterns, which resulted in a checkered pattern.  The resulting FT of this pattern have 4 peaks, still symmetric about the center, but looks to be located at the corners of a smaller square.  This makes sense since the pattern actually looks like an addition of 2 perpendicular sinusoids (horizontal and vertical) rotated by 45 degrees.  In other words we see a pattern with a periodicity that is angled by 45 degrees.  The next set of images is just an addition of a vertical and a horizontal sinusoid patterns.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/SlVaUR8XCRI/AAAAAAAAAMk/R3Bz4RZ8Qak/s1600-h/sinXY.png"&gt;&lt;img style="cursor: pointer; width: 100px; height: 100px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SlVaUR8XCRI/AAAAAAAAAMk/R3Bz4RZ8Qak/s400/sinXY.png" alt="" id="BLOGGER_PHOTO_ID_5356286636287527186" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlVaUwaPvXI/AAAAAAAAAM0/WAbkRslPJwU/s1600-h/FsinXY.png"&gt; &lt;img style="cursor: pointer; width: 100px; height: 100px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlVaUwaPvXI/AAAAAAAAAM0/WAbkRslPJwU/s400/FsinXY.png" alt="" id="BLOGGER_PHOTO_ID_5356286644465941874" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlVaUAlz73I/AAAAAAAAAMc/XbN4JZaJtKM/s1600-h/sinXpY.png"&gt;&lt;img style="cursor: pointer; width: 100px; height: 100px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlVaUAlz73I/AAAAAAAAAMc/XbN4JZaJtKM/s400/sinXpY.png" alt="" id="BLOGGER_PHOTO_ID_5356286631629549426" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlVaUuQzX2I/AAAAAAAAAMs/TgDdAySsL1M/s1600-h/FsinXpY.png"&gt; &lt;img style="cursor: pointer; width: 100px; height: 100px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlVaUuQzX2I/AAAAAAAAAMs/TgDdAySsL1M/s400/FsinXpY.png" alt="" id="BLOGGER_PHOTO_ID_5356286643889463138" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 5. (top) Multiplication and (bottom)  addition of a vertical&lt;br /&gt;and horizontal sinusoid with their Fourier Transforms.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Finally we make a pattern by adding multiple sinusoid patterns each rotated by an arbitrary angle.  The resulting pattern doesn't seem to mimic the previous pattern we have presented but still looks to have some periodicities and symmetries.  Looking at the FT of this pattern we can say that it is just like an addition or superposition of the FTs of the different rotated sinusoids.  This is observation is confirmed by the circular appearance of the FT.  So over all we can say this final image just reaffirm what we have already demonstrated in figures 3 and 4.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlVbB8TOw-I/AAAAAAAAANM/3ZzkG8IyhfY/s1600-h/many.png"&gt;&lt;img style="cursor: pointer; width: 100px; height: 100px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlVbB8TOw-I/AAAAAAAAANM/3ZzkG8IyhfY/s400/many.png" alt="" id="BLOGGER_PHOTO_ID_5356287420751856610" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlVbBzvwsfI/AAAAAAAAANU/ZMkkoZgDCTk/s1600-h/Fmany.png"&gt;&lt;img style="cursor: pointer; width: 100px; height: 100px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlVbBzvwsfI/AAAAAAAAANU/ZMkkoZgDCTk/s400/Fmany.png" alt="" id="BLOGGER_PHOTO_ID_5356287418455601650" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 6. Addition of arbitrarily rotated sinusoid patterns and its Fourier Transform.&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;I give my self a grade of 10 in this activity.  I also want to thank master, jica, and jaya for staying with me in the lab and for reminding me to do the blog.&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/5456440432957498316-7896141005579685194?l=ap186-msison.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ap186-msison.blogspot.com/feeds/7896141005579685194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ap186-msison.blogspot.com/2009/07/activity-6-properties-of-2d-fourier.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/7896141005579685194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/7896141005579685194'/><link rel='alternate' type='text/html' href='http://ap186-msison.blogspot.com/2009/07/activity-6-properties-of-2d-fourier.html' title='Activity 6 Properties of the 2D Fourier Transform'/><author><name>miguel</name><uri>http://www.blogger.com/profile/15739169920727151183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_O7bGRbkJNVY/SlVY4pp8iAI/AAAAAAAAAJc/Yv3dUp4w-Ik/s72-c/square.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456440432957498316.post-7595398302166794104</id><published>2009-07-06T19:35:00.000-07:00</published><updated>2009-07-06T20:25:30.373-07:00</updated><title type='text'>Activity 5 Fourier Transform Model of Image Formation</title><content type='html'>&lt;div style="text-align: justify;"&gt;This is an activity which explores the functionality of the built in two-dimensional Fourier Transform of Scilab 4.1.2, &lt;span style="font-family:courier new;"&gt;fft2()&lt;/span&gt;. We will also be showing how this function, along with the convolution and correlation theroems, can be used in various image processing and analysis tasks.&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;The first task is to familiarize a\ourselves with the &lt;span style="font-family:courier new;"&gt;fft2()&lt;/span&gt;function.  Here we first constructed an image of a circle and the letter A (first row).  Then using the &lt;span style="font-family:courier new;"&gt;fft2()&lt;/span&gt; and the &lt;span style="font-family:courier new;"&gt;fftshift() &lt;/span&gt;functions we are able to display both of their Fourier Transforms.  We know that the results are correct by examining the images.  We already know that the fourier transform of a circle or a point is that of an Airy disk and that a larger circle will produce a smaller Airy disk and vice versa. Such results are seen in the images bellow (middle row). Finally we take the fourier transform of the fourier transforms (last row).  We know see that the final images are inverted with respect to the original.  This is also a common result when using the fourier transform functions of other programming languages.  Shifting and scaling constants should be used to be able to recover the original image.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlK3CDK60SI/AAAAAAAAAHE/Hsw4K-8i0x0/s1600-h/IFcircle.png"&gt;&lt;img style="cursor: pointer; width: 129px; height: 129px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlK3CDK60SI/AAAAAAAAAHE/Hsw4K-8i0x0/s400/IFcircle.png" alt="" id="BLOGGER_PHOTO_ID_5355544152735666466" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlK3CTMv7mI/AAAAAAAAAHM/HdTe2i1pnJw/s1600-h/Fcircle.png"&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlK3Ci78XzI/AAAAAAAAAHU/s2Xn6I2Sz6g/s1600-h/A.JPG"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlK3Ci78XzI/AAAAAAAAAHU/s2Xn6I2Sz6g/s400/A.JPG" alt="" id="BLOGGER_PHOTO_ID_5355544161262788402" border="0" /&gt; &lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlK3CTMv7mI/AAAAAAAAAHM/HdTe2i1pnJw/s1600-h/Fcircle.png"&gt;&lt;img style="cursor: pointer; width: 129px; height: 129px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlK3CTMv7mI/AAAAAAAAAHM/HdTe2i1pnJw/s400/Fcircle.png" alt="" id="BLOGGER_PHOTO_ID_5355544157038308962" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlK3Ci78XzI/AAAAAAAAAHU/s2Xn6I2Sz6g/s1600-h/A.JPG"&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlK3C3wJKUI/AAAAAAAAAHc/S6GWYpLb7PA/s1600-h/FA.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlK3C3wJKUI/AAAAAAAAAHc/S6GWYpLb7PA/s400/FA.png" alt="" id="BLOGGER_PHOTO_ID_5355544166850439490" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlK3CDK60SI/AAAAAAAAAHE/Hsw4K-8i0x0/s1600-h/IFcircle.png"&gt;&lt;img style="cursor: pointer; width: 129px; height: 129px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlK3CDK60SI/AAAAAAAAAHE/Hsw4K-8i0x0/s400/IFcircle.png" alt="" id="BLOGGER_PHOTO_ID_5355544152735666466" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlK3DO_RopI/AAAAAAAAAHk/ADnnFN1O5gU/s1600-h/IFA.png"&gt; &lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlK3DO_RopI/AAAAAAAAAHk/ADnnFN1O5gU/s400/IFA.png" alt="" id="BLOGGER_PHOTO_ID_5355544173087924882" border="0" /&gt; &lt;/a&gt;&lt;/div&gt;&lt;span style="text-decoration: underline;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Next we the &lt;span style="font-family:courier new;"&gt;fft2()&lt;/span&gt; function and convolution theorem to model an imaging device with a circular aperture.  Here we see that when we use an aperture to image  an object, the final image is slightly blurred or deformed.  Also we only multiplied the FT of the image to the circular aperture and not its FT since the aperture is already at the focus or the inverse space.  We can also see that a larger aperture produces a sharper image which is consistent with our previous results; that is a larger aperture will have a smaller Airy disk FT.&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/_O7bGRbkJNVY/SlK6x7hJGqI/AAAAAAAAAHs/FT-q5FPZ-x0/s1600-h/VIP.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlK6x7hJGqI/AAAAAAAAAHs/FT-q5FPZ-x0/s400/VIP.png" alt="" id="BLOGGER_PHOTO_ID_5355548273849997986" border="0" /&gt;&lt;/a&gt;&lt;br /&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/_O7bGRbkJNVY/SlK7cKkuhZI/AAAAAAAAAIU/BnSL-qrBOTo/s1600-h/circle3.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlK7cKkuhZI/AAAAAAAAAIU/BnSL-qrBOTo/s400/circle3.png" alt="" id="BLOGGER_PHOTO_ID_5355548999446070674" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/SlK7cZQmv0I/AAAAAAAAAIc/BDu9pgX7Bp8/s1600-h/IFVC.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SlK7cZQmv0I/AAAAAAAAAIc/BDu9pgX7Bp8/s400/IFVC.png" alt="" id="BLOGGER_PHOTO_ID_5355549003388206914" 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/_O7bGRbkJNVY/SlK7M9BWJgI/AAAAAAAAAIE/cYCCQQ0XlUM/s1600-h/circle2.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlK7M9BWJgI/AAAAAAAAAIE/cYCCQQ0XlUM/s400/circle2.png" alt="" id="BLOGGER_PHOTO_ID_5355548738109974018" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlK7NHuiJWI/AAAAAAAAAIM/QoI9Bz0vpns/s1600-h/IFVC.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlK7NHuiJWI/AAAAAAAAAIM/QoI9Bz0vpns/s400/IFVC.png" alt="" id="BLOGGER_PHOTO_ID_5355548740983858530" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The third task is that we use correlation to locate a pattern with in a certain image. Here we have an image with texts "THE RAIN IN SPAIN STAYS MAINLY IN THE PLAIN" and another image with just "A" of the same text size.  We used the fft2() function and implemented the correlation theorem to locate the occurence of the letter A in the texts.  After doing correlation and taking its FT again we recover the same image but with locations of "A" highlighted.&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/_O7bGRbkJNVY/SlK842QItNI/AAAAAAAAAIk/tzCV5-w_0pM/s1600-h/spain.JPG"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SlK842QItNI/AAAAAAAAAIk/tzCV5-w_0pM/s400/spain.JPG" alt="" id="BLOGGER_PHOTO_ID_5355550591718831314" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/SlK85OC32MI/AAAAAAAAAIs/QcbSZElGuPQ/s1600-h/A.png"&gt; &lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SlK85OC32MI/AAAAAAAAAIs/QcbSZElGuPQ/s400/A.png" alt="" id="BLOGGER_PHOTO_ID_5355550598105651394" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlK9xNbZGTI/AAAAAAAAAI0/dvlsWxhb-qo/s1600-h/FSa.png"&gt; &lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlK9xNbZGTI/AAAAAAAAAI0/dvlsWxhb-qo/s400/FSa.png" alt="" id="BLOGGER_PHOTO_ID_5355551560012732722" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;The final task is to do edge detection using convolution.  Our object is an image of "VIP" and we use different patterns in edge detection.  The patterns we used are 3x3 matrices of horizontal, vertical and a point.  The resulting images clearly show that the method most accurately detected figures in the image that matched the patterns.&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/_O7bGRbkJNVY/SlK-ybrnd_I/AAAAAAAAAJU/zRaedUkk4rY/s1600-h/VIP.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlK-ybrnd_I/AAAAAAAAAJU/zRaedUkk4rY/s400/VIP.png" alt="" id="BLOGGER_PHOTO_ID_5355552680530376690" border="0" /&gt;     &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlK-yOf5KLI/AAAAAAAAAJM/z4iW0qM6n-g/s1600-h/res1.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlK-yOf5KLI/AAAAAAAAAJM/z4iW0qM6n-g/s400/res1.png" alt="" id="BLOGGER_PHOTO_ID_5355552676991543474" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlK-x1anb3I/AAAAAAAAAJE/syy3spPs3S4/s1600-h/res2.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SlK-x1anb3I/AAAAAAAAAJE/syy3spPs3S4/s400/res2.png" alt="" id="BLOGGER_PHOTO_ID_5355552670258524018" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlK-xoADSoI/AAAAAAAAAI8/-uT_YDt5hUY/s1600-h/res3.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlK-xoADSoI/AAAAAAAAAI8/-uT_YDt5hUY/s400/res3.png" alt="" id="BLOGGER_PHOTO_ID_5355552666657442434" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;Thank you Martin for talking.&lt;br /&gt;&lt;br /&gt;I give myself a grade of 10 for a job well done.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&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/5456440432957498316-7595398302166794104?l=ap186-msison.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ap186-msison.blogspot.com/feeds/7595398302166794104/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ap186-msison.blogspot.com/2009/07/activity-5-fourier-transform-model-of.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/7595398302166794104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/7595398302166794104'/><link rel='alternate' type='text/html' href='http://ap186-msison.blogspot.com/2009/07/activity-5-fourier-transform-model-of.html' title='Activity 5 Fourier Transform Model of Image Formation'/><author><name>miguel</name><uri>http://www.blogger.com/profile/15739169920727151183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_O7bGRbkJNVY/SlK3CDK60SI/AAAAAAAAAHE/Hsw4K-8i0x0/s72-c/IFcircle.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456440432957498316.post-943791310111493920</id><published>2009-07-04T21:12:00.000-07:00</published><updated>2009-07-04T23:51:14.123-07:00</updated><title type='text'>Activity 3 Image Types and Basic Image Enhancements</title><content type='html'>&lt;div style="text-align: justify;"&gt;Isn't it surprising to discover how much we don't know about things we commonly use or encounter; just like in this activity for example.  I am sure that most of us, if not all of us, are already aware of the different image or picture formats that are recognized by our personal computers.  But to be honest I don't really know the difference between these formats or even how they are interpreted by our machines.  In this activity I learned that there are just a few basic types of digital images.  The simplest is that of a binary images which is suitable for black and white images since it can only store a single bit of information per pixel; ones or zeros, black or white.  Next would be a grayscale image which commonly has 8bits of information, meaning it has 256 different gray values between black and white.  The third are RGB images or true color images that stores about 3 times the information than a grayscale image, a value each for Red, Green, Blue.  This image format imitates how are eyes interpret color as different combinations of Red, Green, and Blue.  Finally there are the indexed images which are also colored images like the RGB.  But instead of storing informations for the RGB channels an indexed image stores the image as index in a colormap. Hence it stores only 2 information; the image and its color map.  As I gather the various image formats that we are more familiar with such as jpg, gif, png, tiff, etc. are just different ways of handling the these image types.  Examples of these images are presented at the end of this post.&lt;br /&gt;&lt;br /&gt;Also in this activity we employ the skills we obtained in Activities 1 and 2 to calculate the area of a real scanned image.  For this activity I opted to create my own picture by writing my name on a piece of paper and scanning it with a ruler to give an idea of the actual size of the image.  The resulting image is shown bellow together with its information obtained using the function &lt;span style="font-style: italic;"&gt;imfinfo().  &lt;/span&gt;I drew a green rectangle over the scanned image to indicate my designated region of interest.&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/_O7bGRbkJNVY/SlA1ehF9Q-I/AAAAAAAAAG8/XY21TXsgO3c/s1600-h/original.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 213px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SlA1ehF9Q-I/AAAAAAAAAG8/XY21TXsgO3c/s400/original.jpg" alt="" id="BLOGGER_PHOTO_ID_5354838755339224034" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:100%;"&gt;Original Scanned Image with Indication of the Region of Interest&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;FileName: miguel.bmp&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size:85%;"&gt;FileSize: 372262&lt;br /&gt;Format: BMP&lt;br /&gt;Width: 834&lt;br /&gt;Height: 444&lt;br /&gt;Depth: 8&lt;br /&gt;StorageType: indexed&lt;br /&gt;NumberOfColors: 256&lt;br /&gt;ResolutionUnit: centimeter&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;XResolution: 59.060000&lt;br /&gt;YResolution: 59.060000&lt;br /&gt;Size:   444 rows X 834 columns&lt;br /&gt;Indexed Image   &lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;div style="text-align: justify;"&gt;Just like in activity 2 I needed to convert this image to a binary black and white image in order for me to utilize the same algorithm in calculating the are.  So to determine what the adequate threshold should be I made an algorithm to obtain the histogram or Probability Distribution Function of gray values for this image.  As seen below, the resulting histogram is dominated by&lt;br /&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;//create histogram or PDF&lt;br /&gt;hist = zeros([1:256]);&lt;br /&gt;for i = 1:256,&lt;br /&gt;hist(i)=sum(name==i);&lt;br /&gt;end&lt;br /&gt;hist = hist/total;  //noramlize&lt;/span&gt;&lt;/blockquote&gt;&lt;div style="text-align: justify;"&gt;the black background, which is expected by simply looking at the picture.  The only light colored regions in the image are the ruler and my name.  These areas are clearly indicated in the histogram, encircled by the green highlight, and are completely separated from the background.  Using the information provided by the histogram I selected a suitable threshold indicated by the dashed red line.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlA0vIO-vDI/AAAAAAAAAGk/pwDO806cC7g/s1600-h/histogram.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 310px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlA0vIO-vDI/AAAAAAAAAGk/pwDO806cC7g/s400/histogram.png" alt="" id="BLOGGER_PHOTO_ID_5354837941212331058" border="0" /&gt;&lt;/a&gt;To be able to calculate the area accurately I separated the ruler from my region of interest before I converted it to a binary image.  This was simply done by selecting the range with in the image matrix that you are interested with.  After this we are now ready to calculate the area of my name.&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;ROI = name((10:444),(85:820));&lt;br /&gt;ROI = im2bw(ROI, 0.5);&lt;/span&gt;&lt;/blockquote&gt;&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/_O7bGRbkJNVY/SlA00Bo2Z9I/AAAAAAAAAGs/0mvGXR8def0/s1600-h/bw.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 236px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlA00Bo2Z9I/AAAAAAAAAGs/0mvGXR8def0/s400/bw.png" alt="" id="BLOGGER_PHOTO_ID_5354838025341134802" border="0" /&gt;&lt;/a&gt;Binary Image of the Region of Interest&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlA06G_CMbI/AAAAAAAAAG0/HxJ5uawyO6o/s1600-h/boundary.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 302px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SlA06G_CMbI/AAAAAAAAAG0/HxJ5uawyO6o/s400/boundary.gif" alt="" id="BLOGGER_PHOTO_ID_5354838129855574450" border="0" /&gt;&lt;/a&gt;Boundary of the Region for Area Calculation&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;By using the same algorithm used in Activity 2, I calculated the area of this image to be 56,140 pixels.  Since we also scanned a ruler beside the image we can use the skills we employed in Activity 1 to estimate the actual physical area occupied by my name.  Doing the same method of calibration as in Activity 1, I calculated that the calibration is 1mm/5.9 pixels or 1pixel = 0.169492 mm.  From these calibration we can say that 1x1 pixel has an are of 0.028727 square mm. So the total area of my name is 56,140pixel x 0.028727 square mm/pixel =1612.755 square mm or 16.13 square cm.  This is probably not a 100% calculation of area since we can see from the image that there are some black pixels inside my name.  Also there can be an error introduced when the image was scanned which would affect the calibration.  Still I believe that the combination of these 2 errors is very minimal.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Overall I think this was a fruitful activity.  I was able to combine the things I previously learned in Activities 1 and 2.  I think I deserve a pretty high grade for this one, maybe a 9 or a 10 plus a bonus since I was able to make my own histogram. Hahaha!&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/_O7bGRbkJNVY/SkBNB-tcScI/AAAAAAAAADc/rHBPK8sFRGs/s1600-h/monochrm.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 267px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SkBNB-tcScI/AAAAAAAAADc/rHBPK8sFRGs/s400/monochrm.bmp" alt="" id="BLOGGER_PHOTO_ID_5350361053724953026" border="0" /&gt;&lt;/a&gt;Binary Image&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SkBElf0jqOI/AAAAAAAAAC8/9j3-96ZQD2w/s1600-h/hamilton_gs.jpeg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 400px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SkBElf0jqOI/AAAAAAAAAC8/9j3-96ZQD2w/s400/hamilton_gs.jpeg" alt="" id="BLOGGER_PHOTO_ID_5350351768303937762" border="0" /&gt;&lt;/a&gt;Grayscale Image&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SkBKvrbeAQI/AAAAAAAAADU/KlZncy7qwUk/s1600-h/joker.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 255px; height: 234px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SkBKvrbeAQI/AAAAAAAAADU/KlZncy7qwUk/s400/joker.gif" alt="" id="BLOGGER_PHOTO_ID_5350358540288393474" border="0" /&gt;&lt;/a&gt;Indexed Image&lt;br /&gt;&lt;br /&gt;&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/_O7bGRbkJNVY/SkBEaTxG4TI/AAAAAAAAACk/f4wktas8WxE/s1600-h/why_do_you_love_me.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 97px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SkBEaTxG4TI/AAAAAAAAACk/f4wktas8WxE/s400/why_do_you_love_me.jpg" alt="" id="BLOGGER_PHOTO_ID_5350351576089682226" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SkA7Vx05XBI/AAAAAAAAACU/Xvce36ATsxE/s1600-h/70.vw.beetle.500.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 252px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SkA7Vx05XBI/AAAAAAAAACU/Xvce36ATsxE/s400/70.vw.beetle.500.jpg" alt="" id="BLOGGER_PHOTO_ID_5350341602654641170" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/SkA4vF6_ftI/AAAAAAAAAB8/3-9acAHACBg/s1600-h/cowboy_bebop+spike_spiegel-gun-in-face_edit.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SkA4vF6_ftI/AAAAAAAAAB8/3-9acAHACBg/s400/cowboy_bebop+spike_spiegel-gun-in-face_edit.jpg" alt="" id="BLOGGER_PHOTO_ID_5350338739010764498" border="0" /&gt;&lt;/a&gt;True Color Images&lt;br /&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/5456440432957498316-943791310111493920?l=ap186-msison.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ap186-msison.blogspot.com/feeds/943791310111493920/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ap186-msison.blogspot.com/2009/07/activity-3-image-types-and-basic-image.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/943791310111493920'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/943791310111493920'/><link rel='alternate' type='text/html' href='http://ap186-msison.blogspot.com/2009/07/activity-3-image-types-and-basic-image.html' title='Activity 3 Image Types and Basic Image Enhancements'/><author><name>miguel</name><uri>http://www.blogger.com/profile/15739169920727151183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_O7bGRbkJNVY/SlA1ehF9Q-I/AAAAAAAAAG8/XY21TXsgO3c/s72-c/original.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456440432957498316.post-8599978492625977963</id><published>2009-07-02T07:44:00.000-07:00</published><updated>2009-07-05T01:35:54.256-07:00</updated><title type='text'>Activity 4 Enhancement by Histogram Manipulation</title><content type='html'>&lt;div style="text-align: justify;"&gt;During my senior year in high school I chose this visual communication class as my elective, and one of our activities were photography.  At that time we were required to use a classic SLR camera which was shared by 3 people per group.  It was a really fun activity but there were also some very frustrating moments.  I clearly remember times when our shots were either to bright or too dark.  Since we were newbies, we had a very hard time getting the exposure time, flash, and aperture size correctly.  To add to our difficulties, we could only see the pictures ones we had them developed.  This resulted to us spending money on buying rolls and rolls of film which really burned our pockets.  At that time I would really have appreciated anything that would give me the ability to improve my shots which did not include taking more pictures and buying more film.  Here I am now, five years later, doing the exact activity that could have saved me money five years ago.&lt;br /&gt;&lt;br /&gt;In this activity we are tasked to improve or enhance the contrast of grayscale images by histogram manipulation.  We do this by obtaining the images histogram or probability distribution function(PDF) and, from here, calculating its cumulative distribution function (CDF).  Then to improve the image we map its current CDF to the CDF of our desired PDF which we believe would improve the image.  This mapping of the CDF is done in 3 steps:&lt;br /&gt;&lt;/div&gt;&lt;ol style="text-align: justify;"&gt;&lt;li&gt;We take the grayscale value of a pixel &lt;span style="font-style: italic;"&gt;i&lt;/span&gt; and locate its value in the CDF, &lt;span style="font-style: italic;"&gt;cdf(i)&lt;/span&gt;.&lt;/li&gt;&lt;li&gt;We then match this CDF value, &lt;span style="font-style: italic;"&gt;cdf(i)&lt;/span&gt;, to the desired CDF and locate its corresponding grayscale value.&lt;/li&gt;&lt;li&gt;Finally we replace the existing grayscale value of the pixel with the new one obtained in step 2.&lt;/li&gt;&lt;/ol&gt;&lt;div style="text-align: justify;"&gt;The final result of this mapping would be a new image which would have a CDF similar in shape to the mapping CDF.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;There are also other simpler methods of enhancing an image, such us simple contrast stretching.  I used this method before, during my old research topic, to fully utilize all 8bits.  In this method we simply take the minimum and maximum values of the image and implement the algorithm:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;Image = (Image - min(Image))/(max(Image) - min(Image)).&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;This method is considerably much simpler both theoretically and computationally but its use is very limited.  It works by taking your range of values, from minimum to maximum, and stretching it so that you will use all 8bits or 256 grayscale values.  This being the case you can only use this if the image doesn't already have a value of 256 and 0, otherwise you would have to do some thresholding and truncate the higher and lower values.  This would then cause some loss of possibly useful information.&lt;br /&gt;&lt;br /&gt;The images below are the results of the enhancements using CDF mapping.  The first column shows the original image and its normalized PDF and CDF.  Whereas the second and third column shows the result after CDF mappings on a linear CDF and logarithmic CDF respectively.&lt;br /&gt;&lt;br /&gt;The first CDF mapping enhancement made use of a linear CDF which corresponds to a flat PDF.  A flat PDF means that all gray values have equal probability, in other words a detector having such a PDF would have no bias on any grayscale value.  According to our Proffesor, Dr. Soriano, research grade cameras would ideally have a linear CDF.  But she also said that such a camera would usually show a dark image which would not appeal to most people.  Still this makes sense since in research accuracy and calibration is important, so having a favored range of grayscale values would make it difficult for the researcher.  The other CDF mapping made use of a logarithmic CDF because according to John C. Russ the human eye has a logarithmic response [1].&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SkzLHX-fl4I/AAAAAAAAAGU/opYcRN4ljr0/s1600-h/A_img.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 106px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SkzLHX-fl4I/AAAAAAAAAGU/opYcRN4ljr0/s400/A_img.png" alt="" id="BLOGGER_PHOTO_ID_5353877384592332674" 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://2.bp.blogspot.com/_O7bGRbkJNVY/SkzKxiRt19I/AAAAAAAAAGM/9y6BiYCHuOs/s1600-h/A_pdfcdf.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 213px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SkzKxiRt19I/AAAAAAAAAGM/9y6BiYCHuOs/s400/A_pdfcdf.png" alt="" id="BLOGGER_PHOTO_ID_5353877009400190930" border="0" /&gt;&lt;/a&gt;Figure 1&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/SkzIOP0ZlBI/AAAAAAAAAFM/Wf7K2UHE-U0/s1600-h/C_img.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 120px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SkzIOP0ZlBI/AAAAAAAAAFM/Wf7K2UHE-U0/s400/C_img.png" alt="" id="BLOGGER_PHOTO_ID_5353874204126712850" 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://2.bp.blogspot.com/_O7bGRbkJNVY/SkzKdCQ_2EI/AAAAAAAAAGE/aFunpksYP3I/s1600-h/C_pdfcdf.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 211px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SkzKdCQ_2EI/AAAAAAAAAGE/aFunpksYP3I/s400/C_pdfcdf.png" alt="" id="BLOGGER_PHOTO_ID_5353876657209858114" border="0" /&gt;&lt;/a&gt;Figure 2&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SkzKXwVhdPI/AAAAAAAAAF8/WDJtFssQ9fo/s1600-h/D_img.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 95px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SkzKXwVhdPI/AAAAAAAAAF8/WDJtFssQ9fo/s400/D_img.png" alt="" id="BLOGGER_PHOTO_ID_5353876566497654002" 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/_O7bGRbkJNVY/SkzKPJoVFGI/AAAAAAAAAF0/Es2iU8Ckc6k/s1600-h/D_pdfcdf.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 211px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SkzKPJoVFGI/AAAAAAAAAF0/Es2iU8Ckc6k/s400/D_pdfcdf.png" alt="" id="BLOGGER_PHOTO_ID_5353876418668598370" border="0" /&gt;&lt;/a&gt;Figure 3&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/SkzJ2PsJ39I/AAAAAAAAAFs/ddpuuF8Uwr8/s1600-h/E_img.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 97px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SkzJ2PsJ39I/AAAAAAAAAFs/ddpuuF8Uwr8/s400/E_img.png" alt="" id="BLOGGER_PHOTO_ID_5353875990798524370" 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://1.bp.blogspot.com/_O7bGRbkJNVY/SkzJi4V7BhI/AAAAAAAAAFk/YL4oqA6lD_Q/s1600-h/E_pdfcdf.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 211px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SkzJi4V7BhI/AAAAAAAAAFk/YL4oqA6lD_Q/s400/E_pdfcdf.png" alt="" id="BLOGGER_PHOTO_ID_5353875658113746450" border="0" /&gt;&lt;/a&gt;Figure 4&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SkzJJmRs9XI/AAAAAAAAAFc/Ll2KXcDy1Uw/s1600-h/G_img.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 99px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SkzJJmRs9XI/AAAAAAAAAFc/Ll2KXcDy1Uw/s400/G_img.png" alt="" id="BLOGGER_PHOTO_ID_5353875223767479666" 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/_O7bGRbkJNVY/SkzItGrVGpI/AAAAAAAAAFU/1Zpm1uvHq9Q/s1600-h/G_pdfcdf.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 209px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SkzItGrVGpI/AAAAAAAAAFU/1Zpm1uvHq9Q/s400/G_pdfcdf.png" alt="" id="BLOGGER_PHOTO_ID_5353874734248696466" border="0" /&gt;&lt;/a&gt;Figure 5&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;Before commenting on the results of the enhancements I would first like to note that by looking at the plots of the CDF we are assured that the implemented algorithm works correctly since the resulting CDFs match the theoretically expected.  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;By examining figures 1-5 we can see that in general the linear CDF works very well as an image enhancing tool. As expected all of the 5 images had a better contrast compared to the original.; this observation is supported by the resulting PDF of grayscale values.  A broader PDF means that the image makes use of a wider range of grayscale values which is could for higher contrast and detail.  Such a result was achieved in all of the pictures and specially for figures 4 and 5.  Looking at the images we can easily see that most of them did not only had a better contrast but also had more distinguishable detail.  Only figure 2 did not fair as well as the others.  Though the image had a much better contrast, some of the detail previously seen was lost after enhancement.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;As for the logarithmic CDF mapping, it is clearly seen that it did not fair as well as the linear one.  It is true though that the CDF indeed looked match a logarithmic curve, still the image contrast actually suffered after the enhancement.  All of these 5 images became much darker than the original and most of their detial became indistinguishable.  Also when we look at their resulting PDF we see that it is concentrated on the dark values just like the image.  This result should have been expected since this logarithmic curve has a most of its values in the lower x axis, or the dark region.  Probably if we stretch the logarithmic curve a little it might result to a much better enhancement.&lt;br /&gt;&lt;br /&gt;I tried various types of nonlinear CDFs, such as parabolic, exponential, cubed, and cube root, hoping to find one that would enhance all of the grayscale images that I tried.  Soon enough I realized that such a CDF does not exist, or at least it is beyond me.  What I did learn though was that a CDF would enhance your image if it stretched your histogram in the range of your region of interest.  That is if you have little experience, such as myself, it would be better to look at the histogram and determine which range corresponds to your ROI.  Then look for a CDF that would stretch this region and this would amount to a very good ehnacement.&lt;br /&gt;&lt;br /&gt;I would like to thank Dr. Soriano for giving me very useful insights.  I also thank Dr. Perez for helping me understand what to do.  Finally I thank Jaya, Master, and Jica for the discussions and the laughs while doing this activity.&lt;br /&gt;&lt;br /&gt;I also thank and award myself with a grade of 10.  Thank you very much... HAHAHA!&lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt;[1] Russ, John C. "The image processing handbook" 5th Edition, Taylor and Francis Group, CRC Press 2006-12&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/5456440432957498316-8599978492625977963?l=ap186-msison.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ap186-msison.blogspot.com/feeds/8599978492625977963/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ap186-msison.blogspot.com/2009/07/activity-4-enhancement-by-histogram.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/8599978492625977963'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/8599978492625977963'/><link rel='alternate' type='text/html' href='http://ap186-msison.blogspot.com/2009/07/activity-4-enhancement-by-histogram.html' title='Activity 4 Enhancement by Histogram Manipulation'/><author><name>miguel</name><uri>http://www.blogger.com/profile/15739169920727151183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_O7bGRbkJNVY/SkzLHX-fl4I/AAAAAAAAAGU/opYcRN4ljr0/s72-c/A_img.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456440432957498316.post-7884182352459057317</id><published>2009-06-28T01:29:00.000-07:00</published><updated>2009-06-28T06:44:17.226-07:00</updated><title type='text'>Activity 2 Area Estimation for Images with Defined Edges</title><content type='html'>&lt;div style="text-align: justify;"&gt;When I first heard or thought about it, area estimation did not strike me at all as something complicated or even useful.  I was already aware of how area estimation played a role in agriculture, agrarian reform, and other endeavors involving large land areas (such as land grabbing and proffesional squating... haha). But as Ma'am Jing  narrated and enumerated all the instances where estimating an area was the key task in the creater scheme of things then I started to realize what a powerful tool it can be.  It was quite an eye opener when she shared how the study and treatment of skin cancer heavily relied on area estimation which was done manually.  I also remembered that my cousin (a marine science student) once told me that in marine science measuring the total area of leaving corals is a very important task.  This made me realize that area estimation is not as simple as it once seemed.  Moreover measuring irregularly shaped areas is difficult enough but teaching a computer to do it is even more challenging.  In this activity we utilize scilab and its SIP toolbox to write an area estimation code using Green's theorem.&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;Green's theorem has been and is still used in various area estimation algorithms.  There is even an old area estimating instrument called the planimeter  (&lt;a href="http://en.wikipedia.org/wiki/Planimeter"&gt;http://en.wikipedia.org/wiki/Planimeter&lt;/a&gt;), used in irregularly shaped areas, that is justified by Green's theorem.  Named after British mathematician George Green, it is a mathematical relationship of a double integral and the line integral along its boundary (&lt;a href="http://en.wikipedia.org/wiki/Green%27s_theorem"&gt;http://en.wikipedia.org/wiki/Green%27s_theorem&lt;/a&gt;).&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/SkdvvKNMOEI/AAAAAAAAADk/rq45urBCW2I/s1600-h/eqn1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 96px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SkdvvKNMOEI/AAAAAAAAADk/rq45urBCW2I/s400/eqn1.png" alt="" id="BLOGGER_PHOTO_ID_5352369538137339970" border="0" /&gt;&lt;/a&gt;Given that the partial derivatives of F1 and F2 exists and are continuous within the region R we can take F1 = 0, F2 =x and F1 = y F2 = 0 and obtain two line integrals which both gives the area of R.  The average of this two, equation 2, gives a better measure of R and equation 3 is the discreet form if this integral, where N is the number of points along the boundary contour.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/Skdvzm0uyHI/AAAAAAAAADs/NfPtTTEmK-s/s1600-h/eqn2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 239px; height: 70px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/Skdvzm0uyHI/AAAAAAAAADs/NfPtTTEmK-s/s400/eqn2.png" alt="" id="BLOGGER_PHOTO_ID_5352369614538852466" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/Skdv3muO1SI/AAAAAAAAAD0/D1lDaKmVjn4/s1600-h/eqn3.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 297px; height: 97px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/Skdv3muO1SI/AAAAAAAAAD0/D1lDaKmVjn4/s400/eqn3.png" alt="" id="BLOGGER_PHOTO_ID_5352369683231069474" border="0" /&gt;&lt;/a&gt;Based from this concept I wrote a program in Scilab making use of the SIP toolbox to  access the image and the required information from it.  In this basic implementation we make use of the function &lt;span style="font-style: italic;"&gt;follow()&lt;/span&gt; to obtain the boundary contour of the area of interest.  But &lt;span style="font-style: italic;"&gt;follow()&lt;/span&gt; can only handle binary images so the function &lt;span style="font-style: italic;"&gt;im2bw()&lt;/span&gt; is utilized to convert non-binary images.  Also, as we can see from equation 3, the descreet algorithm for Green's theorem makes use of one more point over the length of the contour.  The simple adjustment I made was to simply add the starting point/coordinate as the end point of the contour.  This is a valid adjsutment since there is no extraneous information added and in fact this last point necessarily closes the contour which was initially open.  Also I used pixel counting as the basis for checking; that is, I was to compare the area calculated by the algorithm against the total number of white pixels.  This made sense since in this case all of the images were created using paint and none were real photographs.  As it is the program was fit enough to run and implement Greens theorem.&lt;br /&gt;&lt;br /&gt;The trial run of the program aimed to calculate the area of a square with one side measuring 178 pixels but, contrary to what I expected, it returned the wrong value.  At first I suspected that the difference was that the algorithm did not account for the boundary and Dr. Soriano shared this thought, but I already saw from the values that it was not the case.  Then I immediatley noticed that the calculated area was that of a 177 pixel sided square.  After some serious thinking and contemplating I had an indea of adding half of the boundary contour.  For the square area this was obviously sufficient since the only difference of 177pixel and 178pixel on a side is half of the perimeter, still I had a feeling that this would be valid for all the other shapes.  After modifying the code and testing it on sqaures, circles, triangles, and various irregular shapes I was amazed that the program was 100% accurate each time (table 1).  Even very crooked curves were not a problem.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/SkdxOTZdlNI/AAAAAAAAAD8/lwTF_IpTxkE/s1600-h/table1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 247px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SkdxOTZdlNI/AAAAAAAAAD8/lwTF_IpTxkE/s400/table1.png" alt="" id="BLOGGER_PHOTO_ID_5352371172692301010" border="0" /&gt;&lt;/a&gt;Then I tried the program for more irregular shapes and saw a limitation.  once there is a discontinuity to the black background the program could not handle it.  This means that if there are two seperate white areas then the program would only see one of them.  Also if the shape was a donut or any other that had a whole or if the white areas were only connected by a white line of 1 pixel width then the program would return the wrong value.  I traced this limitation back to the function &lt;span style="font-style: italic;"&gt;follow&lt;/span&gt;()&lt;span style="font-style: italic;"&gt;.  &lt;/span&gt;This function can only follow a single contour that did not intersect itself, faced with any other case and it would not work for our purposes.&lt;br /&gt;&lt;br /&gt;Overall I still consider this as a huge success and I have to give myself a pat on the back for such good work.  For this I'm giving myself a grade of 10!!! woooohhooooo!!!!&lt;br /&gt;&lt;br /&gt;I would first like to thank Dr. Soriano for all the information and insights she shared.  I would also like to thank Thirdy for helping me in discovering the limitations of the follow command.&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/_O7bGRbkJNVY/SkdyC0Jb04I/AAAAAAAAAEk/CUbe_VdPdS8/s1600-h/square.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 200px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SkdyC0Jb04I/AAAAAAAAAEk/CUbe_VdPdS8/s400/square.JPG" alt="" id="BLOGGER_PHOTO_ID_5352372074836644738" border="0" /&gt;&lt;/a&gt;&lt;span style="text-decoration: underline;"&gt;square&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/SkdzPPDGReI/AAAAAAAAAFE/M-EzvRRHpAc/s1600-h/triangle.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 200px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SkdzPPDGReI/AAAAAAAAAFE/M-EzvRRHpAc/s400/triangle.JPG" alt="" id="BLOGGER_PHOTO_ID_5352373387727881698" border="0" /&gt;&lt;/a&gt;triangle&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/SkdxqrU0q_I/AAAAAAAAAEE/93mo4N8Eq2M/s1600-h/circle.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 200px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SkdxqrU0q_I/AAAAAAAAAEE/93mo4N8Eq2M/s400/circle.JPG" alt="" id="BLOGGER_PHOTO_ID_5352371660151630834" border="0" /&gt;&lt;/a&gt;circle&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/SkdydbCxmEI/AAAAAAAAAE8/cHUr_niOZzE/s1600-h/tshirt.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 200px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SkdydbCxmEI/AAAAAAAAAE8/cHUr_niOZzE/s400/tshirt.JPG" alt="" id="BLOGGER_PHOTO_ID_5352372531954292802" border="0" /&gt;&lt;/a&gt;tshirt 1&lt;br /&gt;&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/_O7bGRbkJNVY/SkdyK4VrQ0I/AAAAAAAAAE0/vuHLIh3LQ0c/s1600-h/tshirt2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 200px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SkdyK4VrQ0I/AAAAAAAAAE0/vuHLIh3LQ0c/s400/tshirt2.JPG" alt="" id="BLOGGER_PHOTO_ID_5352372213400683330" border="0" /&gt;&lt;/a&gt;tshirt 2&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/Skdx683mZzI/AAAAAAAAAEc/7TxhjkC8Wlg/s1600-h/irregular.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 200px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/Skdx683mZzI/AAAAAAAAAEc/7TxhjkC8Wlg/s400/irregular.JPG" alt="" id="BLOGGER_PHOTO_ID_5352371939738806066" border="0" /&gt;&lt;/a&gt;irregular&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/SkdxvdnfneI/AAAAAAAAAEM/fum3AWXgR-Q/s1600-h/irregular2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 200px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SkdxvdnfneI/AAAAAAAAAEM/fum3AWXgR-Q/s400/irregular2.JPG" alt="" id="BLOGGER_PHOTO_ID_5352371742371192290" border="0" /&gt;&lt;/a&gt;irregular 2&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/Skdx1Y4IaRI/AAAAAAAAAEU/Ndkia_cTq1I/s1600-h/irregular3.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 200px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/Skdx1Y4IaRI/AAAAAAAAAEU/Ndkia_cTq1I/s400/irregular3.JPG" alt="" id="BLOGGER_PHOTO_ID_5352371844178012434" border="0" /&gt;&lt;/a&gt;irregular 3&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;Im = imread('circle.jpg');&lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;&lt;br /&gt;Im = im2bw(Im, 0.5);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;[x,y] = follow(Im);&lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;&lt;br /&gt;len=length(x);&lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;&lt;br /&gt;x(len+1)=x(1);&lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;&lt;br /&gt;y(len+1)=y(1);&lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;&lt;br /&gt;&lt;br /&gt;//theoretical area via pixel counting&lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;&lt;br /&gt;A1 = sum(Im);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;//the additive term 'round((len+1)/2)' accounts for the sections &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;of the boundary that is not included in the sumation&lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;&lt;br /&gt;A = round(sum((x(1:len).*y(2:len+1)-y(1:len).*x(2:len+1)))/2) + round((len+1)/2);&lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;&lt;br /&gt;&lt;br /&gt;//area checking&lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;&lt;br /&gt;A==A1&lt;/span&gt;&lt;/span&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/5456440432957498316-7884182352459057317?l=ap186-msison.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ap186-msison.blogspot.com/feeds/7884182352459057317/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ap186-msison.blogspot.com/2009/06/activity-2-area-estimation-for-images.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/7884182352459057317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/7884182352459057317'/><link rel='alternate' type='text/html' href='http://ap186-msison.blogspot.com/2009/06/activity-2-area-estimation-for-images.html' title='Activity 2 Area Estimation for Images with Defined Edges'/><author><name>miguel</name><uri>http://www.blogger.com/profile/15739169920727151183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_O7bGRbkJNVY/SkdvvKNMOEI/AAAAAAAAADk/rq45urBCW2I/s72-c/eqn1.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456440432957498316.post-5397737232071193927</id><published>2009-06-22T19:04:00.000-07:00</published><updated>2009-06-22T20:33:35.503-07:00</updated><title type='text'>Activity 2 and 3 pictures</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/SkBNB-tcScI/AAAAAAAAADc/rHBPK8sFRGs/s1600-h/monochrm.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 267px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SkBNB-tcScI/AAAAAAAAADc/rHBPK8sFRGs/s400/monochrm.bmp" alt="" id="BLOGGER_PHOTO_ID_5350361053724953026" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SkBKvrbeAQI/AAAAAAAAADU/KlZncy7qwUk/s1600-h/joker.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 255px; height: 234px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SkBKvrbeAQI/AAAAAAAAADU/KlZncy7qwUk/s400/joker.gif" alt="" id="BLOGGER_PHOTO_ID_5350358540288393474" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SkBJlyuZZwI/AAAAAAAAADM/qpXe2gA5X18/s1600-h/apple_lineart.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 344px; height: 400px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SkBJlyuZZwI/AAAAAAAAADM/qpXe2gA5X18/s400/apple_lineart.gif" alt="" id="BLOGGER_PHOTO_ID_5350357270936512258" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/SkBJZJgzrWI/AAAAAAAAADE/osO-GKUjE70/s1600-h/white_on_black.jpeg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 392px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SkBJZJgzrWI/AAAAAAAAADE/osO-GKUjE70/s400/white_on_black.jpeg" alt="" id="BLOGGER_PHOTO_ID_5350357053715230050" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SkBElf0jqOI/AAAAAAAAAC8/9j3-96ZQD2w/s1600-h/hamilton_gs.jpeg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 400px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SkBElf0jqOI/AAAAAAAAAC8/9j3-96ZQD2w/s400/hamilton_gs.jpeg" alt="" id="BLOGGER_PHOTO_ID_5350351768303937762" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/SkBEaTxG4TI/AAAAAAAAACk/f4wktas8WxE/s1600-h/why_do_you_love_me.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 97px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SkBEaTxG4TI/AAAAAAAAACk/f4wktas8WxE/s400/why_do_you_love_me.jpg" alt="" id="BLOGGER_PHOTO_ID_5350351576089682226" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SkA7axWzTKI/AAAAAAAAACc/HGormXLQfCk/s1600-h/112-vw-beetle.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 278px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SkA7axWzTKI/AAAAAAAAACc/HGormXLQfCk/s400/112-vw-beetle.jpg" alt="" id="BLOGGER_PHOTO_ID_5350341688427760802" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SkA7Vx05XBI/AAAAAAAAACU/Xvce36ATsxE/s1600-h/70.vw.beetle.500.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 252px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SkA7Vx05XBI/AAAAAAAAACU/Xvce36ATsxE/s400/70.vw.beetle.500.jpg" alt="" id="BLOGGER_PHOTO_ID_5350341602654641170" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/SkA4obWL0FI/AAAAAAAAAB0/Awk1nafbHLo/s1600-h/cowboy_bebop+spike_spiegel-gun-in-face.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/SkA4obWL0FI/AAAAAAAAAB0/Awk1nafbHLo/s400/cowboy_bebop+spike_spiegel-gun-in-face.jpg" alt="" id="BLOGGER_PHOTO_ID_5350338624502878290" 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/_O7bGRbkJNVY/SkA4ys7_hsI/AAAAAAAAACE/Yw7P6tpstD0/s1600-h/cowboy_bebop+spike_spiegel-gun-in-face_binary.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SkA4ys7_hsI/AAAAAAAAACE/Yw7P6tpstD0/s400/cowboy_bebop+spike_spiegel-gun-in-face_binary.jpg" alt="" id="BLOGGER_PHOTO_ID_5350338801023551170" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/SkA4vF6_ftI/AAAAAAAAAB8/3-9acAHACBg/s1600-h/cowboy_bebop+spike_spiegel-gun-in-face_edit.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/SkA4vF6_ftI/AAAAAAAAAB8/3-9acAHACBg/s400/cowboy_bebop+spike_spiegel-gun-in-face_edit.jpg" alt="" id="BLOGGER_PHOTO_ID_5350338739010764498" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://img.photobucket.com/albums/v342/machishoujo/SpikeSpiegel.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 475px; height: 306px;" src="http://img.photobucket.com/albums/v342/machishoujo/SpikeSpiegel.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/SkBEhjQro5I/AAAAAAAAAC0/jEun_u0-g04/s1600-h/square.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 200px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/SkBEhjQro5I/AAAAAAAAAC0/jEun_u0-g04/s400/square.JPG" alt="" id="BLOGGER_PHOTO_ID_5350351700507730834" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/SkBEe9qv6KI/AAAAAAAAACs/FFp2dA-v8UU/s1600-h/circle.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 200px; height: 200px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/SkBEe9qv6KI/AAAAAAAAACs/FFp2dA-v8UU/s400/circle.JPG" alt="" id="BLOGGER_PHOTO_ID_5350351656056776866" border="0" /&gt;&lt;/a&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/5456440432957498316-5397737232071193927?l=ap186-msison.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ap186-msison.blogspot.com/feeds/5397737232071193927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ap186-msison.blogspot.com/2009/06/activity-2-and-3-pictures.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/5397737232071193927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/5397737232071193927'/><link rel='alternate' type='text/html' href='http://ap186-msison.blogspot.com/2009/06/activity-2-and-3-pictures.html' title='Activity 2 and 3 pictures'/><author><name>miguel</name><uri>http://www.blogger.com/profile/15739169920727151183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_O7bGRbkJNVY/SkBNB-tcScI/AAAAAAAAADc/rHBPK8sFRGs/s72-c/monochrm.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456440432957498316.post-7947041689108967359</id><published>2009-06-17T20:31:00.001-07:00</published><updated>2009-06-21T07:06:03.383-07:00</updated><title type='text'>Activity 1</title><content type='html'>&lt;div style="text-align: justify;"&gt;Once we have the required data or information, making graphs, charts, or plots is never a problem for us.  With the aide of our modern computers and the numerous calculating and graphing softwares such tasks are usually done efficiently and hassle free.  But before the age of  even the earliest computers fairly accurate graphs and plots already existed; which is, when you think of it, an amazing feat.  I don't know how this plots were made back then, but by simply using the powers of wikipedia we can somewhat get an idea of how scientists back then made use of different types of graphing papers (&lt;a href="http://en.wikipedia.org/wiki/Graphing_paper"&gt;http://en.wikipedia.org/wiki/Graphing_paper&lt;/a&gt;) and odd looking implements (&lt;a href="http://en.wikipedia.org/wiki/French_curve"&gt;http://en.wikipedia.org/wiki/French_curve&lt;/a&gt;) to generate their graphs.  In this first activity we recreated a very old plot by using MS Paint and MS Excel.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/Sj3nJrN54_I/AAAAAAAAAAk/opwM-fbjATM/s1600-h/miguel_orig_crop.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 254px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/Sj3nJrN54_I/AAAAAAAAAAk/opwM-fbjATM/s400/miguel_orig_crop.jpg" alt="" id="BLOGGER_PHOTO_ID_5349686085791900658" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;We took very old handwritten plots from books and journals as far back as the 1920's ,or even older, and scanned them.  Now using the select tool of MS paint we took note of the pixel coordinates of all the significant points of the plot.  Specifically we took the pixel values of the axis of the plot along with their corresponding physical values indicated on the plot.  From these data we obtained the conversion from the pixel values to their physical values.  For each tick mark on both axes, we took the difference in their pixel values and also their physical values.  From the ratio of these two values we would already have a conversion to use on the curve:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/Sj3l7z2keNI/AAAAAAAAAAU/Bose2CSvq-Y/s1600-h/eqn1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 42px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/Sj3l7z2keNI/AAAAAAAAAAU/Bose2CSvq-Y/s320/eqn1.png" alt="" id="BLOGGER_PHOTO_ID_5349684748080150738" border="0" /&gt;&lt;/a&gt;&lt;!--[if !mso]&gt; &lt;style&gt; v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} &lt;/style&gt; &lt;![endif]--&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;But since the plots were hand drawn these difference in pixel values were not constant, still the variations were not that large so I simply took the average.  The more significant concern is that this particular doesn't have an origin with pixel coordinates (0,0)  and the plot itself did not even start at 0,0 of the physical values.  Also in the image file the direction of increasing pixel value on the vertical was opposite of that with the vertical axis of the plot.  Still these problems can be easily addressed by using some basic algebra,  point-slope or two-point form of a line, along with some concentration and patience.  Doing this I arrived at a modified equation for conversion of the form:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_O7bGRbkJNVY/Sj3uh3EEuMI/AAAAAAAAABE/UgVpfHPJfxE/s1600-h/eqn2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 58px;" src="http://3.bp.blogspot.com/_O7bGRbkJNVY/Sj3uh3EEuMI/AAAAAAAAABE/UgVpfHPJfxE/s400/eqn2.png" alt="" id="BLOGGER_PHOTO_ID_5349694197870147778" border="0" /&gt;&lt;/a&gt;Using the pixel coordinates of the points along the curve in this equation I tried to recreate this plot in MS Excel and compared it with the original.  In comparing the two plots we simply use  the original scanned plot as the background of the plot in Excel.  But upon comparing the recreated curve with the original it was obvious that the two did not match.  Then I found out that the x-axis of the plot I chose was not the same through out the plot.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_O7bGRbkJNVY/Sj3w_g2KbRI/AAAAAAAAABM/wLZp0U2NyhA/s1600-h/fig.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 97px;" src="http://4.bp.blogspot.com/_O7bGRbkJNVY/Sj3w_g2KbRI/AAAAAAAAABM/wLZp0U2NyhA/s400/fig.png" alt="" id="BLOGGER_PHOTO_ID_5349696906325552402" border="0" /&gt;&lt;/a&gt;It appears that the origin of the second segment coincided with the 1 value of the first.  Also, I found out that the ratio of the pixel values and the physical values of the axes was not the same.  I tried to add value of 1 to offset the second segment of the curve and I also used a different conversion for the two parts to improve the appearance of the recreated curve.  But as you can see from the figure bellow, though the general shape and trend of the plot was replicated the corresponding points and tick marks did not coincide with the original plot.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_O7bGRbkJNVY/Sj3yw7t610I/AAAAAAAAABU/h0PslMcXMZc/s1600-h/rep1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 443px; height: 266px;" src="http://1.bp.blogspot.com/_O7bGRbkJNVY/Sj3yw7t610I/AAAAAAAAABU/h0PslMcXMZc/s400/rep1.png" alt="" id="BLOGGER_PHOTO_ID_5349698854863951682" border="0" /&gt;&lt;/a&gt;After doing a lot of tweaking with the math and even more lucky trial-and-errors I found out that it is not possible to fully reconstruct this plot using this method.  So with the permission of my professors I decided to break the curve into two plots and then do the reconstruction.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_O7bGRbkJNVY/Sj30nXE199I/AAAAAAAAABc/8w0hc8XoF0o/s1600-h/rep2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 259px;" src="http://2.bp.blogspot.com/_O7bGRbkJNVY/Sj30nXE199I/AAAAAAAAABc/8w0hc8XoF0o/s400/rep2.png" alt="" id="BLOGGER_PHOTO_ID_5349700889432422354" border="0" /&gt;&lt;/a&gt;Finally the recreation is a success...!!! The recreated curve fits very well with the original and even the points and the tick marks are spot on.  I would like to give myself a 10 for this but since I was late I guess a 9 would do... hahahahahahhah!!!!!&lt;br /&gt;&lt;br /&gt;And since this was a success I have to thank all those who helped me... first my professors Dr. Soriano and Dr. Perez, Thirdy for helping me find this plot, Jica for sending me my files, and Winsome for telling me that I need to sign in before I can do anything with my blog.&lt;br /&gt;&lt;br /&gt;Source of Plot: A. Wilmen Duff, et al, "Physics for Students of Science and Engineers", Maple Press Co., York PA, 1926&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/5456440432957498316-7947041689108967359?l=ap186-msison.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ap186-msison.blogspot.com/feeds/7947041689108967359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ap186-msison.blogspot.com/2009/06/first-task-is-to-recreate-ancient-hand.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/7947041689108967359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456440432957498316/posts/default/7947041689108967359'/><link rel='alternate' type='text/html' href='http://ap186-msison.blogspot.com/2009/06/first-task-is-to-recreate-ancient-hand.html' title='Activity 1'/><author><name>miguel</name><uri>http://www.blogger.com/profile/15739169920727151183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_O7bGRbkJNVY/Sj3nJrN54_I/AAAAAAAAAAk/opwM-fbjATM/s72-c/miguel_orig_crop.jpg' height='72' width='72'/><thr:total>1</thr:total></entry></feed>
