<?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-3974070185893700788</id><updated>2011-07-07T23:59:38.959-07:00</updated><category term='Motion Blur'/><category term='OpenOffice Calc Customization'/><category term='Edge Detection'/><category term='Image Restoration'/><category term='Image Enhancement'/><category term='Area'/><category term='Image Processing'/><category term='Noise'/><category term='Scilab'/><category term='Contrast enhancement'/><category term='Distortions'/><category term='Fourier Transform'/><category term='Pattern recognition'/><title type='text'>Master's Piece</title><subtitle type='html'>...reports, reports, reports</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://thejaggernaut.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://thejaggernaut.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Mark Jayson Villangca</name><uri>http://www.blogger.com/profile/14897153276200167580</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>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3974070185893700788.post-4529413648086100233</id><published>2009-10-11T01:23:00.000-07:00</published><updated>2009-10-12T02:31:32.154-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Motion Blur'/><category scheme='http://www.blogger.com/atom/ns#' term='Image Restoration'/><title type='text'>Activity 19: Restoration of Blurred Image</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Introduction&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;In this activity, we restore a motion blurred image with Gaussian noise using a Weiner filter and a pseudo Weiner filter.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;In the Fourier space, the degraded image is given by&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/StGZIczs7rI/AAAAAAAAArc/aMARHqbsQ20/s1600-h/blurplusnoise.PNG"&gt;&lt;img style="cursor: pointer; width: 256px; height: 30px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/StGZIczs7rI/AAAAAAAAArc/aMARHqbsQ20/s400/blurplusnoise.PNG" alt="" id="BLOGGER_PHOTO_ID_5391258599390244530" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;div style="text-align: justify;"&gt;where G is the degraded image, F is the original image, N is the noise, H is the transfer function 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://3.bp.blogspot.com/_ctLOE7SPslI/StGZIys0J6I/AAAAAAAAArk/KCYUNWJIhSI/s1600-h/transfcn.PNG"&gt;&lt;img style="cursor: pointer; width: 353px; height: 55px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/StGZIys0J6I/AAAAAAAAArk/KCYUNWJIhSI/s400/transfcn.PNG" alt="" id="BLOGGER_PHOTO_ID_5391258605266937762" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;div style="text-align: justify;"&gt;where T is the duration of exposure, a and b represents displacements along u and v respectively.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Methodology&lt;/span&gt;&lt;br /&gt;A test image is first degraded using the above equations. Restoration follows using a Weiner filter given by&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/StGZJ35ZLiI/AAAAAAAAAr0/FJdBR-GfFBQ/s1600-h/weiner.PNG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 78px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/StGZJ35ZLiI/AAAAAAAAAr0/FJdBR-GfFBQ/s400/weiner.PNG" alt="" id="BLOGGER_PHOTO_ID_5391258623841742370" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;where Sn and Sf are the power spectrum of the noise and the original image respectively.  However, in real world situations, it is seldom known the noise and the original image hence we use a Pseudo Weiner filter given by&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/StGZJe6KrcI/AAAAAAAAArs/W4iYyOROBao/s1600-h/pseudo+weiner.PNG"&gt;&lt;img style="cursor: pointer; width: 301px; height: 81px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/StGZJe6KrcI/AAAAAAAAArs/W4iYyOROBao/s400/pseudo+weiner.PNG" alt="" id="BLOGGER_PHOTO_ID_5391258617134099906" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;where K is a constant.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Results&lt;/span&gt;&lt;br /&gt;Below are our results for different parameter values. x-axis represents K values and y-axis are the F, C, Q values.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/StGcpK5d8eI/AAAAAAAAAr8/VBjI0allowI/s1600-h/plot_a0.05b0.05T1.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 299px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/StGcpK5d8eI/AAAAAAAAAr8/VBjI0allowI/s400/plot_a0.05b0.05T1.png" alt="" id="BLOGGER_PHOTO_ID_5391262460053156322" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1. Restoration for the test image with motion blur parameters a=0.05, b=0.05 and T=1&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/StGcp--qOHI/AAAAAAAAAsE/jU7HVGxnetE/s1600-h/plot_a0.05b0.03T1.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 301px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/StGcp--qOHI/AAAAAAAAAsE/jU7HVGxnetE/s400/plot_a0.05b0.03T1.png" alt="" id="BLOGGER_PHOTO_ID_5391262474033576050" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2. Restoration for the test image with motion blur parameters a=0.05, b=0.03 and T=1&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;To quantify the restored images, we used Linfoot's criterion. F represents fidelity or the general similarity of the image, C is the structural content which gives the relative sharpness of the images and Q is the correlation quality which measures the alignment of peaks.  Perfect reconstruction occurs when F=C=Q=1&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;From figures 1 and 2, the Weiner filter shows the best restoration, followed by the Pseudo Weiner with K=0.0001.  As K becomes larger, more blurring is observed.  Sharp reconstruction is observed at lower K values, however noise amplification is observed. At the extreme case where K=0, restored image is unrecognizable. The direction of the lines in K=0, reflects the parameters a and b. (refer also to figure 3)&lt;br /&gt;&lt;br /&gt;Below is our full data (click to enlarge)&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/_ctLOE7SPslI/StGcruVJhYI/AAAAAAAAAsM/8cCvlz_jhAw/s1600-h/full+data.png"&gt;&lt;img style="cursor: pointer; width: 350px; height: 400px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/StGcruVJhYI/AAAAAAAAAsM/8cCvlz_jhAw/s400/full+data.png" alt="" id="BLOGGER_PHOTO_ID_5391262503924237698" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3. Full restoration data.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;div style="text-align: justify;"&gt;From figure 3, we can observed that higher T value (for our case, T=3) are restored more accurately compared to those with lower T (for our case, T=1).&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;For this activity, I'll give myself a 10 for completing the activity and for having satisfactory results.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Source of test image: http://www.armadaanime.com/poster-belldandy-field.jpg&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3974070185893700788-4529413648086100233?l=thejaggernaut.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thejaggernaut.blogspot.com/feeds/4529413648086100233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thejaggernaut.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/3974070185893700788/posts/default/4529413648086100233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/4529413648086100233'/><link rel='alternate' type='text/html' href='http://thejaggernaut.blogspot.com/2009/10/activity-19-restoration-of-blurred.html' title='Activity 19: Restoration of Blurred Image'/><author><name>Mark Jayson Villangca</name><uri>http://www.blogger.com/profile/14897153276200167580</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/_ctLOE7SPslI/StGZIczs7rI/AAAAAAAAArc/aMARHqbsQ20/s72-c/blurplusnoise.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3974070185893700788.post-858937709753982063</id><published>2009-10-11T00:17:00.000-07:00</published><updated>2009-10-11T01:22:05.122-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Noise'/><category scheme='http://www.blogger.com/atom/ns#' term='Image Restoration'/><title type='text'>Activity 18: Noise Model and Basic Image Restoration</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Introduction&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The objective of this activity is to restore images with noise using different restoration methods.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Methodology&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;First a test image is deliberately added with noise. The noise added have different probability distributions, namely&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Gaussian&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/StGIxx6FVLI/AAAAAAAAApM/PQxyBlL7YaE/s1600-h/Gaussian.PNG"&gt;&lt;img style="cursor: pointer; width: 233px; height: 81px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/StGIxx6FVLI/AAAAAAAAApM/PQxyBlL7YaE/s400/Gaussian.PNG" alt="" id="BLOGGER_PHOTO_ID_5391240617731118258" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;Rayleigh&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/StGIyRkPhiI/AAAAAAAAApU/XEUzUPk7hmY/s1600-h/rayleigh.PNG"&gt;&lt;img style="cursor: pointer; width: 322px; height: 112px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/StGIyRkPhiI/AAAAAAAAApU/XEUzUPk7hmY/s400/rayleigh.PNG" alt="" id="BLOGGER_PHOTO_ID_5391240626229446178" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;Gamma&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/StGIyml97PI/AAAAAAAAApc/RKo-87cOOvU/s1600-h/gamma.PNG"&gt;&lt;img style="cursor: pointer; width: 273px; height: 134px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/StGIyml97PI/AAAAAAAAApc/RKo-87cOOvU/s400/gamma.PNG" alt="" id="BLOGGER_PHOTO_ID_5391240631873826034" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;Exponential&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/StGIzLPnQbI/AAAAAAAAApk/19dkg17-iz4/s1600-h/exponential.PNG"&gt;&lt;img style="cursor: pointer; width: 219px; height: 94px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/StGIzLPnQbI/AAAAAAAAApk/19dkg17-iz4/s400/exponential.PNG" alt="" id="BLOGGER_PHOTO_ID_5391240641712177586" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;Uniform&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/StGIze_z8_I/AAAAAAAAAps/UpbGf7KNOJo/s1600-h/uniform.PNG"&gt;&lt;img style="cursor: pointer; width: 223px; height: 111px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/StGIze_z8_I/AAAAAAAAAps/UpbGf7KNOJo/s400/uniform.PNG" alt="" id="BLOGGER_PHOTO_ID_5391240647014609906" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;Salt &amp;amp; Pepper&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/StGKCBoBXkI/AAAAAAAAAp0/cISwP89tYJg/s1600-h/SP.PNG"&gt;&lt;img style="cursor: pointer; width: 205px; height: 87px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/StGKCBoBXkI/AAAAAAAAAp0/cISwP89tYJg/s400/SP.PNG" alt="" id="BLOGGER_PHOTO_ID_5391241996339863106" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;To restore the images, mean filters are used. In this activity we used four filters.  To get the pixel value of the restored image &lt;span style="font-style: italic;"&gt;G&lt;/span&gt; at some pixel coordinate (&lt;span style="font-style: italic;"&gt;x&lt;/span&gt;,&lt;span style="font-style: italic;"&gt;y&lt;/span&gt;), we define an area &lt;span style="font-style: italic;"&gt;S&lt;/span&gt; with dimension &lt;span style="font-style: italic;"&gt;m&lt;/span&gt; x &lt;span style="font-style: italic;"&gt;n&lt;/span&gt; enclosing (&lt;span style="font-style: italic;"&gt;x&lt;/span&gt;,&lt;span style="font-style: italic;"&gt;y&lt;/span&gt;) where we can compute for the mean. To compute for the mean, we used the following equations.&lt;br /&gt;&lt;br /&gt;Arithmetic mean filter&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/StGMGhJnecI/AAAAAAAAAqE/aKn-BJoECWI/s1600-h/arith.PNG"&gt;&lt;img style="cursor: pointer; width: 193px; height: 61px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/StGMGhJnecI/AAAAAAAAAqE/aKn-BJoECWI/s400/arith.PNG" alt="" id="BLOGGER_PHOTO_ID_5391244272545003970" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;Geometric mean filter&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/StGMHINQC7I/AAAAAAAAAqM/368mkvC9Vbo/s1600-h/geo.PNG"&gt;&lt;img style="cursor: pointer; width: 217px; height: 93px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/StGMHINQC7I/AAAAAAAAAqM/368mkvC9Vbo/s400/geo.PNG" alt="" id="BLOGGER_PHOTO_ID_5391244283029228466" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;Harmonic mean filter&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/StGMHaiwreI/AAAAAAAAAqU/sk3ogaAYQVc/s1600-h/har.PNG"&gt;&lt;img style="cursor: pointer; width: 194px; height: 93px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/StGMHaiwreI/AAAAAAAAAqU/sk3ogaAYQVc/s400/har.PNG" alt="" id="BLOGGER_PHOTO_ID_5391244287951285730" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;Contraharmonic mean filter, where &lt;span style="font-style: italic;"&gt;Q&lt;/span&gt; can be positive or negative&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/StGMH7JbyfI/AAAAAAAAAqc/o5N3wST2-A4/s1600-h/contra.PNG"&gt;&lt;img style="cursor: pointer; width: 181px; height: 104px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/StGMH7JbyfI/AAAAAAAAAqc/o5N3wST2-A4/s400/contra.PNG" alt="" id="BLOGGER_PHOTO_ID_5391244296703429106" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;For the test image, we used the image below.&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/_ctLOE7SPslI/StGM2_12NjI/AAAAAAAAAqk/jGRXNKYLxGE/s1600-h/test_hist.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 175px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/StGM2_12NjI/AAAAAAAAAqk/jGRXNKYLxGE/s400/test_hist.png" alt="" id="BLOGGER_PHOTO_ID_5391245105417303602" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1. Left: Test image. Right: Its corresponding PDF.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-weight: bold;"&gt;Results&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Upon the addition of noise, we obtained the following images together with their PDFs. (click to enlarge)&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/StGKC6Ny9JI/AAAAAAAAAp8/aO-soOQlras/s1600-h/noise_added.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 258px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/StGKC6Ny9JI/AAAAAAAAAp8/aO-soOQlras/s400/noise_added.png" alt="" id="BLOGGER_PHOTO_ID_5391242011530687634" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2. Test image with noise added.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;div style="text-align: justify;"&gt;As evident in figure 2, upon addition of noise, the PDF of the original image takes the form of the distribution of the noise.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The following are the restored images. (click to enlarge) Here, we used a 3x3 area to compute the mean. Although not shown, the method is also tested for a 5x5 area. Using large area will result in a more blurred reconstruction.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/StGQ2SesnhI/AAAAAAAAAqs/I2Bld51Vz2k/s1600-h/exponential_rest33.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 260px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/StGQ2SesnhI/AAAAAAAAAqs/I2Bld51Vz2k/s400/exponential_rest33.png" alt="" id="BLOGGER_PHOTO_ID_5391249491287121426" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3. Image restoration for image with Exponential noise.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/StGSE8BHAPI/AAAAAAAAAq0/LueEQNNC6R4/s1600-h/gamma_rest33.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 260px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/StGSE8BHAPI/AAAAAAAAAq0/LueEQNNC6R4/s400/gamma_rest33.png" alt="" id="BLOGGER_PHOTO_ID_5391250842467107058" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 4. Image restoration for image with Gamma noise.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/StGSFl5bCbI/AAAAAAAAAq8/o0vWlEjv-_M/s1600-h/gaussian_rest33.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 260px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/StGSFl5bCbI/AAAAAAAAAq8/o0vWlEjv-_M/s400/gaussian_rest33.png" alt="" id="BLOGGER_PHOTO_ID_5391250853709154738" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 5. Image restoration for image with Gaussian noise.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/StGSGrhDdOI/AAAAAAAAArE/tVV4GmCZFZg/s1600-h/rayleigh_rest33.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 260px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/StGSGrhDdOI/AAAAAAAAArE/tVV4GmCZFZg/s400/rayleigh_rest33.png" alt="" id="BLOGGER_PHOTO_ID_5391250872397427938" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 6. Image restoration for image with Rayleigh noise.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/StGTIIDC3aI/AAAAAAAAArM/YXB_wZteOc8/s1600-h/sp_rest33.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 261px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/StGTIIDC3aI/AAAAAAAAArM/YXB_wZteOc8/s400/sp_rest33.png" alt="" id="BLOGGER_PHOTO_ID_5391251996747685282" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 7. Image restoration for image with Salt &amp;amp; Pepper noise.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/StGTIzhSKtI/AAAAAAAAArU/q9KiEDavDlg/s1600-h/uniform_rest33.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 260px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/StGTIzhSKtI/AAAAAAAAArU/q9KiEDavDlg/s400/uniform_rest33.png" alt="" id="BLOGGER_PHOTO_ID_5391252008417241810" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 8. Image restoration for image with Uniform noise.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;To check the quality of restoration, we should look back to the PDF of the original image.  From our results, the image is much restored except for the exponential noise wherein all of methods fail.  Notice that the white part of the original image is not recovered. Also notice that at the addition of noise, the exponential noise resulted in an almost unrecognizable image.  The distribution is bias to black (i.e. close to zero grayvalues).&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Salt &amp;amp; pepper noise is also another stubborn noise. Only the arithmetic filter shows satisfactory result.  It is also observed that at positive &lt;span style="font-style: italic;"&gt;Q&lt;/span&gt;, pepper noise is removed however white spots remain (i.e. salt noise). The effect is reversed for negative &lt;span style="font-style: italic;"&gt;Q&lt;/span&gt;.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;It is also observed the restored image have shifted PDFs in comparison with the original PDF.  This is probably due to the averaging method used by the filter.  To get an average of 1 or 255 (i.e. white) the area used must contain only white values which is impossible due to the presence of noise.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;For this activity, I'll give myself a 10 for completing the activity together with the analysis and for having cute plots ^_^&lt;br /&gt;&lt;br /&gt;Thanks to Gilbert Gubatan et al. for sharing the MODNUM toolbox for the Rayleigh noise.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&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/3974070185893700788-858937709753982063?l=thejaggernaut.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thejaggernaut.blogspot.com/feeds/858937709753982063/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thejaggernaut.blogspot.com/2009/10/activity-18-noise-model-and-basic-image.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/858937709753982063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/858937709753982063'/><link rel='alternate' type='text/html' href='http://thejaggernaut.blogspot.com/2009/10/activity-18-noise-model-and-basic-image.html' title='Activity 18: Noise Model and Basic Image Restoration'/><author><name>Mark Jayson Villangca</name><uri>http://www.blogger.com/profile/14897153276200167580</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/_ctLOE7SPslI/StGIxx6FVLI/AAAAAAAAApM/PQxyBlL7YaE/s72-c/Gaussian.PNG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3974070185893700788.post-5347117107250367816</id><published>2009-09-19T00:59:00.000-07:00</published><updated>2009-10-12T02:41:01.154-07:00</updated><title type='text'>Activity 17: Photometric Stereo</title><content type='html'>&lt;div style="text-align: justify;"&gt;Photometric stereo uses light intensity from different light sources to infer the shape of a three-dimensional surface. For this activity we used four images of a sphere illuminated with four light sources positioned at different locations. For each source, the corresponding images are the following&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/SrSQhuqzQ2I/AAAAAAAAAok/i_v1kkWQFQY/s1600-h/I1.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SrSQhuqzQ2I/AAAAAAAAAok/i_v1kkWQFQY/s320/I1.png" alt="" id="BLOGGER_PHOTO_ID_5383086363752219490" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SrSQiGlz1HI/AAAAAAAAAos/P39weDaD8bk/s1600-h/I2.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SrSQiGlz1HI/AAAAAAAAAos/P39weDaD8bk/s320/I2.png" alt="" id="BLOGGER_PHOTO_ID_5383086370173736050" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SrSQiGlz1HI/AAAAAAAAAos/P39weDaD8bk/s1600-h/I2.png"&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/SrSQjwpSDmI/AAAAAAAAAo0/iP59pwxb_rA/s1600-h/I3.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SrSQjwpSDmI/AAAAAAAAAo0/iP59pwxb_rA/s320/I3.png" alt="" id="BLOGGER_PHOTO_ID_5383086398642458210" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SrSQkaZ9HcI/AAAAAAAAAo8/E22VeHV0jO8/s1600-h/I4.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SrSQkaZ9HcI/AAAAAAAAAo8/E22VeHV0jO8/s320/I4.png" alt="" id="BLOGGER_PHOTO_ID_5383086409852460482" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1. Images&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;The reconstruction is shown below&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SrSRB-gENVI/AAAAAAAAApE/CmSeVRolIXY/s1600-h/stereo_recon.gif"&gt;&lt;img style="cursor: pointer; width: 400px; height: 302px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SrSRB-gENVI/AAAAAAAAApE/CmSeVRolIXY/s400/stereo_recon.gif" alt="" id="BLOGGER_PHOTO_ID_5383086917757973842" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2. Reconstruction.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The reconstruction is imperfect as shown in figure 2. However, to some extent the 3D features of our object has been reconstructed.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;For this activity, I'll give myself a 9 because my code uses lots of for loops.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3974070185893700788-5347117107250367816?l=thejaggernaut.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thejaggernaut.blogspot.com/feeds/5347117107250367816/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thejaggernaut.blogspot.com/2009/09/activity-17-photmetric-stereo.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/5347117107250367816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/5347117107250367816'/><link rel='alternate' type='text/html' href='http://thejaggernaut.blogspot.com/2009/09/activity-17-photmetric-stereo.html' title='Activity 17: Photometric Stereo'/><author><name>Mark Jayson Villangca</name><uri>http://www.blogger.com/profile/14897153276200167580</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/_ctLOE7SPslI/SrSQhuqzQ2I/AAAAAAAAAok/i_v1kkWQFQY/s72-c/I1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3974070185893700788.post-7844738380732119882</id><published>2009-09-19T00:40:00.000-07:00</published><updated>2009-10-12T02:39:30.787-07:00</updated><title type='text'>Activity 16: Neural Network</title><content type='html'>&lt;div style="text-align: justify;"&gt;This activity uses the same training and test sets as with the previous activities. The algorithm for the neural network requires us to "label" the classes that will be used for the training.  These labels will then be used to classify the test set.  If a test object gives an array similar to the "label" of a certain class, it is assigned to that class. Note that we used five nodes for the output layer. This was done so that there will be a high difference between classes.&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/_ctLOE7SPslI/SrSL3y1AhYI/AAAAAAAAAoc/9h7hM0waOf8/s1600-h/training.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 220px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SrSL3y1AhYI/AAAAAAAAAoc/9h7hM0waOf8/s400/training.png" alt="" id="BLOGGER_PHOTO_ID_5383081245267756418" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Figure 1. Training set labels.&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The implementation of the neural network is separated in two. One, with a learning rate of 0.1 while the other has a learning rate of 2.5.  The results are shown below (click for a larger image)&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/SrSL3G61NVI/AAAAAAAAAoM/W-0JYxDIk6g/s1600-h/lp01.png"&gt;&lt;img style="cursor: pointer; width: 91px; height: 400px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SrSL3G61NVI/AAAAAAAAAoM/W-0JYxDIk6g/s400/lp01.png" alt="" id="BLOGGER_PHOTO_ID_5383081233481020754" border="0" /&gt;&lt;/a&gt;                        &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SrSL3cBBBWI/AAAAAAAAAoU/l64xr5riDdc/s1600-h/lp25.png"&gt;&lt;img style="cursor: pointer; width: 92px; height: 400px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SrSL3cBBBWI/AAAAAAAAAoU/l64xr5riDdc/s400/lp25.png" alt="" id="BLOGGER_PHOTO_ID_5383081239144105314" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2. Summary of results. Left: Learning rate = 0.1. Right: Learning rate = 2.5.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Cells with red shading indicates wrong classification.  These false results are observed only with a neural network with low learning rate. For 2.5 learning rate, the classification is 100% accurate.  Also, compared to the previous methods, neural network shows a sharp distinction between classes. The values shown in figure 2 demonstrate this.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For this activity, I'll give myself a 9 for completing the activity and for the effort of figuring out how to implement a five node output layer neural network.&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/3974070185893700788-7844738380732119882?l=thejaggernaut.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thejaggernaut.blogspot.com/feeds/7844738380732119882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thejaggernaut.blogspot.com/2009/09/activity-16-neural-network.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/7844738380732119882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/7844738380732119882'/><link rel='alternate' type='text/html' href='http://thejaggernaut.blogspot.com/2009/09/activity-16-neural-network.html' title='Activity 16: Neural Network'/><author><name>Mark Jayson Villangca</name><uri>http://www.blogger.com/profile/14897153276200167580</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/_ctLOE7SPslI/SrSL3y1AhYI/AAAAAAAAAoc/9h7hM0waOf8/s72-c/training.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3974070185893700788.post-5258111703936882287</id><published>2009-09-14T04:08:00.000-07:00</published><updated>2009-09-14T04:15:45.887-07:00</updated><title type='text'>Activity 15: Probabilistic Classification</title><content type='html'>&lt;div style="text-align: justify;"&gt;This objective of this activity is similar to that of activity 14.  Here we will be using the linear discriminant analysis formula given by&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/Sq4lmJ0HQOI/AAAAAAAAAns/fzASVCLC9Og/s1600-h/equation1.png"&gt;&lt;img style="cursor: pointer; width: 320px; height: 56px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/Sq4lmJ0HQOI/AAAAAAAAAns/fzASVCLC9Og/s320/equation1.png" alt="" id="BLOGGER_PHOTO_ID_5381279942154076386" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Where µi is mean of the features of class i, x is the matrix of the features of object k, C is the covariance matrix. The object k is assigned to class i that has maximum fi [1]&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Here we used the same training set and test set as with activity 14. The result is shown below.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;Table 1. Summary of result.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/Sq4lmdlI_-I/AAAAAAAAAn0/V2r3uE_8S_M/s1600-h/LDA_result.png"&gt;&lt;img style="cursor: pointer; width: 272px; height: 320px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/Sq4lmdlI_-I/AAAAAAAAAn0/V2r3uE_8S_M/s320/LDA_result.png" alt="" id="BLOGGER_PHOTO_ID_5381279947459985378" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Again, the result shows 100% accuracy. The two coins are still close as with activity 14.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;For this activity I'll give myself 10 for completing the activity.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Reference:&lt;br /&gt;&lt;div style="text-align: justify;"&gt;[1] Teknomo, Kardi. Discriminant Analysis Tutorial. http://people.revoledu.com/kardi/ tutorial/LDA/&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/3974070185893700788-5258111703936882287?l=thejaggernaut.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thejaggernaut.blogspot.com/feeds/5258111703936882287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thejaggernaut.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/3974070185893700788/posts/default/5258111703936882287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/5258111703936882287'/><link rel='alternate' type='text/html' href='http://thejaggernaut.blogspot.com/2009/09/activity-15-probabilistic.html' title='Activity 15: Probabilistic Classification'/><author><name>Mark Jayson Villangca</name><uri>http://www.blogger.com/profile/14897153276200167580</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/_ctLOE7SPslI/Sq4lmJ0HQOI/AAAAAAAAAns/fzASVCLC9Og/s72-c/equation1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3974070185893700788.post-4147284329929118055</id><published>2009-09-13T20:40:00.000-07:00</published><updated>2009-09-13T23:03:53.850-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pattern recognition'/><title type='text'>Activity 14: Pattern Recognition</title><content type='html'>&lt;div style="text-align: justify;"&gt;For this activity, we tried to simulate the human brain’s capacity to differentiate objects.  We extracted features of different objects that can be compared (e.g. RGB components, area, eccentricity, etc). If a test object has features that is close to the features of a certain class, we assign it to that class.&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;First a training set is prepared to have a basis of comparison.  The test objects are the following&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/Sq3bD8jdMBI/AAAAAAAAAmo/N0kt3dp1biI/s1600-h/leaf1.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 30px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/Sq3bD8jdMBI/AAAAAAAAAmo/N0kt3dp1biI/s200/leaf1.png" alt="" id="BLOGGER_PHOTO_ID_5381197990618542098" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/Sq3bECg7-sI/AAAAAAAAAmw/4BvVWi7OLlU/s1600-h/leaf2.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 18px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/Sq3bECg7-sI/AAAAAAAAAmw/4BvVWi7OLlU/s200/leaf2.png" alt="" id="BLOGGER_PHOTO_ID_5381197992218589890" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/Sq3bEij8ckI/AAAAAAAAAm4/B6RUF1xzSnE/s1600-h/santan.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 38px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/Sq3bEij8ckI/AAAAAAAAAm4/B6RUF1xzSnE/s200/santan.png" alt="" id="BLOGGER_PHOTO_ID_5381198000821137986" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/Sq3bFAhiySI/AAAAAAAAAnA/B-OEdFvVZhk/s1600-h/coin1.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 35px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/Sq3bFAhiySI/AAAAAAAAAnA/B-OEdFvVZhk/s200/coin1.png" alt="" id="BLOGGER_PHOTO_ID_5381198008864131362" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/Sq3bFqwXfMI/AAAAAAAAAnI/iwkvAG8FfDA/s1600-h/coin25.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 41px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/Sq3bFqwXfMI/AAAAAAAAAnI/iwkvAG8FfDA/s200/coin25.png" alt="" id="BLOGGER_PHOTO_ID_5381198020200594626" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1. Training set.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The feature of each class is plotted (i.e. RG components, eccentricity).&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/Sq3bOUUWkOI/AAAAAAAAAnQ/jTW3XiPOy7c/s1600-h/patterngroup.gif"&gt;&lt;img style="cursor: pointer; width: 320px; height: 242px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/Sq3bOUUWkOI/AAAAAAAAAnQ/jTW3XiPOy7c/s320/patterngroup.gif" alt="" id="BLOGGER_PHOTO_ID_5381198168796336354" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Figure 2. Plot of the features of the training set.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;To determine which class a test object belongs, we used the Euclidean distance&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/_ctLOE7SPslI/Sq3bYfk7oRI/AAAAAAAAAnY/3bwlRdv5GKY/s1600-h/equation1.png"&gt;&lt;img style="cursor: pointer; width: 320px; height: 42px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/Sq3bYfk7oRI/AAAAAAAAAnY/3bwlRdv5GKY/s320/equation1.png" alt="" id="BLOGGER_PHOTO_ID_5381198343617356050" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Where dj represents the distance to class j, x is a matrix containing the features of the test object (the superscript T means transpose) and mj is the mean of the features of the class j.  The test object is assigned to the class that gives the largest d.  The results are as follow&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;Table 1. Summary of results.&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/_ctLOE7SPslI/Sq3bYpcx01I/AAAAAAAAAng/02Ost9ZQ8Aw/s1600-h/distance_result.png"&gt;&lt;img style="cursor: pointer; width: 272px; height: 320px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/Sq3bYpcx01I/AAAAAAAAAng/02Ost9ZQ8Aw/s320/distance_result.png" alt="" id="BLOGGER_PHOTO_ID_5381198346267513682" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The result shows 100% accuracy of the method for the chosen test objects.  However it should be noted the closeness of values for the coin test objects indicating that the method and/or the features chosen is insufficient to create a sharp distinction between very similar objects.&lt;br /&gt;&lt;br /&gt;For this activity, I'll give myself a 10 for completing it and for having satisfactory results.&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/3974070185893700788-4147284329929118055?l=thejaggernaut.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thejaggernaut.blogspot.com/feeds/4147284329929118055/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thejaggernaut.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/3974070185893700788/posts/default/4147284329929118055'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/4147284329929118055'/><link rel='alternate' type='text/html' href='http://thejaggernaut.blogspot.com/2009/09/activity-14-pattern-recognition.html' title='Activity 14: Pattern Recognition'/><author><name>Mark Jayson Villangca</name><uri>http://www.blogger.com/profile/14897153276200167580</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/_ctLOE7SPslI/Sq3bD8jdMBI/AAAAAAAAAmo/N0kt3dp1biI/s72-c/leaf1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3974070185893700788.post-1807828439161439173</id><published>2009-09-09T18:13:00.000-07:00</published><updated>2009-10-12T02:53:43.942-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Image Processing'/><category scheme='http://www.blogger.com/atom/ns#' term='Distortions'/><title type='text'>Activity 13: Correcting Geometric Distortions</title><content type='html'>&lt;div style="text-align: justify;"&gt;Distortion is an example of monochromatic aberrations.  Distortion arises because different areas of the lens have different focal length and different magnifications.  There are two types of distortion positive or pincushion distortion and negative or barrel distortion. Ideally, a thin lens will have no distortion. [1]&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/_ctLOE7SPslI/SqhblH-vlaI/AAAAAAAAAkQ/74GBi992cOs/s1600-h/600px-Barrel_distortion.svg.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 200px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SqhblH-vlaI/AAAAAAAAAkQ/74GBi992cOs/s200/600px-Barrel_distortion.svg.png" alt="" id="BLOGGER_PHOTO_ID_5379650448249558434" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/Sqhblh5fB7I/AAAAAAAAAkY/XuWruJT9x9g/s1600-h/600px-Pincushion_distortion.svg.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 200px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/Sqhblh5fB7I/AAAAAAAAAkY/XuWruJT9x9g/s200/600px-Pincushion_distortion.svg.png" alt="" id="BLOGGER_PHOTO_ID_5379650455206823858" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1. Left: Barrel distortion. Right:Pincushion distortion.  If there is no distortion, the above images will be regularly spaced grids.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;div style="text-align: justify;"&gt;For this activity, we are tasked to correct a distorted image by first assuming that the distorted image is just a linear transform of the ideal image and vice versa.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SqhmNBu-UcI/AAAAAAAAAlQ/7OJlp3B8pnQ/s1600-h/transform.png"&gt;&lt;img style="cursor: pointer; width: 397px; height: 165px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SqhmNBu-UcI/AAAAAAAAAlQ/7OJlp3B8pnQ/s400/transform.png" alt="" id="BLOGGER_PHOTO_ID_5379662128883847618" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2. Coordinate transformation.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The transformation functions are assumed to be bilinear functions of the form&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/Sqhmgjg9FdI/AAAAAAAAAlY/Qub3ZaNmsSA/s1600-h/eqn.png"&gt;&lt;img style="cursor: pointer; width: 167px; height: 47px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/Sqhmgjg9FdI/AAAAAAAAAlY/Qub3ZaNmsSA/s320/eqn.png" alt="" id="BLOGGER_PHOTO_ID_5379662464369366482" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;where x and y in the LHS are the pixel coordinates in the distorted image and the x and y in the RHS are for the ideal image.  After finding the coordinate transform, we look for the grayvalue at the ideal image pixel locations using a bilinear interpolation.&lt;br /&gt;&lt;br /&gt;For my distorted images, I used the ones below (Click for a larger view.)&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/_ctLOE7SPslI/SqhfG_ArrnI/AAAAAAAAAkg/7x3mO5BmaXQ/s1600-h/11378-before_grayscale.jpg"&gt;&lt;img style="cursor: pointer; width: 200px; height: 150px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SqhfG_ArrnI/AAAAAAAAAkg/7x3mO5BmaXQ/s200/11378-before_grayscale.jpg" alt="" id="BLOGGER_PHOTO_ID_5379654328492207730" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SqhfH9rvq2I/AAAAAAAAAkw/SQQKmiwc6Ls/s1600-h/SonyA100_geom_18_big.jpg"&gt;&lt;img style="cursor: pointer; width: 200px; height: 134px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SqhfH9rvq2I/AAAAAAAAAkw/SQQKmiwc6Ls/s200/SonyA100_geom_18_big.jpg" alt="" id="BLOGGER_PHOTO_ID_5379654345315822434" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3. Distorted images.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The results are the following. (Click for a larger view.)&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/_ctLOE7SPslI/SqhfHUHvpII/AAAAAAAAAko/CZMGWjt9GVk/s1600-h/recon.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 150px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SqhfHUHvpII/AAAAAAAAAko/CZMGWjt9GVk/s200/recon.png" alt="" id="BLOGGER_PHOTO_ID_5379654334158972034" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/SqhfIVqoLdI/AAAAAAAAAk4/3f3u4V7HYew/s1600-h/recon2.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 135px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SqhfIVqoLdI/AAAAAAAAAk4/3f3u4V7HYew/s200/recon2.png" alt="" id="BLOGGER_PHOTO_ID_5379654351753588178" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 4. Corrected images.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;Then results show that the method is sufficient to correct distortion of small images.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;For this activity, I'll give myself a 10 for satisfactory result. Note that the reconstructed image does not require anymore a second bilinear interpolation because no null pixels are found.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;Reference&lt;br /&gt;[1] E. Hecht (2002). Optics 4th edition. Addison Wesley , CA.&lt;br /&gt;          &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3974070185893700788-1807828439161439173?l=thejaggernaut.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thejaggernaut.blogspot.com/feeds/1807828439161439173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thejaggernaut.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/3974070185893700788/posts/default/1807828439161439173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/1807828439161439173'/><link rel='alternate' type='text/html' href='http://thejaggernaut.blogspot.com/2009/09/activity-13-correcting-geometric.html' title='Activity 13: Correcting Geometric Distortions'/><author><name>Mark Jayson Villangca</name><uri>http://www.blogger.com/profile/14897153276200167580</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/_ctLOE7SPslI/SqhblH-vlaI/AAAAAAAAAkQ/74GBi992cOs/s72-c/600px-Barrel_distortion.svg.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3974070185893700788.post-5579148646413360246</id><published>2009-08-07T09:50:00.000-07:00</published><updated>2009-08-07T11:00:32.268-07:00</updated><title type='text'>Activity 10: Preprocessing Text</title><content type='html'>&lt;div style="text-align: justify;"&gt;In this activity, we are asked to extract information from a scanned document (figure 1) specifically handwriting.  This activity is the integration of the techniques learned from the previous activities.  The first task at hand is to clean the image by removing the  horizontal and vertical lines present.  Here we used filtering just like in activity 7. For this part only a portion of the image is used.&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&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/_ctLOE7SPslI/SnxgYKCo1FI/AAAAAAAAAjA/A1ktqCCkuiQ/s1600-h/untitled_001.jpg"&gt;&lt;img style="cursor: pointer; width: 160px; height: 200px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SnxgYKCo1FI/AAAAAAAAAjA/A1ktqCCkuiQ/s200/untitled_001.jpg" alt="" id="BLOGGER_PHOTO_ID_5367270824047334482" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SnxgYboP2DI/AAAAAAAAAjI/P8ZjV9Kya1o/s1600-h/mogrify2_untitled002.bmp"&gt;&lt;img style="cursor: pointer; width: 200px; height: 124px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SnxgYboP2DI/AAAAAAAAAjI/P8ZjV9Kya1o/s200/mogrify2_untitled002.bmp" alt="" id="BLOGGER_PHOTO_ID_5367270828768483378" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1.  Left: The scanned document. Right: Cropped document.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;The image is binarized and inverted (i.e. high becomes low) since we are interested in the text hence it should have a value of 1 (i.e. it should be white).&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/_ctLOE7SPslI/Snxmnz8x1VI/AAAAAAAAAjQ/tAh8Ly6cR3A/s1600-h/invert_mogri2_untitled002.bmp"&gt;&lt;img style="cursor: pointer; width: 200px; height: 124px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/Snxmnz8x1VI/AAAAAAAAAjQ/tAh8Ly6cR3A/s200/invert_mogri2_untitled002.bmp" alt="" id="BLOGGER_PHOTO_ID_5367277690064852306" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SnxmoFsSYVI/AAAAAAAAAjY/jJ4IXRBn4-A/s1600-h/FT_inv_untitled002_logscale.bmp"&gt;&lt;img style="cursor: pointer; width: 200px; height: 124px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SnxmoFsSYVI/AAAAAAAAAjY/jJ4IXRBn4-A/s200/FT_inv_untitled002_logscale.bmp" alt="" id="BLOGGER_PHOTO_ID_5367277694827520338" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SnxmoijQQTI/AAAAAAAAAjg/c_-jhS1IWo0/s1600-h/filter.bmp"&gt;&lt;img style="cursor: pointer; width: 200px; height: 124px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SnxmoijQQTI/AAAAAAAAAjg/c_-jhS1IWo0/s200/filter.bmp" alt="" id="BLOGGER_PHOTO_ID_5367277702574260530" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/Snxmo_JAxxI/AAAAAAAAAjo/2OXgal4jXRw/s1600-h/filtered.bmp"&gt;&lt;img style="cursor: pointer; width: 200px; height: 124px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/Snxmo_JAxxI/AAAAAAAAAjo/2OXgal4jXRw/s200/filtered.bmp" alt="" id="BLOGGER_PHOTO_ID_5367277710248822546" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2. Top left: Binarized image. Top right: Its FFT. Bottom left: The filter which is binarized before multiplying with the FFT.  Bottom right: The filtered image.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;For further cleaning of unwanted white dots, morphological operations are also used from Activity 8 and 9.&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/_ctLOE7SPslI/SnxrL6gjQ5I/AAAAAAAAAjw/ial2izqGxkA/s1600-h/cleaned.bmp"&gt;&lt;img style="cursor: pointer; width: 200px; height: 124px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SnxrL6gjQ5I/AAAAAAAAAjw/ial2izqGxkA/s200/cleaned.bmp" alt="" id="BLOGGER_PHOTO_ID_5367282708347306898" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SnxrML6glDI/AAAAAAAAAj4/WivH45Fsi3E/s1600-h/cleaned_open.bmp"&gt;&lt;img style="cursor: pointer; width: 200px; height: 124px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SnxrML6glDI/AAAAAAAAAj4/WivH45Fsi3E/s200/cleaned_open.bmp" alt="" id="BLOGGER_PHOTO_ID_5367282713019585586" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Figure 3.  Left: Binarized image of the filtered image. Right: Image after opening operation&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;After cleaning, thinning is applied to make the text one pixel thick.&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/_ctLOE7SPslI/SnxrMV1r8HI/AAAAAAAAAkA/aSFphN7Qx1I/s1600-h/clean_open_thin.bmp"&gt;&lt;img style="cursor: pointer; width: 200px; height: 124px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SnxrMV1r8HI/AAAAAAAAAkA/aSFphN7Qx1I/s200/clean_open_thin.bmp" alt="" id="BLOGGER_PHOTO_ID_5367282715683713138" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Figure 4. Image after thinning operation.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The text in the final image is not recognizable indicating that the cleaning procedure is insufficient.&lt;br /&gt;&lt;br /&gt;Finally, correlation is also used to find occurances of the the word "DESCRIPTION" utilizing the technique in activity 5.&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/_ctLOE7SPslI/SnxrMk9aQXI/AAAAAAAAAkI/xZlvkxS08Q0/s1600-h/corr_description_highlighted.png"&gt;&lt;img style="cursor: pointer; width: 160px; height: 200px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SnxrMk9aQXI/AAAAAAAAAkI/xZlvkxS08Q0/s200/corr_description_highlighted.png" alt="" id="BLOGGER_PHOTO_ID_5367282719742640498" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Figure 5. Locations of the word "DESCRIPTION". (Click to enlarge.)&lt;br /&gt;&lt;br /&gt;&lt;/div&gt; &lt;span style="font-weight: bold;"&gt;What's annoying...&lt;/span&gt;&lt;br /&gt;Scilab crashes in Windows Vista when mogrify is used.&lt;br /&gt;&lt;br /&gt;For this activity, I'll give myself a 10 because I was able to use the techniques in the previous activities although I'm still not good at filtering.  Finding the right filter is a hard task.&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/3974070185893700788-5579148646413360246?l=thejaggernaut.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thejaggernaut.blogspot.com/feeds/5579148646413360246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thejaggernaut.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/3974070185893700788/posts/default/5579148646413360246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/5579148646413360246'/><link rel='alternate' type='text/html' href='http://thejaggernaut.blogspot.com/2009/08/activity-10-preprocessing-text.html' title='Activity 10: Preprocessing Text'/><author><name>Mark Jayson Villangca</name><uri>http://www.blogger.com/profile/14897153276200167580</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/_ctLOE7SPslI/SnxgYKCo1FI/AAAAAAAAAjA/A1ktqCCkuiQ/s72-c/untitled_001.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3974070185893700788.post-577830158143215097</id><published>2009-08-07T08:42:00.000-07:00</published><updated>2009-08-07T09:49:49.012-07:00</updated><title type='text'>Activity 12: Color Image Segmentation</title><content type='html'>&lt;div style="text-align: justify;"&gt;For this activity, we separated a particular color in an image.  If a color of an object in an image is uniform (i.e. no shading variations), it is relatively much easier to separate that particular object. However, this becomes difficult when dealing images of three dimensional objects because of shading variations.  To do this, we must indicate a "range" of colors that are present in an object (or more properly called as region of interest). To methods are presented here: parametric and non-parametric.  Parametric approach uses a function to specify the probability of a color to be present in the ROI.  The parameters of the function are computed from a patch of the ROI.  Non-parametric involves counting of the colors present in the ROI patch and the histogram of which is taken as the probability distribution.  The quality of segmentation depends on the size of the bins used in the histogram.  The results are as follows&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/_ctLOE7SPslI/SnxWFf9rEeI/AAAAAAAAAh4/5ftNOynYzWc/s1600-h/7.jpg"&gt;&lt;img style="cursor: pointer; width: 130px; height: 130px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SnxWFf9rEeI/AAAAAAAAAh4/5ftNOynYzWc/s200/7.jpg" alt="" id="BLOGGER_PHOTO_ID_5367259508398297570" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SnxWF0uzx7I/AAAAAAAAAiA/5JfejcKrEPQ/s1600-h/7_recon_or.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 130px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SnxWF0uzx7I/AAAAAAAAAiA/5JfejcKrEPQ/s200/7_recon_or.png" alt="" id="BLOGGER_PHOTO_ID_5367259513973098418" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SnxWGDZyo7I/AAAAAAAAAiI/GIcVsUKvcX0/s1600-h/7_recon_re.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 130px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SnxWGDZyo7I/AAAAAAAAAiI/GIcVsUKvcX0/s200/7_recon_re.png" alt="" id="BLOGGER_PHOTO_ID_5367259517911475122" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1. Left: Original image.  Middle: Parametric segmentation showing only orange objects. Right: Parametric segmentation showing only red objects.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SnxXnOBaFBI/AAAAAAAAAiQ/7zGJhUKPxRo/s1600-h/7_recon_nonparam_or.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 130px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SnxXnOBaFBI/AAAAAAAAAiQ/7zGJhUKPxRo/s200/7_recon_nonparam_or.png" alt="" id="BLOGGER_PHOTO_ID_5367261187209303058" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SnxXnY4bxOI/AAAAAAAAAiY/xAl8rzIMej0/s1600-h/7_recon_nonparam_or.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 130px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SnxXnY4bxOI/AAAAAAAAAiY/xAl8rzIMej0/s200/7_recon_nonparam_or.png" alt="" id="BLOGGER_PHOTO_ID_5367261190124455138" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SnxXnxQdRaI/AAAAAAAAAig/mW6f2TL5U_I/s1600-h/7_recon_nonparam_or.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 130px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SnxXnxQdRaI/AAAAAAAAAig/mW6f2TL5U_I/s200/7_recon_nonparam_or.png" alt="" id="BLOGGER_PHOTO_ID_5367261196667667874" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SnxZK-J__-I/AAAAAAAAAio/ZHn0cpUzV84/s1600-h/7_recon_nonparam_re.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 130px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SnxZK-J__-I/AAAAAAAAAio/ZHn0cpUzV84/s200/7_recon_nonparam_re.png" alt="" id="BLOGGER_PHOTO_ID_5367262900937293794" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SnxZLMXuejI/AAAAAAAAAiw/-DZ4lXehbGU/s1600-h/7_recon_nonparam_re.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 130px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SnxZLMXuejI/AAAAAAAAAiw/-DZ4lXehbGU/s200/7_recon_nonparam_re.png" alt="" id="BLOGGER_PHOTO_ID_5367262904752962098" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SnxZLanlNsI/AAAAAAAAAi4/u0LeVNE9Nbs/s1600-h/7_recon_nonparam_re.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 130px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SnxZLanlNsI/AAAAAAAAAi4/u0LeVNE9Nbs/s200/7_recon_nonparam_re.png" alt="" id="BLOGGER_PHOTO_ID_5367262908577560258" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2. Non-parametric segmentation with varying bin sizes 10, 32, 64 from left to right. Top row: Segmentation for orange objects. Bottom row: Segmentation for red objects.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;From figure 1 and 2, it can be noticed that the segmentation is not perfect. This is because of the limited size of the patch that used and also some of the objects in the image has some of the colors of the ROI.&lt;br /&gt;&lt;br /&gt;For this activity, I'll give myself a 9. I have to admit that this was done in a hurry. I still have lots of images but for reason of time conservation I opted to post just a few.&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/3974070185893700788-577830158143215097?l=thejaggernaut.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thejaggernaut.blogspot.com/feeds/577830158143215097/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thejaggernaut.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/3974070185893700788/posts/default/577830158143215097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/577830158143215097'/><link rel='alternate' type='text/html' href='http://thejaggernaut.blogspot.com/2009/08/activity-12-color-image-segmentation.html' title='Activity 12: Color Image Segmentation'/><author><name>Mark Jayson Villangca</name><uri>http://www.blogger.com/profile/14897153276200167580</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/_ctLOE7SPslI/SnxWFf9rEeI/AAAAAAAAAh4/5ftNOynYzWc/s72-c/7.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3974070185893700788.post-4278031132347543717</id><published>2009-08-07T00:40:00.000-07:00</published><updated>2009-08-07T08:39:20.355-07:00</updated><title type='text'>Activity 11: Color Image Processing</title><content type='html'>&lt;div style="text-align: justify;"&gt;Improperly white balanced images will result in incorrectly represented colors. Modern cameras has auto-white balance capability to ensure correct representation and other presets for different lighting conditions.  For this activity we captured images by using the presets (e.g. daylight, cloudy, fluorescent, incandescent) and perform white balancing algorithm to correct the captured images.&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;The algorithm that will be used are the white patch algorithm and the gray world algorithm.  The white patch algorithm uses the average RGB values of a white object in the image as balancing constants. While the gray world algorithm averages the RGB of the whole image and uses it as balancing constant.  Below are images taken outdoors and indoors under different white balancing presets in the camera.  The camera used is a cellphone camera (i.e. Sony Ericsson K550i with 2MP camera)&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/_ctLOE7SPslI/SnwmzQPpvDI/AAAAAAAAAdY/3HZSU2lxIug/s1600-h/DSC00776.JPG"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SnwmzQPpvDI/AAAAAAAAAdY/3HZSU2lxIug/s200/DSC00776.JPG" alt="" id="BLOGGER_PHOTO_ID_5367207517894589490" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/Snwmz0nr2mI/AAAAAAAAAdg/BoekGctY5lQ/s1600-h/recon776.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 97px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/Snwmz0nr2mI/AAAAAAAAAdg/BoekGctY5lQ/s200/recon776.png" alt="" id="BLOGGER_PHOTO_ID_5367207527659068002" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/Snwm0OaV1QI/AAAAAAAAAdo/PmvfAHmEVSQ/s1600-h/recon_gray776.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/Snwm0OaV1QI/AAAAAAAAAdo/PmvfAHmEVSQ/s200/recon_gray776.png" alt="" id="BLOGGER_PHOTO_ID_5367207534582420738" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/Snwp1_dmNCI/AAAAAAAAAdw/n4MkJTe4i5Y/s1600-h/DSC00777.JPG"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/Snwp1_dmNCI/AAAAAAAAAdw/n4MkJTe4i5Y/s200/DSC00777.JPG" alt="" id="BLOGGER_PHOTO_ID_5367210863464166434" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/Snwp2I1x3kI/AAAAAAAAAd4/OnELWIdvW74/s1600-h/recon777.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/Snwp2I1x3kI/AAAAAAAAAd4/OnELWIdvW74/s200/recon777.png" alt="" id="BLOGGER_PHOTO_ID_5367210865981513282" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/Snwp2ZNs7DI/AAAAAAAAAeA/7y3RjEle3y8/s1600-h/recon_gray777.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/Snwp2ZNs7DI/AAAAAAAAAeA/7y3RjEle3y8/s200/recon_gray777.png" alt="" id="BLOGGER_PHOTO_ID_5367210870376819762" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SnwvaOsMzRI/AAAAAAAAAeg/kBsWaa5xlxc/s1600-h/DSC00778.JPG"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SnwvaOsMzRI/AAAAAAAAAeg/kBsWaa5xlxc/s200/DSC00778.JPG" alt="" id="BLOGGER_PHOTO_ID_5367216983585377554" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SnwvaXPO7BI/AAAAAAAAAeo/NS963I7bslY/s1600-h/recon778.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 99px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SnwvaXPO7BI/AAAAAAAAAeo/NS963I7bslY/s200/recon778.png" alt="" id="BLOGGER_PHOTO_ID_5367216985879800850" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SnwvalTuM_I/AAAAAAAAAew/x9kcfv6Ire4/s1600-h/recon_gray778.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SnwvalTuM_I/AAAAAAAAAew/x9kcfv6Ire4/s200/recon_gray778.png" alt="" id="BLOGGER_PHOTO_ID_5367216989656724466" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/Snw0B_pzdzI/AAAAAAAAAe4/0xz8T_8dy8E/s1600-h/DSC00779.JPG"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/Snw0B_pzdzI/AAAAAAAAAe4/0xz8T_8dy8E/s200/DSC00779.JPG" alt="" id="BLOGGER_PHOTO_ID_5367222064790075186" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/Snw0CBGiNgI/AAAAAAAAAfA/GeGVW6_D7GU/s1600-h/recon779.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/Snw0CBGiNgI/AAAAAAAAAfA/GeGVW6_D7GU/s200/recon779.png" alt="" id="BLOGGER_PHOTO_ID_5367222065179014658" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/Snw0CXMu09I/AAAAAAAAAfI/96elhpl-KNU/s1600-h/recon_gray779.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/Snw0CXMu09I/AAAAAAAAAfI/96elhpl-KNU/s200/recon_gray779.png" alt="" id="BLOGGER_PHOTO_ID_5367222071110587346" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Figure 1. Outdoor images. First column: Original image. Second column: Balanced using white patch algorithm. Third column: Balanced using gray world algorithm.  The rows represent the white balancing preset used. First row: Daylight. Second row: Cloudy. Third row: Fluorescent. Fourth row: Incandescent.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/Snw3Z6PfCfI/AAAAAAAAAfQ/lA4Yw81r_ok/s1600-h/DSC00789.JPG"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/Snw3Z6PfCfI/AAAAAAAAAfQ/lA4Yw81r_ok/s200/DSC00789.JPG" alt="" id="BLOGGER_PHOTO_ID_5367225774189251058" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/Snw3aeMODmI/AAAAAAAAAfY/SbQfpsUKf6w/s1600-h/recon789.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/Snw3aeMODmI/AAAAAAAAAfY/SbQfpsUKf6w/s200/recon789.png" alt="" id="BLOGGER_PHOTO_ID_5367225783839231586" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/Snw3ahP7NYI/AAAAAAAAAfg/ioZ_mKJd6oU/s1600-h/recon_gray789.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/Snw3ahP7NYI/AAAAAAAAAfg/ioZ_mKJd6oU/s200/recon_gray789.png" alt="" id="BLOGGER_PHOTO_ID_5367225784660080002" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/Snw7LfpO0mI/AAAAAAAAAfo/A8DJAZK-JT4/s1600-h/DSC00790.JPG"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/Snw7LfpO0mI/AAAAAAAAAfo/A8DJAZK-JT4/s200/DSC00790.JPG" alt="" id="BLOGGER_PHOTO_ID_5367229924577825378" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/Snw7LvIcBVI/AAAAAAAAAfw/A6LSmltWCvQ/s1600-h/recon790.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/Snw7LvIcBVI/AAAAAAAAAfw/A6LSmltWCvQ/s200/recon790.png" alt="" id="BLOGGER_PHOTO_ID_5367229928735245650" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/Snw7MPgVAnI/AAAAAAAAAf4/VmTEH-hwrPo/s1600-h/recon_gray790.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/Snw7MPgVAnI/AAAAAAAAAf4/VmTEH-hwrPo/s200/recon_gray790.png" alt="" id="BLOGGER_PHOTO_ID_5367229937425384050" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/Snw-S3FlBkI/AAAAAAAAAgA/-AxYtIwo3N4/s1600-h/DSC00791.JPG"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/Snw-S3FlBkI/AAAAAAAAAgA/-AxYtIwo3N4/s200/DSC00791.JPG" alt="" id="BLOGGER_PHOTO_ID_5367233349664704066" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/Snw-TJGEUiI/AAAAAAAAAgI/Fx6llEvPFrk/s1600-h/recon791.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/Snw-TJGEUiI/AAAAAAAAAgI/Fx6llEvPFrk/s200/recon791.png" alt="" id="BLOGGER_PHOTO_ID_5367233354498593314" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/Snw-Tc8SkGI/AAAAAAAAAgQ/kXGoeFs40Lk/s1600-h/recon_gray791.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/Snw-Tc8SkGI/AAAAAAAAAgQ/kXGoeFs40Lk/s200/recon_gray791.png" alt="" id="BLOGGER_PHOTO_ID_5367233359826292834" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2. Indoor images. First column: Original image. Second column: Balanced using white patch algorithm. Third column: Balanced using gray world algorithm. The rows represent the white balancing preset used. First row: Daylight. Second row: Cloudy. Third row: Fluorescent. Fourth row: Incandescent.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;From the two sets of images, indoor and outdoor, the white patch algorithm produces better color representation than the gray world algorithm.  In white patch algorithm, white objects indeed appears white.  White objects serve as basis for the white balancing.  Gray algorithm highly depends on the dominant color in the image.  More clipping is also observed in gray world algorithm.  Both algorithms were also tested with subjects that has a dominant color which in this case is red&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/_ctLOE7SPslI/SnxC6Fn5VxI/AAAAAAAAAgY/acbH_57teWg/s1600-h/DSC00786.JPG"&gt;&lt;img style="cursor: pointer; width: 130px; height: 97px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SnxC6Fn5VxI/AAAAAAAAAgY/acbH_57teWg/s200/DSC00786.JPG" alt="" id="BLOGGER_PHOTO_ID_5367238421628147474" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/SnxC6EI1aaI/AAAAAAAAAgg/RACeSUYwRfQ/s1600-h/recon786.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 97px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SnxC6EI1aaI/AAAAAAAAAgg/RACeSUYwRfQ/s200/recon786.png" alt="" id="BLOGGER_PHOTO_ID_5367238421229431202" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SnxC6USu32I/AAAAAAAAAgo/f7mjRBg8xqs/s1600-h/recon_gray786.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SnxC6USu32I/AAAAAAAAAgo/f7mjRBg8xqs/s200/recon_gray786.png" alt="" id="BLOGGER_PHOTO_ID_5367238425565912930" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/SnxE36DmLQI/AAAAAAAAAgw/Dx9MU0LYEvM/s1600-h/DSC00787.JPG"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SnxE36DmLQI/AAAAAAAAAgw/Dx9MU0LYEvM/s200/DSC00787.JPG" alt="" id="BLOGGER_PHOTO_ID_5367240583186623746" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SnxE4AVaN2I/AAAAAAAAAg4/kNgcS5cGQ24/s1600-h/recon787.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SnxE4AVaN2I/AAAAAAAAAg4/kNgcS5cGQ24/s200/recon787.png" alt="" id="BLOGGER_PHOTO_ID_5367240584871950178" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SnxE4Y398-I/AAAAAAAAAhA/cTi74xxnwRA/s1600-h/recon_gray787.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SnxE4Y398-I/AAAAAAAAAhA/cTi74xxnwRA/s200/recon_gray787.png" alt="" id="BLOGGER_PHOTO_ID_5367240591459349474" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SnxGu5AMp0I/AAAAAAAAAhI/KZ2wfl3Owv0/s1600-h/DSC00788.JPG"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SnxGu5AMp0I/AAAAAAAAAhI/KZ2wfl3Owv0/s200/DSC00788.JPG" alt="" id="BLOGGER_PHOTO_ID_5367242627308365634" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SnxGvASYdaI/AAAAAAAAAhQ/kIlPoyW4arw/s1600-h/recon788.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SnxGvASYdaI/AAAAAAAAAhQ/kIlPoyW4arw/s200/recon788.png" alt="" id="BLOGGER_PHOTO_ID_5367242629263685026" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SnxGvTgevdI/AAAAAAAAAhY/MW9WwxQCEzE/s1600-h/recon_gray788.png"&gt;&lt;img style="cursor: pointer; width: 130px; height: 98px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SnxGvTgevdI/AAAAAAAAAhY/MW9WwxQCEzE/s200/recon_gray788.png" alt="" id="BLOGGER_PHOTO_ID_5367242634423090642" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3. Indoor incorrectly white balanced images with red as dominant. First column: Original image. Second column: Balanced using white patch algorithm. Third column: Balanced using gray world algorithm. The rows represent the white balancing preset used. First row: Incandescent. Second row: Daylight. Third row: Cloudy.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Figure 3 shows that white patch algorithm still produces more decent result.  The gray world algorithm produces images with a shade different from the dominant.  For example, in the first row of figure 3, the result of the gray world algorithm has a shade of blue.  For daylight and cloudy presets, the shade is yellow.&lt;br /&gt;&lt;br /&gt;For this activity, I'll give myself a 10 for completing the activity and for the effort to finish this.  This blog is posted using only a cellphone with GPRS connected to a laptop.&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/3974070185893700788-4278031132347543717?l=thejaggernaut.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thejaggernaut.blogspot.com/feeds/4278031132347543717/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thejaggernaut.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/3974070185893700788/posts/default/4278031132347543717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/4278031132347543717'/><link rel='alternate' type='text/html' href='http://thejaggernaut.blogspot.com/2009/08/activity-11-color-image-processing.html' title='Activity 11: Color Image Processing'/><author><name>Mark Jayson Villangca</name><uri>http://www.blogger.com/profile/14897153276200167580</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/_ctLOE7SPslI/SnwmzQPpvDI/AAAAAAAAAdY/3HZSU2lxIug/s72-c/DSC00776.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3974070185893700788.post-7719522756300577002</id><published>2009-08-06T18:17:00.000-07:00</published><updated>2009-08-07T00:39:53.296-07:00</updated><title type='text'>Activity 9: Binary Operation</title><content type='html'>&lt;div style="text-align: justify;"&gt;For this activity, we are given an image consisting of circular objects which may be thought  of as cells.  The objective is to find the average area of the cell.  One approach is to count it manually.  This is feasible for small image but definitely a problem for real world data processing.  The best way is to program it, however one problem of this approach is that binarized image may not be clean. The presence of those tiny white dots may lead to incorrect area estimation.&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&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/_ctLOE7SPslI/SnuHQYz26pI/AAAAAAAAAZw/mrBF_qNkTlo/s1600-h/Circles001.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 264px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SnuHQYz26pI/AAAAAAAAAZw/mrBF_qNkTlo/s320/Circles001.jpg" alt="" id="BLOGGER_PHOTO_ID_5367032096549694098" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1. Image to be processed.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;To solve this issue, I used the morphological operation called opening with a small circle (with radius less than the radius of the cells) as structuring element.  This is just erosion followed by dilation. The figure below shows how opening and its counterpart closing works. (Image taken from &lt;a href="http://ikpe1101.ikp.kfa-juelich.de/briefbook_data_analysis/node178.html"&gt;http://ikpe1101.ikp.kfa-juelich.de/briefbook_data_analysis/node178.html&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://3.bp.blogspot.com/_ctLOE7SPslI/SnuIMdyQvtI/AAAAAAAAAaA/aGw3SL5dIrM/s1600-h/img710.gif"&gt;&lt;img style="cursor: pointer; width: 339px; height: 400px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SnuIMdyQvtI/AAAAAAAAAaA/aGw3SL5dIrM/s400/img710.gif" alt="" id="BLOGGER_PHOTO_ID_5367033128677326546" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2. Demonstration of the opening and closing operation.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;Below are the sub-images of figure 1 each having a dimension 256x256.&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/_ctLOE7SPslI/Snui5O0jEDI/AAAAAAAAAaw/gKf6fqI7gUs/s1600-h/Circles001_001.jpg"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/Snui5O0jEDI/AAAAAAAAAaw/gKf6fqI7gUs/s200/Circles001_001.jpg" alt="" id="BLOGGER_PHOTO_ID_5367062485056819250" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/Snui5XqwYAI/AAAAAAAAAa4/dY2WaiUWo8U/s1600-h/Circles001_002.jpg"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/Snui5XqwYAI/AAAAAAAAAa4/dY2WaiUWo8U/s200/Circles001_002.jpg" alt="" id="BLOGGER_PHOTO_ID_5367062487431667714" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/Snui5xB1SSI/AAAAAAAAAbA/zpjBEq3M-us/s1600-h/Circles001_003.jpg"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/Snui5xB1SSI/AAAAAAAAAbA/zpjBEq3M-us/s200/Circles001_003.jpg" alt="" id="BLOGGER_PHOTO_ID_5367062494239344930" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/Snui6KpDQpI/AAAAAAAAAbI/HTgjt2EzGj0/s1600-h/Circles001_004.JPG"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/Snui6KpDQpI/AAAAAAAAAbI/HTgjt2EzGj0/s200/Circles001_004.JPG" alt="" id="BLOGGER_PHOTO_ID_5367062501114725010" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/Snui6PpQ_0I/AAAAAAAAAbQ/gmAWDRDU0nE/s1600-h/Circles001_005.JPG"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/Snui6PpQ_0I/AAAAAAAAAbQ/gmAWDRDU0nE/s200/Circles001_005.JPG" alt="" id="BLOGGER_PHOTO_ID_5367062502457802562" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SnujwI77imI/AAAAAAAAAbY/SyyduLwz-rs/s1600-h/Circles001_006.JPG"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SnujwI77imI/AAAAAAAAAbY/SyyduLwz-rs/s200/Circles001_006.JPG" alt="" id="BLOGGER_PHOTO_ID_5367063428369975906" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SnujwdHILvI/AAAAAAAAAbg/9q5OHltqCv8/s1600-h/Circles001_007.JPG"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SnujwdHILvI/AAAAAAAAAbg/9q5OHltqCv8/s200/Circles001_007.JPG" alt="" id="BLOGGER_PHOTO_ID_5367063433785650930" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SnujwsqO4LI/AAAAAAAAAbo/kN3J9pVLckE/s1600-h/Circles001_008.JPG"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SnujwsqO4LI/AAAAAAAAAbo/kN3J9pVLckE/s200/Circles001_008.JPG" alt="" id="BLOGGER_PHOTO_ID_5367063437959422130" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/Snujw04pemI/AAAAAAAAAbw/DUmAglQhC0A/s1600-h/Circles001_009.JPG"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/Snujw04pemI/AAAAAAAAAbw/DUmAglQhC0A/s200/Circles001_009.JPG" alt="" id="BLOGGER_PHOTO_ID_5367063440167369314" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3. Sub-images from figure 1.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The sub-images in figure 3 are binarized so that opening can be applied. After bwlabel was used to tag each blob. Finally, the area of each blob are tallied.&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/_ctLOE7SPslI/SnunXGRa18I/AAAAAAAAAb4/hJ9j2WQyRyg/s1600-h/circle_1.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SnunXGRa18I/AAAAAAAAAb4/hJ9j2WQyRyg/s200/circle_1.png" alt="" id="BLOGGER_PHOTO_ID_5367067396204582850" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SnunXXDuo_I/AAAAAAAAAcA/NWx5fKA2CNY/s1600-h/circle_2.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SnunXXDuo_I/AAAAAAAAAcA/NWx5fKA2CNY/s200/circle_2.png" alt="" id="BLOGGER_PHOTO_ID_5367067400710562802" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SnunX_tqwqI/AAAAAAAAAcI/Hcp_qfocne8/s1600-h/circle_3.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SnunX_tqwqI/AAAAAAAAAcI/Hcp_qfocne8/s200/circle_3.png" alt="" id="BLOGGER_PHOTO_ID_5367067411623887522" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/SnunYH3C9cI/AAAAAAAAAcQ/UIBN9pI9ZlU/s1600-h/circle_4.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SnunYH3C9cI/AAAAAAAAAcQ/UIBN9pI9ZlU/s200/circle_4.png" alt="" id="BLOGGER_PHOTO_ID_5367067413810705858" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SnunYS7IeBI/AAAAAAAAAcY/zqQQ_5137ps/s1600-h/circle_5.png"&gt; &lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SnunYS7IeBI/AAAAAAAAAcY/zqQQ_5137ps/s200/circle_5.png" alt="" id="BLOGGER_PHOTO_ID_5367067416780634130" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SnuoH9y1igI/AAAAAAAAAcg/BGt9z3Jxuv8/s1600-h/circle_6.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SnuoH9y1igI/AAAAAAAAAcg/BGt9z3Jxuv8/s200/circle_6.png" alt="" id="BLOGGER_PHOTO_ID_5367068235742415362" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SnuoIUsW85I/AAAAAAAAAco/EYHMs-Syn_g/s1600-h/circle_7.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SnuoIUsW85I/AAAAAAAAAco/EYHMs-Syn_g/s200/circle_7.png" alt="" id="BLOGGER_PHOTO_ID_5367068241889260434" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SnuoInW5BRI/AAAAAAAAAcw/HeRAyD1SOjk/s1600-h/circle_8.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SnuoInW5BRI/AAAAAAAAAcw/HeRAyD1SOjk/s200/circle_8.png" alt="" id="BLOGGER_PHOTO_ID_5367068246899492114" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SnuoJNbctUI/AAAAAAAAAc4/PjnnP32chH4/s1600-h/circle_9.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SnuoJNbctUI/AAAAAAAAAc4/PjnnP32chH4/s200/circle_9.png" alt="" id="BLOGGER_PHOTO_ID_5367068257119155522" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 4. Sub-images after labeling.  For visual clarity, jet colormap is used.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The result of the histogram is as follows.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SnvZACHjCJI/AAAAAAAAAdQ/cs0IlSdJj94/s1600-h/hist2.gif"&gt;&lt;img style="cursor: pointer; width: 320px; height: 248px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SnvZACHjCJI/AAAAAAAAAdQ/cs0IlSdJj94/s320/hist2.gif" alt="" id="BLOGGER_PHOTO_ID_5367121975533832338" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 5. Histogram of area of the blobs.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Upon removal of the outliers (i.e. area&gt;600 and area&lt;300), a value of 487 for the mean area was computed with standard deviation of 59.  The histogram in figure 5 corresponds to this result.&lt;br /&gt;&lt;br /&gt;For this activity, I'll give myself a 10 for completing the activity and producing satisfactory result.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3974070185893700788-7719522756300577002?l=thejaggernaut.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thejaggernaut.blogspot.com/feeds/7719522756300577002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thejaggernaut.blogspot.com/2009/08/activity-9-binary-operation.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/7719522756300577002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/7719522756300577002'/><link rel='alternate' type='text/html' href='http://thejaggernaut.blogspot.com/2009/08/activity-9-binary-operation.html' title='Activity 9: Binary Operation'/><author><name>Mark Jayson Villangca</name><uri>http://www.blogger.com/profile/14897153276200167580</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/_ctLOE7SPslI/SnuHQYz26pI/AAAAAAAAAZw/mrBF_qNkTlo/s72-c/Circles001.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3974070185893700788.post-5950108122283160677</id><published>2009-08-02T00:25:00.000-07:00</published><updated>2009-08-02T01:26:26.962-07:00</updated><title type='text'>Activity 8 : Morphological Operations</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Introduction&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;For this activity we observed the effect of different morphological operations like dilation, erosion, and other function in Scilab such as thin and skel.  We also observed the effect of different structuring element (SE) on the output image.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Dilation&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Dilation basically enlarges an image.  The expansion or elongation is dependent on the shape of the structuring element. The figure below shows the effect of dilation on a solid circle, solid square, hollow square, right triangle and a cross (i.e. the top row) using a 4x4, 4x2, 2x4 and cross image as structuring element (i.e. leftmost column). (Click on the image to enlarge)&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/_ctLOE7SPslI/SnVGScPdWuI/AAAAAAAAAV4/2fm6PMTqlE4/s1600-h/dilated.png"&gt;&lt;img style="cursor: pointer; width: 320px; height: 266px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SnVGScPdWuI/AAAAAAAAAV4/2fm6PMTqlE4/s320/dilated.png" alt="" id="BLOGGER_PHOTO_ID_5365271813714434786" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1. Demonstration of dilation on different test patterns.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;As demonstrated in figure 1 expansion is uniform in all direction when a 4x4 SE is used. Elongation is along the vertical and horizontal when a 4x2 and a 2x4 SE are used respectively.  With a cross as SE, the expansion is also uniform except at the corners where a dent is observed reflecting the shape of the cross SE.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Erosion&lt;/span&gt;&lt;br /&gt;Erosion is just the opposite of dilation.  All observations mentioned above are valid except that instead of expansion, reduction is observed.&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/_ctLOE7SPslI/SnVJJ58VyHI/AAAAAAAAAWA/wW6gsyFI4vs/s1600-h/eroded.png"&gt;&lt;img style="cursor: pointer; width: 320px; height: 266px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SnVJJ58VyHI/AAAAAAAAAWA/wW6gsyFI4vs/s320/eroded.png" alt="" id="BLOGGER_PHOTO_ID_5365274965603371122" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2. Demonstration of erosion on different test patterns.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-weight: bold;"&gt;Scilab's skel and thin&lt;/span&gt;&lt;br /&gt;skel function basically prunes a binary image, thus revealing its "skeleton".  thin function thins an image by border deletion.&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/_ctLOE7SPslI/SnVNR1uh86I/AAAAAAAAAWI/BSAIlQzqe0w/s1600-h/thinskel.png"&gt;&lt;img style="cursor: pointer; width: 320px; height: 159px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SnVNR1uh86I/AAAAAAAAAWI/BSAIlQzqe0w/s320/thinskel.png" alt="" id="BLOGGER_PHOTO_ID_5365279499957171106" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3. Demonstration of skel and thin on different test patterns.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;For completing the activity, I'll give myself a 10 ^_^&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3974070185893700788-5950108122283160677?l=thejaggernaut.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thejaggernaut.blogspot.com/feeds/5950108122283160677/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thejaggernaut.blogspot.com/2009/08/activity-8-morphological-operations.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/5950108122283160677'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/5950108122283160677'/><link rel='alternate' type='text/html' href='http://thejaggernaut.blogspot.com/2009/08/activity-8-morphological-operations.html' title='Activity 8 : Morphological Operations'/><author><name>Mark Jayson Villangca</name><uri>http://www.blogger.com/profile/14897153276200167580</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/_ctLOE7SPslI/SnVGScPdWuI/AAAAAAAAAV4/2fm6PMTqlE4/s72-c/dilated.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3974070185893700788.post-2622477989830474402</id><published>2009-07-26T20:26:00.000-07:00</published><updated>2009-08-06T17:17:56.550-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Image Enhancement'/><category scheme='http://www.blogger.com/atom/ns#' term='Fourier Transform'/><title type='text'>Activity 7: Enhancement in the Frequency Domain</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Introduction&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Fourier transform of an image gives the spatial frequencies present in it.  Because of this property of the FT it has been used to remove unwanted patterns. It will be demonstrated later how this fact will help improve the quality of an image.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;A. Convolution Theorem&lt;/span&gt;&lt;br /&gt;Convolution simply means "a little bit of the other".  The FT of a convolution of two functions in space is the product of the two functions' FT&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;FT [ f ∗g ]=FG&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;Below are images which display this fact.&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/_ctLOE7SPslI/Sm0qVBmG_YI/AAAAAAAAAP4/ljqjxSGUOII/s1600-h/dots.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/Sm0qVBmG_YI/AAAAAAAAAP4/ljqjxSGUOII/s200/dots.png" alt="" id="BLOGGER_PHOTO_ID_5362989271962025346" border="0" /&gt;&lt;/a&gt;&lt;span style="text-decoration: underline;"&gt; &lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/Sm0qVh77xXI/AAAAAAAAAQI/vQIwz_g-dCQ/s1600-h/FT_dots.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/Sm0qVh77xXI/AAAAAAAAAQI/vQIwz_g-dCQ/s200/FT_dots.png" alt="" id="BLOGGER_PHOTO_ID_5362989280643499378" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/Sm0qVZEoHSI/AAAAAAAAAQA/twCRf0lmb5M/s1600-h/bigdots.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/Sm0qVZEoHSI/AAAAAAAAAQA/twCRf0lmb5M/s200/bigdots.png" alt="" id="BLOGGER_PHOTO_ID_5362989278264040738" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/Sm0qV5Gq6nI/AAAAAAAAAQQ/z0s8Q08xdsA/s1600-h/FT_bigdots.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/Sm0qV5Gq6nI/AAAAAAAAAQQ/z0s8Q08xdsA/s200/FT_bigdots.png" alt="" id="BLOGGER_PHOTO_ID_5362989286862547570" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/Sm0qWJ9xncI/AAAAAAAAAQY/m_ZOZ4f-XVU/s1600-h/square.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/Sm0qWJ9xncI/AAAAAAAAAQY/m_ZOZ4f-XVU/s200/square.png" alt="" id="BLOGGER_PHOTO_ID_5362989291388640706" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/Sm0q2CtvQLI/AAAAAAAAAQg/g1Z44M8jNrE/s1600-h/FT_square.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/Sm0q2CtvQLI/AAAAAAAAAQg/g1Z44M8jNrE/s200/FT_square.png" alt="" id="BLOGGER_PHOTO_ID_5362989839198142642" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1. Top row: Two symmetric dots and its FT. Middle row:  Two symmetric circles and its FT. Bottom row: Two symmetric squares and its FT.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;div style="text-align: justify;"&gt;The two dots represent two dirac-delta functions which has a sinusoid FT.  The location of the dots represents the spatial frequency.  The image with two circles is the convolution of two dirac-delta and a circular aperture with a zero-order Bessel function as its FT.  The FT of the two circles is just the product of the FT of the two dirac-delta(i.e a sinusoid) and the FT of the circular apperture (i.e. Bessel function).  The same goes for the square only that its FT is a sinc function in two dimensions.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;FT is also an anamorphic transform. If the spacing is small in the real space domain it will be bigger in the inverse space.  Below are images of two Gaussian dots of increasing radius (i.e. increasing variance) and their respective FTs.&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/_ctLOE7SPslI/Sm0wU7efpDI/AAAAAAAAAQo/1pe9zVnYG94/s1600-h/gaussiandots_var4.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/Sm0wU7efpDI/AAAAAAAAAQo/1pe9zVnYG94/s200/gaussiandots_var4.png" alt="" id="BLOGGER_PHOTO_ID_5362995867389240370" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/Sm0wqxCKS6I/AAAAAAAAARY/8-f7dLWeBEQ/s1600-h/FT_gaussiandots_var4.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/Sm0wqxCKS6I/AAAAAAAAARY/8-f7dLWeBEQ/s200/FT_gaussiandots_var4.png" alt="" id="BLOGGER_PHOTO_ID_5362996242543168418" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/Sm0wVDqFHPI/AAAAAAAAAQw/NDYTm-UCTTo/s1600-h/gaussiandots_var10.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/Sm0wVDqFHPI/AAAAAAAAAQw/NDYTm-UCTTo/s200/gaussiandots_var10.png" alt="" id="BLOGGER_PHOTO_ID_5362995869585317106" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/Sm0wq86D3CI/AAAAAAAAARg/-P89rtP8VPM/s1600-h/FT_gaussiandots_var10.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/Sm0wq86D3CI/AAAAAAAAARg/-P89rtP8VPM/s200/FT_gaussiandots_var10.png" alt="" id="BLOGGER_PHOTO_ID_5362996245730417698" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/Sm0wqhZoxrI/AAAAAAAAARQ/Xp_0vRlRCUo/s1600-h/gaussiandots_var25.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/Sm0wqhZoxrI/AAAAAAAAARQ/Xp_0vRlRCUo/s200/gaussiandots_var25.png" alt="" id="BLOGGER_PHOTO_ID_5362996238346667698" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/Sm0wrDAb84I/AAAAAAAAARo/-Dj4p401fTw/s1600-h/FT_gaussiandots_var25.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/Sm0wrDAb84I/AAAAAAAAARo/-Dj4p401fTw/s200/FT_gaussiandots_var25.png" alt="" id="BLOGGER_PHOTO_ID_5362996247367775106" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1. Two symmetric Gaussian dots and their respective FTs. Top row: Variance = 4. Middle row: Variance = 10. Bottom row: Variance = 25.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;The Gaussian dots are generated by the following code&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;[x,y]=meshgrid(linspace(-10,10,128),linspace(-10,10,128));&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;mu=5;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;var=20;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;I=exp(-(((x+mu).^2+y.^2).^2)./var^2)+exp(-(((x-mu).^2+y.^2).^2)./var^2);&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;We also compare the real and imaginary part of the Gaussian dots with its inverted counterpart.&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/_ctLOE7SPslI/Snqj_AMDSQI/AAAAAAAAAWY/kurX7DS0DCk/s1600-h/reFT.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/Snqj_AMDSQI/AAAAAAAAAWY/kurX7DS0DCk/s320/reFT.png" alt="" id="BLOGGER_PHOTO_ID_5366782208743000322" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/Snqj-90et6I/AAAAAAAAAWQ/1f3VnSjZCVo/s1600-h/reFT2.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/Snqj-90et6I/AAAAAAAAAWQ/1f3VnSjZCVo/s320/reFT2.png" alt="" id="BLOGGER_PHOTO_ID_5366782208107263906" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/Snqj_eiv-jI/AAAAAAAAAWg/uTupNAu8kq8/s1600-h/imFT2.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/Snqj_eiv-jI/AAAAAAAAAWg/uTupNAu8kq8/s320/imFT2.png" alt="" id="BLOGGER_PHOTO_ID_5366782216891267634" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/Snqj_sHOblI/AAAAAAAAAWo/Myl-mY5nsQk/s1600-h/imFT.png"&gt;&lt;img style="cursor: pointer; width: 128px; height: 128px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/Snqj_sHOblI/AAAAAAAAAWo/Myl-mY5nsQk/s320/imFT.png" alt="" id="BLOGGER_PHOTO_ID_5366782220533919314" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3. Comparison between the real part of two Gaussian dots ( top left) and its inverted counterpart ( top right).  The bottom row corresponds to the imaginary parts.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;From figure 3. We can see that inversion only affects the real part of the FT.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;B. Fingerprint: Ridge Enhancement&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Since FT gives the spatial frequencies present in the image, it then also possible to remove unwanted frequencies through filtering.  Basically, a filter is a mask that will block out unwanted frequencies.  For this part, we will use a binary image for our filter.&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/_ctLOE7SPslI/Sm03ELvNNhI/AAAAAAAAASQ/c-lrReIUjwg/s1600-h/fingerprint.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 186px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/Sm03ELvNNhI/AAAAAAAAASQ/c-lrReIUjwg/s200/fingerprint.png" alt="" id="BLOGGER_PHOTO_ID_5363003276277921298" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/Sm03ESvgNWI/AAAAAAAAASY/fFH8QIk-CDs/s1600-h/FT_fingerprint_logscale.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 186px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/Sm03ESvgNWI/AAAAAAAAASY/fFH8QIk-CDs/s200/FT_fingerprint_logscale.png" alt="" id="BLOGGER_PHOTO_ID_5363003278158214498" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/Snttprp3kKI/AAAAAAAAAZI/odE_TDDv_f0/s1600-h/filter_FT_fingerprint_logscale.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 186px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/Snttprp3kKI/AAAAAAAAAZI/odE_TDDv_f0/s200/filter_FT_fingerprint_logscale.png" alt="" id="BLOGGER_PHOTO_ID_5367003943802474658" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SnttqgVGmfI/AAAAAAAAAZY/YP1nu77leSQ/s1600-h/filtered_fingerprint.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 186px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SnttqgVGmfI/AAAAAAAAAZY/YP1nu77leSQ/s200/filtered_fingerprint.png" alt="" id="BLOGGER_PHOTO_ID_5367003957942458866" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 4. Top left: The original image. Top right: Its FT in logarithmic scale. Bottom left: The filter. Bottom right: The filter image.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The frequencies corresponding to the fingerprint those that have lighter color (figure 4 top right).  Hence we design a filter that highlights that part and zero out the rest of the frequencies. The reconstructed image has continuous ridges compare to the original showing that the method works although the image appears blur since higher frequencies are removed.  High frequencies are required for sharp edges.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;C. Lunar Landing Scanned Pictures: Line Removal&lt;/span&gt;&lt;br /&gt;For this part, we will also use the same method as above only that we will this time remove unwanted features in the picture, that is the vertical and horizontal lines.&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/_ctLOE7SPslI/Sm06Up7NBWI/AAAAAAAAASw/aSDX6_3zYAo/s1600-h/hi_res_vertical_lg.gif"&gt;&lt;img style="cursor: pointer; width: 200px; height: 150px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/Sm06Up7NBWI/AAAAAAAAASw/aSDX6_3zYAo/s200/hi_res_vertical_lg.gif" alt="" id="BLOGGER_PHOTO_ID_5363006857794094434" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/Sm06Va6-tBI/AAAAAAAAAS4/VhjN-pWI8uQ/s1600-h/FT_hi_res_ver.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 150px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/Sm06Va6-tBI/AAAAAAAAAS4/VhjN-pWI8uQ/s200/FT_hi_res_ver.png" alt="" id="BLOGGER_PHOTO_ID_5363006870946493458" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SnqtWCOh5TI/AAAAAAAAAXY/ax5dDfGj9ww/s1600-h/filter2_FT_hi_res_ver.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 150px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SnqtWCOh5TI/AAAAAAAAAXY/ax5dDfGj9ww/s200/filter2_FT_hi_res_ver.png" alt="" id="BLOGGER_PHOTO_ID_5366792500031907122" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/SnqtW8JMR-I/AAAAAAAAAXo/5x74hD2c7QQ/s1600-h/filter_FT_hi_res_ver.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 150px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SnqtW8JMR-I/AAAAAAAAAXo/5x74hD2c7QQ/s200/filter_FT_hi_res_ver.png" alt="" id="BLOGGER_PHOTO_ID_5366792515578775522" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/SnqtWTZ2MWI/AAAAAAAAAXg/BeGbdt0387k/s1600-h/filtered2_hi_res_ver.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 150px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SnqtWTZ2MWI/AAAAAAAAAXg/BeGbdt0387k/s200/filtered2_hi_res_ver.png" alt="" id="BLOGGER_PHOTO_ID_5366792504642777442" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SnqtXS0LD_I/AAAAAAAAAXw/RoOaNABOW7A/s1600-h/filtered_hi_res_ver.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 150px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SnqtXS0LD_I/AAAAAAAAAXw/RoOaNABOW7A/s200/filtered_hi_res_ver.png" alt="" id="BLOGGER_PHOTO_ID_5366792521664630770" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 5. Top left: The original image. Top right: Its FT in logarithmic scale. Middle left: Filter to remove vertical lines. Middle right: Another filter to remove both vertical and horizontal lines. Bottom left: Filtered image with vertical lines removed. Bottom right: Filtered image with both vertical and horizontal lines removed.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;The filtered image (especially figure 5 bottom right) appears cleaner.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;span style="font-weight: bold;"&gt;D. Canvas Weave Modeling and Removal&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;For this part a more complex image will be enhanced.  The canvas weave pattern contains horizontal,vertical and diagonal lines&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/_ctLOE7SPslI/Sm0_gZc1gkI/AAAAAAAAATg/ZKnKElOCbBA/s1600-h/canvasweave_gray.jpg"&gt;&lt;img style="cursor: pointer; width: 200px; height: 144px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/Sm0_gZc1gkI/AAAAAAAAATg/ZKnKElOCbBA/s200/canvasweave_gray.jpg" alt="" id="BLOGGER_PHOTO_ID_5363012557088326210" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/Sm0_g9m4rNI/AAAAAAAAATo/XvEaUGTmFlM/s1600-h/FT_canvas_log.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 144px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/Sm0_g9m4rNI/AAAAAAAAATo/XvEaUGTmFlM/s200/FT_canvas_log.png" alt="" id="BLOGGER_PHOTO_ID_5363012566794153170" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/SnrHdcDmzHI/AAAAAAAAAX4/ee4_exggC4w/s1600-h/filter_canvas.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 144px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SnrHdcDmzHI/AAAAAAAAAX4/ee4_exggC4w/s200/filter_canvas.png" alt="" id="BLOGGER_PHOTO_ID_5366821214526819442" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SnrHdqePqRI/AAAAAAAAAYA/vt8aUljVQFw/s1600-h/filter2_canvas.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 144px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SnrHdqePqRI/AAAAAAAAAYA/vt8aUljVQFw/s200/filter2_canvas.png" alt="" id="BLOGGER_PHOTO_ID_5366821218396645650" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/Sm1GnupOiAI/AAAAAAAAAVQ/EoqPdV0DSYE/s1600-h/filtered_FT_canvas_log2.JPG"&gt;  &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SnrJKpzaClI/AAAAAAAAAYY/ICaE5oGc3Sk/s1600-h/filtered_canvas_log.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 144px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SnrJKpzaClI/AAAAAAAAAYY/ICaE5oGc3Sk/s200/filtered_canvas_log.png" alt="" id="BLOGGER_PHOTO_ID_5366823090822711890" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/SnrJLOJPdoI/AAAAAAAAAYg/Zt9hewP1Qj4/s1600-h/filtered2_canvas_log.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 144px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SnrJLOJPdoI/AAAAAAAAAYg/Zt9hewP1Qj4/s200/filtered2_canvas_log.png" alt="" id="BLOGGER_PHOTO_ID_5366823100577969794" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 6. Top left: The original image. Top right: Its FT in logarithmic scale. Middle left: Filter to remove diagonal canvas weave. Middle right: Another filter to remove diagonal, vertical and horizontal canvas weave. Bottom left: Filtered image with diagonal canvas weave removed. Bottom right: Filtered image with diagonal, vertical and horizontal canvas weave removed.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;As with the above, filtered images are cleaner although the brushstrokes are not apparent.&lt;br /&gt;&lt;br /&gt;We also inverted the filter and take its FT to see if we can recover the canvas weave.&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/_ctLOE7SPslI/SnrSahboyGI/AAAAAAAAAYo/Al_rM3R7j2g/s1600-h/filter_canvas_inv.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 144px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SnrSahboyGI/AAAAAAAAAYo/Al_rM3R7j2g/s200/filter_canvas_inv.png" alt="" id="BLOGGER_PHOTO_ID_5366833259058088034" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SnrSbJKavgI/AAAAAAAAAY4/o0oaY_E23nw/s1600-h/canvas_recon1.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 144px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SnrSbJKavgI/AAAAAAAAAY4/o0oaY_E23nw/s200/canvas_recon1.png" alt="" id="BLOGGER_PHOTO_ID_5366833269723282946" border="0" /&gt;&lt;/a&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/_ctLOE7SPslI/SnrSa7NvGGI/AAAAAAAAAYw/j2QUwbCnmkM/s1600-h/filter2_canvas_inv.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 144px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SnrSa7NvGGI/AAAAAAAAAYw/j2QUwbCnmkM/s200/filter2_canvas_inv.png" alt="" id="BLOGGER_PHOTO_ID_5366833265979103330" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SnrSboRKBZI/AAAAAAAAAZA/q8zWBUcOQLs/s1600-h/canvas_recon2.png"&gt;&lt;img style="cursor: pointer; width: 200px; height: 144px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SnrSboRKBZI/AAAAAAAAAZA/q8zWBUcOQLs/s200/canvas_recon2.png" alt="" id="BLOGGER_PHOTO_ID_5366833278073046418" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 7. Top row: The inverse of the filter in figure 6 and its FT. Bottom row: The other filter and its FT&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The canvas weave are recovered for each filter although they are not uniform.  This indicates that the filter is not perfect or asymmetric.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Paint.NET&lt;br /&gt;&lt;/span&gt;For this activity we used lots of editing in making the filter.  For reasons of quality I always save my images in PNG format, however MS Paint cannot open PNG files which is troublesome since I have to export it again to a compatible format.  Then I found Paint.NET while searching how to make PNG compatible with MS Paint.  It is an alternative to MS Paint but has more tools. It is almost similar to Adobe Photoshop and GIMP.  The good thing is that it only takes less than 4MB of disk space. Visit: &lt;a href="http://www.getpaint.net/index.html"&gt;http://www.getpaint.net/index.html&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;Note:&lt;/span&gt;&lt;span&gt; This is available only for Windows and requires Microsoft .NET Framework 3.5 SP1 (which can be downloaded for free at the Microsoft website).&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Acknowledgements&lt;/span&gt;&lt;br /&gt;I would like to thank Luis Buno for helpful discussions especially with recovering the canvas weave.  Special thanks also to my late night buddies (i.e. cramming buddies).&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;For this activity I'll give myself a 10 for completing the activity, though the fingerprint result is not satisfactory but at least I did my best. ^_^&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/Sm0_gZc1gkI/AAAAAAAAATg/ZKnKElOCbBA/s1600-h/canvasweave_gray.jpg"&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3974070185893700788-2622477989830474402?l=thejaggernaut.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thejaggernaut.blogspot.com/feeds/2622477989830474402/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thejaggernaut.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/3974070185893700788/posts/default/2622477989830474402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/2622477989830474402'/><link rel='alternate' type='text/html' href='http://thejaggernaut.blogspot.com/2009/07/activity-7-enhancement-in-frequency.html' title='Activity 7: Enhancement in the Frequency Domain'/><author><name>Mark Jayson Villangca</name><uri>http://www.blogger.com/profile/14897153276200167580</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/_ctLOE7SPslI/Sm0qVBmG_YI/AAAAAAAAAP4/ljqjxSGUOII/s72-c/dots.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3974070185893700788.post-8725999299484131854</id><published>2009-07-09T04:02:00.000-07:00</published><updated>2009-07-09T21:40:26.686-07:00</updated><title type='text'>Activity 6: Properties of the 2D Fourier Transform</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Introduction&lt;/span&gt;&lt;br /&gt;The following activity demonstrate the properties unique to the 2D FT. 2D FT means applying the FT twice (once along the x and another along the y).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;A. Fourier Transform of Different Patterns&lt;/span&gt;&lt;br /&gt;Below are some patterns and their corresponding FT. (Click the image for a larger view.)&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/_ctLOE7SPslI/SlXSbZeiTFI/AAAAAAAAAJo/2cyRPRUqWVY/s1600-h/anunulus.bmp"&gt;&lt;img style="cursor: pointer; width: 77px; height: 77px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SlXSbZeiTFI/AAAAAAAAAJo/2cyRPRUqWVY/s200/anunulus.bmp" alt="" id="BLOGGER_PHOTO_ID_5356418699964337234" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SlXSeFq7dxI/AAAAAAAAAJ4/gbEy7ECNO8M/s1600-h/slits.bmp"&gt;  &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SlXSeUmx_NI/AAAAAAAAAKA/U6Ns4b6C_IM/s1600-h/square.bmp"&gt;&lt;img style="cursor: pointer; width: 77px; height: 77px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SlXSeUmx_NI/AAAAAAAAAKA/U6Ns4b6C_IM/s200/square.bmp" alt="" id="BLOGGER_PHOTO_ID_5356418750196350162" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SlXSeiQgwbI/AAAAAAAAAKI/-S_Umm9KA80/s1600-h/square_anu.bmp"&gt;&lt;img style="cursor: pointer; width: 77px; height: 77px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SlXSeiQgwbI/AAAAAAAAAKI/-S_Umm9KA80/s200/square_anu.bmp" alt="" id="BLOGGER_PHOTO_ID_5356418753861042610" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SlaUMKFdAyI/AAAAAAAAANA/472c7DbIrRg/s1600-h/dots.bmp"&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SlaUMKFdAyI/AAAAAAAAANA/472c7DbIrRg/s1600-h/dots.bmp"&gt;&lt;img style="cursor: pointer; width: 77px; height: 77px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SlaUMKFdAyI/AAAAAAAAANA/472c7DbIrRg/s200/dots.bmp" alt="" id="BLOGGER_PHOTO_ID_5356631743390352162" border="0" /&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SlaUM5MdHmI/AAAAAAAAANQ/9KUsTTdY3R0/s1600-h/slits.bmp"&gt;&lt;img style="cursor: pointer; width: 76px; height: 76px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SlaUM5MdHmI/AAAAAAAAANQ/9KUsTTdY3R0/s200/slits.bmp" alt="" id="BLOGGER_PHOTO_ID_5356631756036185698" border="0" /&gt;&lt;/a&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/_ctLOE7SPslI/SlXT3tpKjuI/AAAAAAAAAKQ/SC-MeELYv48/s1600-h/FT_annulus.bmp"&gt;&lt;img style="cursor: pointer; width: 80px; height: 79px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SlXT3tpKjuI/AAAAAAAAAKQ/SC-MeELYv48/s200/FT_annulus.bmp" alt="" id="BLOGGER_PHOTO_ID_5356420285925592802" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SlXT5dwhCkI/AAAAAAAAAKo/CsIG4i1WiTY/s1600-h/FT_square.bmp"&gt;&lt;img style="cursor: pointer; width: 81px; height: 79px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SlXT5dwhCkI/AAAAAAAAAKo/CsIG4i1WiTY/s200/FT_square.bmp" alt="" id="BLOGGER_PHOTO_ID_5356420316021197378" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SlXT5tvhMXI/AAAAAAAAAKw/GDQ4MLbu8vA/s1600-h/FT_square_anu.bmp"&gt;&lt;img style="cursor: pointer; width: 80px; height: 80px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SlXT5tvhMXI/AAAAAAAAAKw/GDQ4MLbu8vA/s200/FT_square_anu.bmp" alt="" id="BLOGGER_PHOTO_ID_5356420320311980402" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/Sla_gs1IBUI/AAAAAAAAAPo/hFBnKmKyiIk/s1600-h/FT_dots.bmp"&gt;&lt;img style="cursor: pointer; width: 80px; height: 80px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/Sla_gs1IBUI/AAAAAAAAAPo/hFBnKmKyiIk/s200/FT_dots.bmp" alt="" id="BLOGGER_PHOTO_ID_5356679375314486594" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/Sla_wepSe9I/AAAAAAAAAPw/4f4spbPy2LI/s1600-h/FT_slits.bmp"&gt;&lt;img style="cursor: pointer; width: 80px; height: 80px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/Sla_wepSe9I/AAAAAAAAAPw/4f4spbPy2LI/s200/FT_slits.bmp" alt="" id="BLOGGER_PHOTO_ID_5356679646384651218" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1. Top row: Some arbitrary patterns. Bottom row: Their corresponding FFT.&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;B. Anamorphic Property of the Fourier Transform&lt;/span&gt;&lt;br /&gt;Basically, the FT gives the frequencies present in the input image.  It treats the image as a sum of sinusoids. Below are sinusoids of different frequencies and their corresponding FT.&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/_ctLOE7SPslI/SlXdoptVDbI/AAAAAAAAAK4/9vNe9c3y4lA/s1600-h/sin_x_f1.bmp"&gt;&lt;img style="cursor: pointer; width: 104px; height: 104px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SlXdoptVDbI/AAAAAAAAAK4/9vNe9c3y4lA/s200/sin_x_f1.bmp" alt="" id="BLOGGER_PHOTO_ID_5356431022287556018" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SlXdpEcBoLI/AAAAAAAAALA/WbXao58Viaw/s1600-h/sin_x_f3.bmp"&gt;&lt;img style="cursor: pointer; width: 103px; height: 103px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SlXdpEcBoLI/AAAAAAAAALA/WbXao58Viaw/s200/sin_x_f3.bmp" alt="" id="BLOGGER_PHOTO_ID_5356431029462737074" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SlXdpezwQ1I/AAAAAAAAALI/aWsiAoNT5Ug/s1600-h/sin_x_f5.bmp"&gt;&lt;img style="cursor: pointer; width: 103px; height: 103px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SlXdpezwQ1I/AAAAAAAAALI/aWsiAoNT5Ug/s200/sin_x_f5.bmp" alt="" id="BLOGGER_PHOTO_ID_5356431036541584210" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SlXdpYo0q8I/AAAAAAAAALQ/Fg6VtyZXXIc/s1600-h/sin_x_f9.bmp"&gt;&lt;img style="cursor: pointer; width: 104px; height: 104px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SlXdpYo0q8I/AAAAAAAAALQ/Fg6VtyZXXIc/s200/sin_x_f9.bmp" alt="" id="BLOGGER_PHOTO_ID_5356431034885123010" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SlXfGS3thQI/AAAAAAAAALY/xdv6ES1BP8g/s1600-h/FT_sin_x_f1.bmp"&gt;&lt;img style="cursor: pointer; width: 104px; height: 104px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SlXfGS3thQI/AAAAAAAAALY/xdv6ES1BP8g/s200/FT_sin_x_f1.bmp" alt="" id="BLOGGER_PHOTO_ID_5356432631064790274" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SlXfGoKlYwI/AAAAAAAAALg/etxuq6g1aO8/s1600-h/FT_sin_x_f3.bmp"&gt;&lt;img style="cursor: pointer; width: 104px; height: 104px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SlXfGoKlYwI/AAAAAAAAALg/etxuq6g1aO8/s200/FT_sin_x_f3.bmp" alt="" id="BLOGGER_PHOTO_ID_5356432636781093634" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SlXfG_3H_1I/AAAAAAAAALo/hDkyXYjPM7E/s1600-h/FT_sin_x_f5.bmp"&gt;&lt;img style="cursor: pointer; width: 105px; height: 105px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SlXfG_3H_1I/AAAAAAAAALo/hDkyXYjPM7E/s200/FT_sin_x_f5.bmp" alt="" id="BLOGGER_PHOTO_ID_5356432643141926738" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SlXfHMTnAfI/AAAAAAAAALw/ux3r7b7uAPg/s1600-h/FT_sin_x_f9.bmp"&gt;&lt;img style="cursor: pointer; width: 105px; height: 105px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SlXfHMTnAfI/AAAAAAAAALw/ux3r7b7uAPg/s200/FT_sin_x_f9.bmp" alt="" id="BLOGGER_PHOTO_ID_5356432646482625010" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2. Top row: Sinusoids with frequencies 1Hz, 3Hz, 5Hz and 9Hz respectively&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;In figure 2, the white spots represents the frequencies of the sinusoids.  The center of the images at the bottom row represents 0 Hz, thus increasing the frequency will result in white spots moving away from the center.  The two symmetric white spots occur because the output of FFT is always symmetric with the center.&lt;br /&gt;&lt;br /&gt;If we add a constant signal which effectively has a frequency equal to zero, it will result in a white spot at the center. Figure 3 demonstrate this by adding a value equal to 1 to a 1 Hz sinusoid.&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/_ctLOE7SPslI/SlaYc1CJ3QI/AAAAAAAAANY/fUuBfeHCfL4/s1600-h/FT_sin_x_f3_bias1.bmp"&gt;&lt;img style="cursor: pointer; width: 124px; height: 126px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SlaYc1CJ3QI/AAAAAAAAANY/fUuBfeHCfL4/s200/FT_sin_x_f3_bias1.bmp" alt="" id="BLOGGER_PHOTO_ID_5356636427843656962" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Figure 3. FFT of a 1 Hz sinusoid with constant bias.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Adding a non-constant bias, for example another sinusoid, will result into another white spot representing the frequency of the added noise. (See figure 4.)&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/_ctLOE7SPslI/SlacDxuviBI/AAAAAAAAANg/vOYGVmUFtek/s1600-h/sin_x_f3_biassin01.bmp"&gt;&lt;img style="cursor: pointer; width: 136px; height: 136px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SlacDxuviBI/AAAAAAAAANg/vOYGVmUFtek/s200/sin_x_f3_biassin01.bmp" alt="" id="BLOGGER_PHOTO_ID_5356640395506714642" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SlacEPmQ-KI/AAAAAAAAANo/kBUaB6yZHIU/s1600-h/FT_sin_x_f3_biassin01.bmp"&gt;&lt;img style="cursor: pointer; width: 135px; height: 136px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SlacEPmQ-KI/AAAAAAAAANo/kBUaB6yZHIU/s200/FT_sin_x_f3_biassin01.bmp" alt="" id="BLOGGER_PHOTO_ID_5356640403524221090" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 4. Left: Sum of a 3 Hz and a 0.1 Hz. Right: Its FFT.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;Rotating the image will result in a rotated FFT. See images below.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SlahhtDzjGI/AAAAAAAAANw/dq7dFbxtN70/s1600-h/sin_x_f3_rot30.bmp"&gt;&lt;img style="cursor: pointer; width: 107px; height: 107px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SlahhtDzjGI/AAAAAAAAANw/dq7dFbxtN70/s200/sin_x_f3_rot30.bmp" alt="" id="BLOGGER_PHOTO_ID_5356646407207095394" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SlahiMppVmI/AAAAAAAAAN4/5SuzMhn-EzE/s1600-h/sin_x_f3_rot45.bmp"&gt;&lt;img style="cursor: pointer; width: 108px; height: 108px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SlahiMppVmI/AAAAAAAAAN4/5SuzMhn-EzE/s200/sin_x_f3_rot45.bmp" alt="" id="BLOGGER_PHOTO_ID_5356646415687308898" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SlahicAr0vI/AAAAAAAAAOA/M5P8-37Q9B4/s1600-h/sin_x_f3_rot60.bmp"&gt;&lt;img style="cursor: pointer; width: 107px; height: 107px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SlahicAr0vI/AAAAAAAAAOA/M5P8-37Q9B4/s200/sin_x_f3_rot60.bmp" alt="" id="BLOGGER_PHOTO_ID_5356646419810472690" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/SlahihIVFDI/AAAAAAAAAOI/VD1WwY-lEt4/s1600-h/sin_x_f3_rot90.bmp"&gt;&lt;img style="cursor: pointer; width: 108px; height: 108px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SlahihIVFDI/AAAAAAAAAOI/VD1WwY-lEt4/s200/sin_x_f3_rot90.bmp" alt="" id="BLOGGER_PHOTO_ID_5356646421184713778" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SlaifQc_dFI/AAAAAAAAAOQ/dZUCQXuvFXo/s1600-h/FT_sin_x_f3_rot30.bmp"&gt;&lt;img style="cursor: pointer; width: 106px; height: 106px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SlaifQc_dFI/AAAAAAAAAOQ/dZUCQXuvFXo/s200/FT_sin_x_f3_rot30.bmp" alt="" id="BLOGGER_PHOTO_ID_5356647464679994450" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SlaifaLVBzI/AAAAAAAAAOY/k1sG0XylZRw/s1600-h/FT_sin_x_f3_rot45.bmp"&gt;&lt;img style="cursor: pointer; width: 107px; height: 107px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SlaifaLVBzI/AAAAAAAAAOY/k1sG0XylZRw/s200/FT_sin_x_f3_rot45.bmp" alt="" id="BLOGGER_PHOTO_ID_5356647467290265394" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/Slaif_5IkAI/AAAAAAAAAOg/iTpYlIg-jAE/s1600-h/FT_sin_x_f3_rot60.bmp"&gt;&lt;img style="cursor: pointer; width: 107px; height: 107px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/Slaif_5IkAI/AAAAAAAAAOg/iTpYlIg-jAE/s200/FT_sin_x_f3_rot60.bmp" alt="" id="BLOGGER_PHOTO_ID_5356647477414498306" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/SlaigMovOUI/AAAAAAAAAOo/8xoIe0n3qIU/s1600-h/FT_sin_x_f3_rot90.bmp"&gt;&lt;img style="cursor: pointer; width: 107px; height: 107px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SlaigMovOUI/AAAAAAAAAOo/8xoIe0n3qIU/s200/FT_sin_x_f3_rot90.bmp" alt="" id="BLOGGER_PHOTO_ID_5356647480835389762" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 5. 3 Hz sinusoid rotated at 30, 45 60 and 90 degress.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;FFT can also be used in noise reduction in a signal. Usually, noise are the higher frequencies in signal.  By taking the FFT of a signal and removing the higher frequency, noise can be removed.&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;Combining two sinusoids in X and in Y will result in FTTs with white spots having coordinates given by the frequencies in X and in Y.  Below are products of two sinusoids with equation sin(2*pi*fx*X)sin(2*pi*fy*Y)&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/_ctLOE7SPslI/Sla5CsupHHI/AAAAAAAAAOw/cvQ0YZ0RKxY/s1600-h/sin4xsin4y.bmp"&gt;&lt;img style="cursor: pointer; width: 118px; height: 118px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/Sla5CsupHHI/AAAAAAAAAOw/cvQ0YZ0RKxY/s200/sin4xsin4y.bmp" alt="" id="BLOGGER_PHOTO_ID_5356672262821452914" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/Sla5D-PrmqI/AAAAAAAAAPA/iv2DzmIDd68/s1600-h/FT_sin4xsin4y.bmp"&gt;&lt;img style="cursor: pointer; width: 119px; height: 119px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/Sla5D-PrmqI/AAAAAAAAAPA/iv2DzmIDd68/s200/FT_sin4xsin4y.bmp" alt="" id="BLOGGER_PHOTO_ID_5356672284703300258" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/Sla5DKLdcHI/AAAAAAAAAO4/B7K_lggcyyc/s1600-h/sin4xsin2y.bmp"&gt;&lt;img style="cursor: pointer; width: 119px; height: 119px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/Sla5DKLdcHI/AAAAAAAAAO4/B7K_lggcyyc/s200/sin4xsin2y.bmp" alt="" id="BLOGGER_PHOTO_ID_5356672270726951026" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/Sla5Erv_YaI/AAAAAAAAAPI/wa2x72199kk/s1600-h/FT_sin4xsin2y.bmp"&gt;&lt;img style="cursor: pointer; width: 119px; height: 119px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/Sla5Erv_YaI/AAAAAAAAAPI/wa2x72199kk/s200/FT_sin4xsin2y.bmp" alt="" id="BLOGGER_PHOTO_ID_5356672296918409634" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 6. Top row (left): Product of sinusoids with fx=4 Hz and fy=4 Hz. Top row (right): Its FFT. Bottom row (left): Product of sinusoids with fx=4 Hz and fy=2 Hz. Bottom row (right): Its FFT.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;For the final part of the activity, I sum up the above sinusoids, in particular sin(2*pi*4*X)*sin(2*pi*4*Y) and sin(2*pi*3*X) rotated at 30, 45, and 90 degrees and get the FFT. As expected, the FFT will just be the sum their respective FFTs.  It will be helpful to refer back to the images above and compare it with the FFT image below.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/Sla-3xYh4pI/AAAAAAAAAPQ/rqkkH4goLz0/s1600-h/sin4xsin4ypluspi6pi4pi3_f3.bmp"&gt;&lt;img style="cursor: pointer; width: 151px; height: 151px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/Sla-3xYh4pI/AAAAAAAAAPQ/rqkkH4goLz0/s200/sin4xsin4ypluspi6pi4pi3_f3.bmp" alt="" id="BLOGGER_PHOTO_ID_5356678672162087570" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/Sla-4Iq8TxI/AAAAAAAAAPY/cL-R4Ggoc7g/s1600-h/FT_sin4xsin4ypluspi6pi4pi3_f3.bmp"&gt;&lt;img style="cursor: pointer; width: 151px; height: 151px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/Sla-4Iq8TxI/AAAAAAAAAPY/cL-R4Ggoc7g/s200/FT_sin4xsin4ypluspi6pi4pi3_f3.bmp" alt="" id="BLOGGER_PHOTO_ID_5356678678413332242" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 7. Left: Sum of sinusoids. Right: Its FFT.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;For this activity I'll give myself a 10. ^_^&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&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/3974070185893700788-8725999299484131854?l=thejaggernaut.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thejaggernaut.blogspot.com/feeds/8725999299484131854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thejaggernaut.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/3974070185893700788/posts/default/8725999299484131854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/8725999299484131854'/><link rel='alternate' type='text/html' href='http://thejaggernaut.blogspot.com/2009/07/activity-6-properties-of-2d-fourier.html' title='Activity 6: Properties of the 2D Fourier Transform'/><author><name>Mark Jayson Villangca</name><uri>http://www.blogger.com/profile/14897153276200167580</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/_ctLOE7SPslI/SlXSbZeiTFI/AAAAAAAAAJo/2cyRPRUqWVY/s72-c/anunulus.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3974070185893700788.post-3146300759114352016</id><published>2009-07-06T19:41:00.000-07:00</published><updated>2009-07-07T06:15:43.872-07:00</updated><title type='text'>Activity 5: Fourier Transform Model of Image Formation</title><content type='html'>&lt;span style="font-weight: bold;"&gt;A. Familiarization with Discrete FFT&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The FFT of a circle is shown below&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SlK4N4s6TdI/AAAAAAAAAFo/T8P_BXkRmKk/s1600-h/circle.png"&gt;&lt;img style="cursor: pointer; width: 154px; height: 154px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SlK4N4s6TdI/AAAAAAAAAFo/T8P_BXkRmKk/s400/circle.png" alt="" id="BLOGGER_PHOTO_ID_5355545455595507154" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SlK4N9UnyUI/AAAAAAAAAFw/jqp0hdoemdI/s1600-h/circle_FFT.bmp"&gt;&lt;img style="cursor: pointer; width: 161px; height: 158px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SlK4N9UnyUI/AAAAAAAAAFw/jqp0hdoemdI/s400/circle_FFT.bmp" alt="" id="BLOGGER_PHOTO_ID_5355545456835807554" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SlK4OBCUTFI/AAAAAAAAAF4/w8VGJEg_U-c/s1600-h/circle_fftshift.bmp"&gt;&lt;img style="cursor: pointer; width: 161px; height: 161px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SlK4OBCUTFI/AAAAAAAAAF4/w8VGJEg_U-c/s400/circle_fftshift.bmp" alt="" id="BLOGGER_PHOTO_ID_5355545457832774738" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SlK70bEzdKI/AAAAAAAAAGg/Y1_p5jzEcZ4/s1600-h/circle_2FFT.bmp"&gt;&lt;img style="cursor: pointer; width: 161px; height: 161px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SlK70bEzdKI/AAAAAAAAAGg/Y1_p5jzEcZ4/s400/circle_2FFT.bmp" alt="" id="BLOGGER_PHOTO_ID_5355549416192439458" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 1. Upper left: Image of a circle. Upper right: Its FFT.&lt;br /&gt;Lower left: After using fftshift(). Lower right: After using fft2() twice.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;fftshift() is needed to revert to the original configuration of the quadrants of the image since the output of fft2() has quadrants along the diagonal interchanged. After using fft2() twice, the original image is recovered except that it is inverted.  The inversion is not obvious in the circle pattern hence it is also tested on other pattern such as "A" and the results are&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/_ctLOE7SPslI/SlK7zZ4vjSI/AAAAAAAAAGA/HNmf1jd0U3Q/s1600-h/A_orig.bmp"&gt;&lt;img style="cursor: pointer; width: 145px; height: 145px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SlK7zZ4vjSI/AAAAAAAAAGA/HNmf1jd0U3Q/s400/A_orig.bmp" alt="" id="BLOGGER_PHOTO_ID_5355549398693547298" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SlK7z7YVrRI/AAAAAAAAAGQ/q3iSDHcaZO4/s1600-h/A_FFT.bmp"&gt;&lt;img style="cursor: pointer; width: 145px; height: 145px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SlK7z7YVrRI/AAAAAAAAAGQ/q3iSDHcaZO4/s400/A_FFT.bmp" alt="" id="BLOGGER_PHOTO_ID_5355549407684439314" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SlK70BFcv5I/AAAAAAAAAGY/a-2XAEZbFHs/s1600-h/A_fftshift.bmp"&gt;&lt;img style="cursor: pointer; width: 144px; height: 144px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SlK70BFcv5I/AAAAAAAAAGY/a-2XAEZbFHs/s400/A_fftshift.bmp" alt="" id="BLOGGER_PHOTO_ID_5355549409215823762" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SlK7zt9mBBI/AAAAAAAAAGI/qt9pv4C5H4s/s1600-h/A_2FFT.bmp"&gt;&lt;img style="cursor: pointer; width: 144px; height: 143px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SlK7zt9mBBI/AAAAAAAAAGI/qt9pv4C5H4s/s400/A_2FFT.bmp" alt="" id="BLOGGER_PHOTO_ID_5355549404082603026" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 2. Upper left: Image of the letter "A". Upper right: Its FFT.&lt;br /&gt;Lower left: After using fftshift(). Lower right: After using fft2() twice.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-weight: bold;"&gt;B. Simulation of an Imaging Device&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;In particular, we simulated a lens in which case is just the circle in the above section. The "object" to be image is a "VIP" pattern shown below.&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/SlM0ZnI490I/AAAAAAAAAGo/zH14E-nux1U/s1600-h/VIP.png"&gt;&lt;img style="cursor: pointer; width: 129px; height: 129px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SlM0ZnI490I/AAAAAAAAAGo/zH14E-nux1U/s320/VIP.png" alt="" id="BLOGGER_PHOTO_ID_5355681996481296194" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 3. "VIP" pattern.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;div style="text-align: justify;"&gt;The simulation was tested for different circle radii and we obtained the following results&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/_ctLOE7SPslI/SlM0Zzh9VzI/AAAAAAAAAGw/tFtqmu1texs/s1600-h/circle025.png"&gt;&lt;img style="cursor: pointer; width: 98px; height: 98px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SlM0Zzh9VzI/AAAAAAAAAGw/tFtqmu1texs/s320/circle025.png" alt="" id="BLOGGER_PHOTO_ID_5355681999807665970" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SlM0aEo5ruI/AAAAAAAAAG4/Ga3lk5HutpU/s1600-h/circle.png"&gt;&lt;img style="cursor: pointer; width: 99px; height: 99px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SlM0aEo5ruI/AAAAAAAAAG4/Ga3lk5HutpU/s320/circle.png" alt="" id="BLOGGER_PHOTO_ID_5355682004400189154" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SlM0aQKEhtI/AAAAAAAAAHA/UwlvIcMfgnQ/s1600-h/circle15.png"&gt;&lt;img style="cursor: pointer; width: 99px; height: 99px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SlM0aQKEhtI/AAAAAAAAAHA/UwlvIcMfgnQ/s320/circle15.png" alt="" id="BLOGGER_PHOTO_ID_5355682007492101842" border="0" /&gt;&lt;/a&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SlM0aVnGVtI/AAAAAAAAAHI/YNhwowDKvYc/s1600-h/circle2.png"&gt;&lt;img style="cursor: pointer; width: 99px; height: 99px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SlM0aVnGVtI/AAAAAAAAAHI/YNhwowDKvYc/s320/circle2.png" alt="" id="BLOGGER_PHOTO_ID_5355682008956032722" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/SlM3mr_o3AI/AAAAAAAAAHw/ChN1Xkpclac/s1600-h/VIP_conv_circle025.bmp"&gt;&lt;img style="cursor: pointer; width: 100px; height: 100px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SlM3mr_o3AI/AAAAAAAAAHw/ChN1Xkpclac/s200/VIP_conv_circle025.bmp" alt="" id="BLOGGER_PHOTO_ID_5355685519657851906" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SlM3mpgdpLI/AAAAAAAAAH4/oX4viygD62I/s1600-h/VIP_conv_circle.bmp"&gt;&lt;img style="cursor: pointer; width: 103px; height: 103px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SlM3mpgdpLI/AAAAAAAAAH4/oX4viygD62I/s200/VIP_conv_circle.bmp" alt="" id="BLOGGER_PHOTO_ID_5355685518990222514" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SlM3m_5dvkI/AAAAAAAAAIA/uY0rwYVMmuI/s1600-h/VIP_conv_circle15.bmp"&gt;&lt;img style="cursor: pointer; width: 101px; height: 101px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SlM3m_5dvkI/AAAAAAAAAIA/uY0rwYVMmuI/s200/VIP_conv_circle15.bmp" alt="" id="BLOGGER_PHOTO_ID_5355685525000666690" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SlM3nIZ7qWI/AAAAAAAAAII/9I4G9m0GOuE/s1600-h/VIP_conv_circle2.bmp"&gt;&lt;img style="cursor: pointer; width: 102px; height: 102px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SlM3nIZ7qWI/AAAAAAAAAII/9I4G9m0GOuE/s200/VIP_conv_circle2.bmp" alt="" id="BLOGGER_PHOTO_ID_5355685527284328802" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 4. Top row: Circles of different radii. Bottom row: Corresponding images.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;div style="text-align: justify;"&gt;From figure 4, it can be seen that as radii increases (or equivalently, as aperture increases), the resolution of the image increases.  The above basically demonstrates convolution.&lt;/div&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;C. Template Matching Using Correlation&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The main idea is that if two patterns are similar, it will yield a high correlation. The following demonstrates how pattern recognition works in text images.&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/_ctLOE7SPslI/SlM-U56EMlI/AAAAAAAAAIQ/TUOGk9kJfLQ/s1600-h/rain.bmp"&gt;&lt;img style="cursor: pointer; width: 137px; height: 137px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SlM-U56EMlI/AAAAAAAAAIQ/TUOGk9kJfLQ/s320/rain.bmp" alt="" id="BLOGGER_PHOTO_ID_5355692910736323154" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SlM-U56EMlI/AAAAAAAAAIQ/TUOGk9kJfLQ/s1600-h/rain.bmp"&gt; &lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SlM-VMPt3lI/AAAAAAAAAIY/oOJOmpDcNs0/s1600-h/A_cor.bmp"&gt;&lt;img style="cursor: pointer; width: 138px; height: 138px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SlM-VMPt3lI/AAAAAAAAAIY/oOJOmpDcNs0/s320/A_cor.bmp" alt="" id="BLOGGER_PHOTO_ID_5355692915658972754" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SlM-VdkOTqI/AAAAAAAAAIg/_8eqka_Xl3U/s1600-h/A_cor_rain.bmp"&gt;&lt;img style="cursor: pointer; width: 136px; height: 137px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SlM-VdkOTqI/AAAAAAAAAIg/_8eqka_Xl3U/s320/A_cor_rain.bmp" alt="" id="BLOGGER_PHOTO_ID_5355692920308387490" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 5. Left: Text image. Middle: The pattern to look for in which is the letter "A". Right: The output after getting the correlation.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;The output in figure 5 shows peaks (i.e. the white dots) at the locations of the letter "A".&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;D. Edge Detection Using the Convolution Integral&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The idea is the same as above, only that this uses a small template and this template is scanned throughout the image.  For this part, the templates used are [-1 -1 -1; 2  2  2; -1 -1 -1], [-1 2 -1; -1 2 -1; -1 2 -1], [-1 -1 -1; -1 8 -1; -1 -1 -1] which are just a horizontal line, a vertical line and a spot respectively.  Below are the result after using imcorrcoef() with the VIP image.&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/_ctLOE7SPslI/SlNHIH5_1EI/AAAAAAAAAIo/0fVcNNZyNZI/s1600-h/VIP_cor_P1.bmp"&gt;&lt;img style="cursor: pointer; width: 135px; height: 135px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SlNHIH5_1EI/AAAAAAAAAIo/0fVcNNZyNZI/s200/VIP_cor_P1.bmp" alt="" id="BLOGGER_PHOTO_ID_5355702586760483906" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/SlNHIXZVzdI/AAAAAAAAAIw/WzuDcYIsgWw/s1600-h/VIP_cor_P2.bmp"&gt;&lt;img style="cursor: pointer; width: 133px; height: 133px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SlNHIXZVzdI/AAAAAAAAAIw/WzuDcYIsgWw/s200/VIP_cor_P2.bmp" alt="" id="BLOGGER_PHOTO_ID_5355702590918479314" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SlNHIXs4ZFI/AAAAAAAAAI4/8EnlpDjzR_s/s1600-h/VIP_cor_P3.bmp"&gt;&lt;img style="cursor: pointer; width: 132px; height: 132px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SlNHIXs4ZFI/AAAAAAAAAI4/8EnlpDjzR_s/s200/VIP_cor_P3.bmp" alt="" id="BLOGGER_PHOTO_ID_5355702591000437842" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 6. Left: After using horizontal line template. Middle: After using vertical line template. Right: After using spot template.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;As explained in the above section, only those with similar pattern will have a high correlation. Notice in figure 6 that a horizontal line template will only highlight horizontal lines in the VIP pattern. The same goes with rest of the template.  The spot template shows a relatively good output image since every point in the pattern can be considered as a spot.&lt;br /&gt;&lt;br /&gt;For this activity I'll give myself a 10+.  Though coding is relatively simple, doing it for several images is quite hard. And by the way, the techniques presented here are indeed useful. ^_^&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3974070185893700788-3146300759114352016?l=thejaggernaut.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thejaggernaut.blogspot.com/feeds/3146300759114352016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thejaggernaut.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/3974070185893700788/posts/default/3146300759114352016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/3146300759114352016'/><link rel='alternate' type='text/html' href='http://thejaggernaut.blogspot.com/2009/07/activity-5-fourier-transform-model-of.html' title='Activity 5: Fourier Transform Model of Image Formation'/><author><name>Mark Jayson Villangca</name><uri>http://www.blogger.com/profile/14897153276200167580</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/_ctLOE7SPslI/SlK4N4s6TdI/AAAAAAAAAFo/T8P_BXkRmKk/s72-c/circle.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3974070185893700788.post-947746248256323048</id><published>2009-07-01T19:13:00.000-07:00</published><updated>2009-07-02T04:09:15.016-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Contrast enhancement'/><title type='text'>Activity 4: Enhancement by Histogram Manipulation</title><content type='html'>&lt;span style="font-size:85%;"&gt;For this activity, poor contrast images are improved by re-mapping of pixel values.  The whole method is schematically show below&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SkwdT5hE_-I/AAAAAAAAAC8/SwxgeeD-jdY/s1600-h/method.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 169px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SkwdT5hE_-I/AAAAAAAAAC8/SwxgeeD-jdY/s400/method.PNG" alt="" id="BLOGGER_PHOTO_ID_5353686284730957794" border="0" /&gt;&lt;/a&gt;Figure 1. Schematic diagram showing the cumulative frequency distribution (CDF) of the original image and the desired CDF.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: left;"&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;Referring to figure 1, for each pixel value of the original image get its cumulative frequency (i.e. value at the y-axis; step 1 &amp;amp; 2).  See if there is a corresponding value in the desired CDF (step 3).  If there is, check its corresponding pixel value (step 4) and use this to replace the pixel value in the  original image.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;Here are my results. (Click on the figure to enlarge.)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/SkyBgVvACPI/AAAAAAAAADQ/6XrPOvDEg7E/s1600-h/wom1orig.bmp"&gt;&lt;img style="cursor: pointer; width: 183px; height: 183px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SkyBgVvACPI/AAAAAAAAADQ/6XrPOvDEg7E/s400/wom1orig.bmp" alt="" id="BLOGGER_PHOTO_ID_5353796449626753266" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/SkyCKoWbK3I/AAAAAAAAADg/envlrZ4gKAI/s1600-h/wom1cdf.gif"&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SkyBtafKDAI/AAAAAAAAADY/lSBDek4qzh8/s1600-h/wom1hist.gif"&gt;&lt;img style="cursor: pointer; width: 235px; height: 177px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SkyBtafKDAI/AAAAAAAAADY/lSBDek4qzh8/s400/wom1hist.gif" alt="" id="BLOGGER_PHOTO_ID_5353796674240777218" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/SkyCKoWbK3I/AAAAAAAAADg/envlrZ4gKAI/s1600-h/wom1cdf.gif"&gt;&lt;img style="cursor: pointer; width: 222px; height: 174px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SkyCKoWbK3I/AAAAAAAAADg/envlrZ4gKAI/s400/wom1cdf.gif" alt="" id="BLOGGER_PHOTO_ID_5353797176178453362" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;Figure 2. Top: Original image. Middle: PDF of t&lt;/span&gt;&lt;span style="font-size:85%;"&gt;he original image. Bottom: The corresponding CDF.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SkyDOok8yYI/AAAAAAAAADo/I4IdQPDWw1Q/s1600-h/cof_orig.bmp"&gt;&lt;img style="cursor: pointer; width: 169px; height: 172px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SkyDOok8yYI/AAAAAAAAADo/I4IdQPDWw1Q/s400/cof_orig.bmp" alt="" id="BLOGGER_PHOTO_ID_5353798344470481282" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SkyDcVzl9mI/AAAAAAAAADw/4ewnEMAJT5Y/s1600-h/cof_orig_pdf.bmp"&gt;&lt;img style="cursor: pointer; width: 221px; height: 169px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SkyDcVzl9mI/AAAAAAAAADw/4ewnEMAJT5Y/s400/cof_orig_pdf.bmp" alt="" id="BLOGGER_PHOTO_ID_5353798579949794914" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SkyDsqJ-l9I/AAAAAAAAAD4/SkQEtygmeRg/s1600-h/cof_orig_cdf.bmp"&gt;&lt;img style="cursor: pointer; width: 209px; height: 165px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SkyDsqJ-l9I/AAAAAAAAAD4/SkQEtygmeRg/s400/cof_orig_cdf.bmp" alt="" id="BLOGGER_PHOTO_ID_5353798860290299858" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Figure 3. Top: Original image. Middle: PDF of the original image. Bottom: The corresponding CDF.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: left;"&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;For contrast enhancement, I used a linear CDF and a logarithmic CDF. Below are the graphs of their CDFs&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;.&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SkyFT9NlEeI/AAAAAAAAAEA/6iSUiVO9Hg0/s1600-h/cdfline.bmp"&gt;&lt;img style="cursor: pointer; width: 196px; height: 152px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SkyFT9NlEeI/AAAAAAAAAEA/6iSUiVO9Hg0/s400/cdfline.bmp" alt="" id="BLOGGER_PHOTO_ID_5353800634932204002" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SkyFiK-0_2I/AAAAAAAAAEI/_lGL6w8WOVM/s1600-h/cdflog.bmp"&gt;&lt;img style="cursor: pointer; width: 195px; height: 152px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SkyFiK-0_2I/AAAAAAAAAEI/_lGL6w8WOVM/s400/cdflog.bmp" alt="" id="BLOGGER_PHOTO_ID_5353800879146598242" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 4. Left: Linear CDF. Right: Logarithmic CDF.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-size:85%;"&gt;The reconstructed images with their corresponding CDFs are as follows.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SkyG4UMOFOI/AAAAAAAAAEQ/tMVh0a_ysG0/s1600-h/wom1recon.bmp"&gt;&lt;img style="cursor: pointer; width: 167px; height: 169px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SkyG4UMOFOI/AAAAAAAAAEQ/tMVh0a_ysG0/s400/wom1recon.bmp" alt="" id="BLOGGER_PHOTO_ID_5353802359087437026" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SkyHE3XIV9I/AAAAAAAAAEY/ht_B5PoFRIw/s1600-h/reconcdf_line.bmp"&gt;&lt;img style="cursor: pointer; width: 223px; height: 170px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SkyHE3XIV9I/AAAAAAAAAEY/ht_B5PoFRIw/s400/reconcdf_line.bmp" alt="" id="BLOGGER_PHOTO_ID_5353802574686869458" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SkyG4UMOFOI/AAAAAAAAAEQ/tMVh0a_ysG0/s1600-h/wom1recon.bmp"&gt; &lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SkyHdh1ucEI/AAAAAAAAAEg/Td0JuXPHe9Q/s1600-h/wom1reconlog.bmp"&gt;&lt;img style="cursor: pointer; width: 176px; height: 171px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SkyHdh1ucEI/AAAAAAAAAEg/Td0JuXPHe9Q/s400/wom1reconlog.bmp" alt="" id="BLOGGER_PHOTO_ID_5353802998406344770" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SkyHy6LkqoI/AAAAAAAAAEo/jjrWDpSLTb4/s1600-h/reconcdf_log.bmp"&gt;&lt;img style="cursor: pointer; width: 212px; height: 171px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SkyHy6LkqoI/AAAAAAAAAEo/jjrWDpSLTb4/s400/reconcdf_log.bmp" alt="" id="BLOGGER_PHOTO_ID_5353803365717682818" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;Figure 5. Upper left: Reconstructed image using linear CDF. Upper right. The corresponding CDF. Lower left:  Reconstructed image using logarithmic CDF. Lower right: The corresponding CDF.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SkyJQYiiyGI/AAAAAAAAAEw/B1tLBYvH8N4/s1600-h/cof_recon_line.bmp"&gt;&lt;img style="cursor: pointer; width: 159px; height: 163px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SkyJQYiiyGI/AAAAAAAAAEw/B1tLBYvH8N4/s400/cof_recon_line.bmp" alt="" id="BLOGGER_PHOTO_ID_5353804971594926178" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ctLOE7SPslI/SkyJQuuZxTI/AAAAAAAAAE4/ZKXndwQLS94/s1600-h/cof_recon_line_cdf.bmp"&gt;&lt;img style="cursor: pointer; width: 206px; height: 161px;" src="http://2.bp.blogspot.com/_ctLOE7SPslI/SkyJQuuZxTI/AAAAAAAAAE4/ZKXndwQLS94/s400/cof_recon_line_cdf.bmp" alt="" id="BLOGGER_PHOTO_ID_5353804977550247218" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SkyJRIieQXI/AAAAAAAAAFA/HaGcUIrV0EM/s1600-h/cof_recon_log.bmp"&gt;&lt;img style="cursor: pointer; width: 164px; height: 166px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SkyJRIieQXI/AAAAAAAAAFA/HaGcUIrV0EM/s400/cof_recon_log.bmp" alt="" id="BLOGGER_PHOTO_ID_5353804984479531378" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SkyJRRI7H1I/AAAAAAAAAFI/0Zcumu5a82s/s1600-h/cof_recon_log_cdf.bmp"&gt;&lt;img style="cursor: pointer; width: 201px; height: 162px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SkyJRRI7H1I/AAAAAAAAAFI/0Zcumu5a82s/s400/cof_recon_log_cdf.bmp" alt="" id="BLOGGER_PHOTO_ID_5353804986788290386" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 6. Upper left: Reconstructed image using linear CDF. Upper right. The corresponding CDF. Lower left: Reconstructed image using logarithmic CDF. Lower right: The corresponding CDF.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;The CDFs of the reconstructed images follow the general shapes of the desired CDFs. In the logarithmic CDF, there is preference to lower pixel values hence the reconstructed image appears darker.&lt;br /&gt;&lt;br /&gt;Below is the code that I've used.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;chdir('C:\Users\Mark Jayson\Documents\Physics\APhysics 186\Act 4');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;I=imread('test04.png');&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;I=im2gray(I);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;//pdf of original image&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;m=tabul(I, 'i');&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;total=256*256;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;datapdf=[0:255]';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;zer=zeros(256,1);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;datapdf=cat(2,datapdf,zer);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;for i=1:length(m(:,1))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;  init=int(m(i,1))+1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;  datapdf(init,1)=m(i,1);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;  datapdf(init,2)=m(i,2)/total;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;plot(datapdf(:,1),datapdf(:,2));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;xlabel('pixels');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;//cdf of original image&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;m2=cumsum(datapdf(:,2));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;datacdf=cat(2,datapdf(:,1),m2);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;scf(1);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;plot(datacdf(:,1),datacdf(:,2));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;xlabel('pixels');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;//cdf2: linear cdf&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;datacdf2=[0:255]';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;temp=[0:255]'/255;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;datacdf2=cat(2,datacdf2,temp);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;scf(2);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;plot(datacdf2(:,1),datacdf2(:,2))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;xlabel('pixels');&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;//cdf4: logarithmic cdf&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;hmneye=log([1:256])';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;pixel=[0:255]';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;datacdf4=cat(2,pixel,hmneye/max(hmneye));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;scf(3);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;plot(datacdf4(:,1),datacdf4(:,2));&lt;br /&gt;&lt;br /&gt;//Note: comment out cdf2 or cdf4 if you wish to use logarithmic or linear cdf respectively&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;//mapping&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;temp=zeros(256,256);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;temp1=floor(datacdf(:,2)*255);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;temp2=floor(datacdf4(:,2)*255);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;for i=1:length(datacdf(:,2))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;  ii=find(temp2==temp1(i));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;  temp=temp+datacdf4(ii(1),1)*(I==datacdf(i,1));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;//cdf recon&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;m=tabul(temp, 'i');&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;total=256*256;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;pdf=[0:255]';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;zer=zeros(256,1);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;pdf=cat(2,pdf,zer);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;for i=1:length(m(:,1))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;  init=int(m(i,1))+1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;  pdf(init,1)=m(i,1);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;  pdf(init,2)=m(i,2)/total;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;m2=cumsum(pdf(:,2));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;cdf=cat(2,pdf(:,1),m2);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;scf(4);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;plot(cdf(:,1),cdf(:,2)); //cdf of reconstructed image&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;xlabel('pixels');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;scf(5); imshow(I/255); //original image&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;scf(6); imshow(temp/255); //reconstructed image&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;For this activity I'll give myself a 10 because I was able to do the activity well and I've discovered a function in scilab called tabul() which tabulates pixel values and their corresponding frequencies (although there is a more efficient way of doing this). This activity is fun! ^_^&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3974070185893700788-947746248256323048?l=thejaggernaut.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thejaggernaut.blogspot.com/feeds/947746248256323048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thejaggernaut.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/3974070185893700788/posts/default/947746248256323048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/947746248256323048'/><link rel='alternate' type='text/html' href='http://thejaggernaut.blogspot.com/2009/07/activity-4-enhancement-by-histogram.html' title='Activity 4: Enhancement by Histogram Manipulation'/><author><name>Mark Jayson Villangca</name><uri>http://www.blogger.com/profile/14897153276200167580</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/_ctLOE7SPslI/SkwdT5hE_-I/AAAAAAAAAC8/SwxgeeD-jdY/s72-c/method.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3974070185893700788.post-5959112519149272332</id><published>2009-06-24T18:18:00.000-07:00</published><updated>2009-07-01T01:08:20.663-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Area'/><category scheme='http://www.blogger.com/atom/ns#' term='Edge Detection'/><category scheme='http://www.blogger.com/atom/ns#' term='Scilab'/><title type='text'>Activity 2: Area Estimation for Images with Defined Edges</title><content type='html'>To compute for the area of arbitrary binary images, we will make use of Green's theorem.  The test images are as follow&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/_ctLOE7SPslI/SkLTZF-7JfI/AAAAAAAAABc/mwsO7uMDLVA/s1600-h/rectangle.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 256px; height: 256px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SkLTZF-7JfI/AAAAAAAAABc/mwsO7uMDLVA/s320/rectangle.png" alt="" id="BLOGGER_PHOTO_ID_5351071735325861362" border="0" /&gt;&lt;/a&gt;Figure 1. Rectangle with dimension190x115&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SkLT86RtnFI/AAAAAAAAABk/k0mL7CHS--Q/s1600-h/ellipse.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 256px; height: 256px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SkLT86RtnFI/AAAAAAAAABk/k0mL7CHS--Q/s320/ellipse.png" alt="" id="BLOGGER_PHOTO_ID_5351072350658731090" border="0" /&gt;&lt;/a&gt;Figure 2. Ellipse which can be enclosed in a rectangle of dimension 200x100&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/SkLts1_UooI/AAAAAAAAACU/D9J4cHQlMpU/s1600-h/ireg.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 256px; height: 256px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SkLts1_UooI/AAAAAAAAACU/D9J4cHQlMpU/s320/ireg.PNG" alt="" id="BLOGGER_PHOTO_ID_5351100661932270210" border="0" /&gt;&lt;/a&gt;Figure 3. Irregular shape.&lt;br /&gt;&lt;div style="text-align: left;"&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/_ctLOE7SPslI/SkiI4jxWOGI/AAAAAAAAACc/5mJlIiIz5u0/s1600-h/2contour.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 256px; height: 256px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SkiI4jxWOGI/AAAAAAAAACc/5mJlIiIz5u0/s320/2contour.png" alt="" id="BLOGGER_PHOTO_ID_5352678662386104418" border="0" /&gt;&lt;/a&gt;Figure 4. Image containing two contours.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;The results are as follows&lt;br /&gt;&lt;t&gt;&lt;br /&gt;&lt;/t&gt;&lt;div style="text-align: center;"&gt;&lt;t&gt;Table 1. Summary of results.&lt;/t&gt;&lt;br /&gt;&lt;t&gt;&lt;/t&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SkiQbIUmYmI/AAAAAAAAACk/YDHH_21xiYs/s1600-h/data.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 364px; height: 91px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SkiQbIUmYmI/AAAAAAAAACk/YDHH_21xiYs/s320/data.png" alt="" id="BLOGGER_PHOTO_ID_5352686952894587490" border="0" /&gt;&lt;/a&gt;The results from the sum() function serves as the theoretical value since it literally gives area of the white region (in pixels) of a binary image.  For shapes with a single continuous contour, sum() and Green's theorem methods are in agreement.  Green's theorem fails with shapes having two contours as with figure 4.  Below is the code used for this activity&lt;br /&gt;&lt;br /&gt;//Scilab code. Special thanks to Miguel Sison for figuring out how to run the SIP toolbox.&lt;br /&gt;&lt;br /&gt;chdir('C:\Users\Mark Jayson\Documents\Physics\APhysics 186\Act 2');&lt;br /&gt;//read image&lt;br /&gt;I=imread('ireg.png');&lt;br /&gt;&lt;br /&gt;I=im2bw(I,0.5);&lt;br /&gt;&lt;br /&gt;[x,y]=follow(I);&lt;br /&gt;&lt;br /&gt;temp=0;&lt;br /&gt;&lt;br /&gt;for i=1:length(x)-1&lt;br /&gt;temp=temp+(x(i)*y(i+1)-x(i+1)*y(i));&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;temp=temp+(x(length(x))*y(1)-x(1)*y(length(y)));&lt;br /&gt;&lt;br /&gt;A=0.5*(temp+length(x))+1  //the length(x) term is necessary to include the contour itself in the area calculation. Plus 1 is need to close the contour.&lt;br /&gt;&lt;br /&gt;theo=sum(sum(I))&lt;br /&gt;&lt;br /&gt;er=(A-theo)/theo&lt;br /&gt;&lt;br /&gt;For this activity I'll give myself a 9.0. I posted it a little late because I have to figure out what went wrong to my initial code. ^_^&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3974070185893700788-5959112519149272332?l=thejaggernaut.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thejaggernaut.blogspot.com/feeds/5959112519149272332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thejaggernaut.blogspot.com/2009/06/activity-2-area-estimation-for-images.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/5959112519149272332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/5959112519149272332'/><link rel='alternate' type='text/html' href='http://thejaggernaut.blogspot.com/2009/06/activity-2-area-estimation-for-images.html' title='Activity 2: Area Estimation for Images with Defined Edges'/><author><name>Mark Jayson Villangca</name><uri>http://www.blogger.com/profile/14897153276200167580</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/_ctLOE7SPslI/SkLTZF-7JfI/AAAAAAAAABc/mwsO7uMDLVA/s72-c/rectangle.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3974070185893700788.post-854562184453611121</id><published>2009-06-22T18:53:00.000-07:00</published><updated>2009-06-24T20:20:32.636-07:00</updated><title type='text'>Activity 3: Image Types and Basic Image Enhancement</title><content type='html'>&lt;span style="font-size:85%;"&gt;Below are the different types of images.  Images information are found using Scilab's SIP toolbox function imfinfo&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;Binary Image&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SkLVLcdfCOI/AAAAAAAAABs/gcrMkMVz-bw/s1600-h/37081406.GIF"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 241px; height: 224px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SkLVLcdfCOI/AAAAAAAAABs/gcrMkMVz-bw/s320/37081406.GIF" alt="" id="BLOGGER_PHOTO_ID_5351073699864709346" border="0" /&gt;&lt;/a&gt; FileName: 37081406.gif&lt;br /&gt;FileSize: 15054&lt;br /&gt;Format: GIF&lt;br /&gt;Width: 500&lt;br /&gt;Height: 461&lt;br /&gt;Depth: 8&lt;br /&gt;StorageType: indexed&lt;br /&gt;NumberOfColors: 2&lt;br /&gt;ResolutionUnit: centimeter&lt;br /&gt;XResolution: 72.000000&lt;br /&gt;YResolution: 72.000000&lt;br /&gt;&lt;br /&gt;Source:http://www.nisk.k12.ny.us/fdr/ideas/portfolio/vandersee/gifs/37081406.GIF&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;Grayscale Image&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SkLWPEzGJ-I/AAAAAAAAAB0/zdLzIAFGTFs/s1600-h/lena512.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 204px; height: 204px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SkLWPEzGJ-I/AAAAAAAAAB0/zdLzIAFGTFs/s320/lena512.bmp" alt="" id="BLOGGER_PHOTO_ID_5351074861744007138" border="0" /&gt;&lt;/a&gt;FileName: lena512.bmp&lt;br /&gt;FileSize: 263222&lt;br /&gt;Format: BMP&lt;br /&gt;Width: 512&lt;br /&gt;Height: 512&lt;br /&gt;Depth: 8&lt;br /&gt;StorageType: indexed&lt;br /&gt;NumberOfColors: 256&lt;br /&gt;ResolutionUnit: centimeter&lt;br /&gt;XResolution: 0.000000&lt;br /&gt;YResolution: 0.000000&lt;br /&gt;&lt;br /&gt;Source: http://www-ece.rice.edu/~wakin/images/lena512.bmp&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;Indexed Image&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SkLW4M6I3NI/AAAAAAAAAB8/b-CiV-xplBQ/s1600-h/imgcolor16.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 221px; height: 221px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SkLW4M6I3NI/AAAAAAAAAB8/b-CiV-xplBQ/s320/imgcolor16.gif" alt="" id="BLOGGER_PHOTO_ID_5351075568295664850" border="0" /&gt;&lt;/a&gt;FileName: imgcolor16.gif&lt;br /&gt;FileSize: 27065&lt;br /&gt;Format: GIF&lt;br /&gt;Width: 248&lt;br /&gt;Height: 248&lt;br /&gt;Depth: 8&lt;br /&gt;StorageType: indexed&lt;br /&gt;NumberOfColors: 256&lt;br /&gt;ResolutionUnit: centimeter&lt;br /&gt;XResolution: 72.000000&lt;br /&gt;YResolution: 72.000000&lt;br /&gt;&lt;br /&gt;Source: http://idlastro.gsfc.nasa.gov/idl_html_help/images/imgcolor16.gif&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Truecolor Image&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SkLYOWi1TjI/AAAAAAAAACM/Rsp8Hj0O-rE/s1600-h/mandrill.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 225px; height: 217px;" src="http://3.bp.blogspot.com/_ctLOE7SPslI/SkLYOWi1TjI/AAAAAAAAACM/Rsp8Hj0O-rE/s320/mandrill.jpg" alt="" id="BLOGGER_PHOTO_ID_5351077048351018546" border="0" /&gt;&lt;/a&gt; FileName: mandrill.jpg&lt;br /&gt;FileSize: 327564&lt;br /&gt;Format: JPEG&lt;br /&gt;Width: 500&lt;br /&gt;Height: 480&lt;br /&gt;Depth: 8&lt;br /&gt;StorageType: truecolor&lt;br /&gt;NumberOfColors: 0&lt;br /&gt;ResolutionUnit: inch&lt;br /&gt;XResolution: 96.000000&lt;br /&gt;YResolution: 96.000000 &lt;br /&gt;&lt;br /&gt;Source: http://www.cs.uwec.edu/~stevende/cs245/labs/lab08-Threads/mandrill.jpg&lt;br /&gt;&lt;br /&gt;Note that binary and grayscale images are also indexed images. The difference is that in binary images, there are only two colors (black and white) and in grayscale images there are 256 colors of different levels of gray.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3974070185893700788-854562184453611121?l=thejaggernaut.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thejaggernaut.blogspot.com/feeds/854562184453611121/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thejaggernaut.blogspot.com/2009/06/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/3974070185893700788/posts/default/854562184453611121'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/854562184453611121'/><link rel='alternate' type='text/html' href='http://thejaggernaut.blogspot.com/2009/06/activity-3-image-types-and-basic-image.html' title='Activity 3: Image Types and Basic Image Enhancement'/><author><name>Mark Jayson Villangca</name><uri>http://www.blogger.com/profile/14897153276200167580</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/_ctLOE7SPslI/SkLVLcdfCOI/AAAAAAAAABs/gcrMkMVz-bw/s72-c/37081406.GIF' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3974070185893700788.post-6980193863501147223</id><published>2009-06-15T20:17:00.000-07:00</published><updated>2009-06-19T20:05:53.571-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Image Processing'/><category scheme='http://www.blogger.com/atom/ns#' term='OpenOffice Calc Customization'/><title type='text'>Activity 1: Digital Scanning</title><content type='html'>&lt;span style=";font-family:trebuchet ms;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;Introduction&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="font-size:85%;"&gt;In this activity, ratio and proportion was used to find the numerical values of a digitally scanned plot.   (See figure 1.)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ctLOE7SPslI/SjxOaAfusLI/AAAAAAAAAAk/DpQCJMQiyEQ/s1600-h/master_cropped.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 227px; height: 269px;" src="http://1.bp.blogspot.com/_ctLOE7SPslI/SjxOaAfusLI/AAAAAAAAAAk/DpQCJMQiyEQ/s320/master_cropped.png" alt="" id="BLOGGER_PHOTO_ID_5349236666125955250" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;The numerical values were deduced from the pixel locations of the plot given as x- and y-coordinates.  MS Paint was use&lt;/span&gt;&lt;span style="font-size:85%;"&gt;d to find the pixel locations which were then tabulated in OpenOffice Calc.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Since we are dealing images, the coordinate axes is a bit different in the &lt;/span&gt;&lt;span style="font-size:85%;"&gt;tradition&lt;/span&gt;&lt;span style="font-size:85%;"&gt;al sense.  The origin (i.e. pixel location (0,0)) is located at the upper &lt;/span&gt;l&lt;span style="font-size:85%;"&gt;eft cor&lt;/span&gt;&lt;span style="font-size:85%;"&gt;ner of the image and the positive y-axis is reversed. he origin of the plot is at some pixel location (&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;h&lt;/span&gt;&lt;span style="font-size:85%;"&gt;, &lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;k&lt;/span&gt;&lt;span style="font-size:85%;"&gt;). For simplicity, &lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;h&lt;/span&gt;&lt;span style="font-size:85%;"&gt; is subtracted from the pixel locations along &lt;span style="font-style: italic;"&gt;x&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;k&lt;/span&gt; is subtracted from the pixel locations along &lt;span style="font-style: italic;"&gt;y&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;x&lt;sub&gt;new&lt;/sub&gt; &lt;/span&gt;&lt;span style="font-size:100%;"&gt;=&lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt; x&lt;sub&gt;i&lt;/sub&gt; - h&lt;br /&gt;y&lt;sub&gt;new&lt;/sub&gt; = -&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;y&lt;sub&gt;i&lt;/sub&gt; - k&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;Note that the negative sign for the y pixel location comes from the fact that  the y-axis for images is reversed (refer to figure 2).&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/SjxOyOL9sHI/AAAAAAAAAAs/o9LU0kYolWE/s1600-h/master_annotate.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 239px; height: 289px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SjxOyOL9sHI/AAAAAAAAAAs/o9LU0kYolWE/s320/master_annotate.png" alt="" id="BLOGGER_PHOTO_ID_5349237082118008946" border="0" /&gt;&lt;/a&gt;&lt;div style="text-align: left;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ctLOE7SPslI/SjxJW5B97yI/AAAAAAAAAAc/_lkS-PJGORI/s1600-h/master_annotate.jpg"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;After translating the axes, the ratio for converting pixel values to actual values is computed. This was done by coun&lt;/span&gt;&lt;span style="font-size:85%;"&gt;ting the number of pixels between tick marks on the plot and n&lt;/span&gt;&lt;span style="font-size:85%;"&gt;oting the corresponding increm&lt;/span&gt;&lt;span style="font-size:85%;"&gt;ent size in the actual values.  Along the horizontal, a pixel difference of 76 was found for each 5 deg C increme&lt;/span&gt;&lt;span style="font-size:85%;"&gt;nt.  Along the vertical, a pixel difference of 117 was found for each 0.001 increment. Thus the computed ratios are&lt;br /&gt;&lt;br /&gt;ratio&lt;sub&gt;x&lt;/sub&gt;=actual diff/pixel diff = 5/76 = 0.066&lt;br /&gt;ratio&lt;sub&gt;y&lt;/sub&gt;=actual diff/pixel diff = 0.001/117 = 0.000009&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;                                                                    &lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;Therefore the actual values are&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;x&lt;sub&gt;actual&lt;/sub&gt; = x&lt;sub&gt;new&lt;/sub&gt;*ratio&lt;sub&gt;x&lt;/sub&gt;&lt;br /&gt;y&lt;sub&gt;actual&lt;/sub&gt; = y&lt;sub&gt;new&lt;/sub&gt;*rati&lt;/span&gt;&lt;span style="font-size:85%;"&gt;o&lt;sub&gt;y&lt;/sub&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;For the plot that i've chosen, it is necessary to add 1.0 to the y values since the y-axis does not start at zero but rather at 1.0.  The reconstructed plot is as follow&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ctLOE7SPslI/SjxQxKeJ-BI/AAAAAAAAAA8/6hFgdk9IBx8/s1600-h/graph+overlay.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 277px;" src="http://4.bp.blogspot.com/_ctLOE7SPslI/SjxQxKeJ-BI/AAAAAAAAAA8/6hFgdk9IBx8/s320/graph+overlay.png" alt="" id="BLOGGER_PHOTO_ID_5349239262963955730" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;To compare the original plot with the reonstructed one, the former was set as a background for the latter.  As with figure 3, the reconstruction is quite satisfactory.&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;&lt;br /&gt;OpenOffice Calc: Adding an image in the chart wall&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To add an image in a&lt;/span&gt;&lt;span style="font-size:85%;"&gt;n OpenOffice Calc chart, the first thing to do is add the desired image to bitmap list of Calc&lt;br /&gt;1. Select the chart then click &lt;span style="font-weight: bold;"&gt;Format&lt;/span&gt; -&gt; &lt;span style="font-weight: bold;"&gt;Graphics&lt;/span&gt; -&gt; &lt;span style="font-weight: bold;"&gt;Area&lt;/span&gt;&lt;br /&gt;2. Click the &lt;span style="font-weight: bold;"&gt;Bitmap&lt;/span&gt; tab then click &lt;span style="font-weight: bold;"&gt;Import&lt;/span&gt;.&lt;br /&gt;3. Select the image that you want.&lt;br /&gt;4. Save the list.&lt;br /&gt;5. You need to restart Calc before you can use the newly added image. Be sure to save your work first. (thanks to Janno)&lt;br /&gt;&lt;br /&gt;Once your done, you may&lt;br /&gt;6. Right-click on the chart and then select &lt;span style="font-weight: bold;"&gt;Chart Wall&lt;/span&gt;.&lt;br /&gt;7. Click on the &lt;span style="font-weight: bold;"&gt;Area&lt;/span&gt; tab and in the pull-down menu select &lt;span style="font-weight: bold;"&gt;Bitmap&lt;/span&gt;. Your image should be there.&lt;br /&gt;8. Set it to &lt;span style="font-weight: bold;"&gt;Stretch to fit&lt;/span&gt;.&lt;br /&gt;9. Click &lt;span style="font-weight: bold;"&gt;Ok&lt;/span&gt; and your done.  You may also want to check the scale of your axes.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For this activity I'll give myself a 9.0. ^_^&lt;br /&gt;&lt;br /&gt;&lt;sup&gt;[1]&lt;/sup&gt; Kimball, A. (1911). College Textbook of Physics. Henry Holt and Company.&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/3974070185893700788-6980193863501147223?l=thejaggernaut.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thejaggernaut.blogspot.com/feeds/6980193863501147223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thejaggernaut.blogspot.com/2009/06/activity-1-digital-scanning.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/6980193863501147223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3974070185893700788/posts/default/6980193863501147223'/><link rel='alternate' type='text/html' href='http://thejaggernaut.blogspot.com/2009/06/activity-1-digital-scanning.html' title='Activity 1: Digital Scanning'/><author><name>Mark Jayson Villangca</name><uri>http://www.blogger.com/profile/14897153276200167580</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/_ctLOE7SPslI/SjxOaAfusLI/AAAAAAAAAAk/DpQCJMQiyEQ/s72-c/master_cropped.png' height='72' width='72'/><thr:total>1</thr:total></entry></feed>
