<?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-5456089935119994902</id><updated>2011-08-05T12:11:48.998-07:00</updated><category term='applied physics'/><category term='Malese Jow'/><title type='text'>Malese-ous</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>30</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-6491602228902799538</id><published>2010-06-22T17:07:00.000-07:00</published><updated>2010-06-22T17:59:02.355-07:00</updated><title type='text'>I have transferred</title><content type='html'>to Tumblr.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-6491602228902799538?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/6491602228902799538/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2010/06/i-have-transferred.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/6491602228902799538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/6491602228902799538'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2010/06/i-have-transferred.html' title='I have transferred'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-5404597114384853059</id><published>2010-05-31T09:15:00.001-07:00</published><updated>2010-05-31T09:19:18.598-07:00</updated><title type='text'>Midnight</title><content type='html'>I find myself wide awake because of a little series of events that rattled my nerves a little and sent my sleepiness away.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Contradictions can keep one awake, especially if they bother you. How useful and useless I feel at the same time. Patient and impatient. Understanding and angry. And a whole lot more. Things I've been brewing in my head.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now it's time to move on. Even if this doesn't make any sense to you, reader, if you even exist.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-5404597114384853059?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/5404597114384853059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2010/05/midnight.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/5404597114384853059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/5404597114384853059'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2010/05/midnight.html' title='Midnight'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-191545638268506698</id><published>2010-05-15T18:37:00.000-07:00</published><updated>2010-05-15T18:57:11.882-07:00</updated><title type='text'>Blackouts</title><content type='html'>My vacation has been sort of hell. I rarely experienced power outages in MM. The longest blackout in my life was probably when typhoon Milenyo (also known as Xangsane) visited my country and then Vietnam and Thailand. Understandably, the damage lead to a power outage that lasted up to a week in some areas.&lt;br /&gt;&lt;br /&gt;But please. Intermittent blackouts do get on one's nerves, especially in the blistering heat of summer this El Niño "season." (blackouts occur 3-4 times a day, 1-2 hours per blackout) Our house is a good greenhouse, thanks to glass windows surrounding almost every wall of our house. I can sacrifice the internet and cold drinking water. But the heat is deadly.&lt;br /&gt;&lt;br /&gt;Come election week, power outages stayed behind bars. Now that the official counting is almost over, they (outages) are threatening to come break loose. Last night, I had a hard time faling asleep. It was 10pm when everything went dark. It lasted for two hours.&lt;br /&gt;&lt;br /&gt;So far, that was the only outage within the last 12 hours. But it's probably best to expect more of them soon.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-191545638268506698?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/191545638268506698/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2010/05/blackouts.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/191545638268506698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/191545638268506698'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2010/05/blackouts.html' title='Blackouts'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-2489308794136425268</id><published>2010-04-24T09:01:00.000-07:00</published><updated>2010-04-24T09:36:13.552-07:00</updated><title type='text'>RANT ENTRY #001</title><content type='html'>Ever since I was little, I remember being compared to everyone else for any reason imaginable. Of course, any child experiences this. Depending on how they are worded or expressed, comparisons may come of as encouraging, degrading, or annoying at least.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As a kid, I used to enjoy them as they were mostly "positive," meaning I am usually the one with the "better" qualities. I came to a point when I wondered how I would feel if I was in the "lesser" person's position. That would be hurtful. I also realised how the practice was also damaging to me to an extent. It inculcated in me the unconscious belief that I am the "best" one. No one can be better than I. If anyone got a higher score in a quiz for instance, I would naturally think of alibis (e.g. I did not sleep well enough, the classmate has a tutor, etc) just not to make the other person "better" than I, as this was a habit I got from hearing it said by older people who are "on my side."&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After more than two decades, almost nothing has changed. Sometimes, I want to defend the other people. I can't always be the best. It is true that I did not study in a science high school. It is true that education in my hometown cannot compete with the best high schools. But it is also true that I was not internally motivated during my first three years of college. It is also true that I often commit careless mistakes in computations. It is true that I am not always the quickest to learn. I can't always be the best for many reasons. They don't need to emphasize one set of reasons over the other. And most importantly, they don't need to MAKE UP stories about others who perform better to bring them down. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Right now, I remember some say these about a child prodigy: she does not have a social life, all she ever does is study, the point being that she is socially impaired in some way. I think you're just jealous of her. Hmmff!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;People, we need to accept ourselves and others for who we are and not what we accomplish. Those are two separate things. Accomplishments do not measure your worth! You are not in competition with the other people. You can only compare YOU with YOURSELF or ME with MYSELF, WITHOUT BRINGING OTHER PEOPLE DOWN.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And FYI, just because a person seems slow, doesn't mean he/she is necessarily less intelligent. What do you know of his/her mind?!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;**might be edited later&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-2489308794136425268?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/2489308794136425268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2010/04/rant-entry-001.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/2489308794136425268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/2489308794136425268'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2010/04/rant-entry-001.html' title='RANT ENTRY #001'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-2531446318891379163</id><published>2010-04-12T10:46:00.001-07:00</published><updated>2010-04-12T10:50:42.836-07:00</updated><title type='text'>After 8 days</title><content type='html'>It sure has been one hell of a week. I don't mean to say it was bad. I'm glad my cousin had fun going around the metro and going to Tagaytay (best trip IMO). But I am not very fond of shopping for clothes. I am naturally thrifty. Spending 400 bucks a day is not my thing. Later today (after I get some sleep), I'll send my cousin to the airport and return to the life I have always known.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I miss my ripstik. I'll get to play with it again. Finally.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-2531446318891379163?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/2531446318891379163/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2010/04/after-8-days.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/2531446318891379163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/2531446318891379163'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2010/04/after-8-days.html' title='After 8 days'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-3225559872476427075</id><published>2010-04-06T08:23:00.000-07:00</published><updated>2010-04-06T08:30:34.280-07:00</updated><title type='text'>Just a thought.</title><content type='html'>Many will agree with me that the world can make you lose a lot of your values if you're not careful. I have been a "victim" of it myself. I thank God for the people who share their beliefs and explain sensibly. If it weren't for them, I would have gotten completely lost in the woods.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-3225559872476427075?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/3225559872476427075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2010/04/just-thought.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/3225559872476427075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/3225559872476427075'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2010/04/just-thought.html' title='Just a thought.'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-7649828341041449028</id><published>2010-04-01T19:43:00.001-07:00</published><updated>2010-04-01T19:49:00.850-07:00</updated><title type='text'>I was confused</title><content type='html'>Hell, yeah. The sleepover is supposed to happen on Saturday (tomorrow), not today. I was confused. I only remembered after a chat with my friend, A. I hope I didn't misinform my other friend, J, of the date. I really want the sleepover to push through. With their busy schedules, anything that is planned can fail with a 70-80% chance.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I miss the old days when A had a lighter schedule and workload. She's going through a lot of emotional turmoil as well. God bless her.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;...&lt;/div&gt;&lt;div&gt;I'm at McDonald's Katipunan right now, just staying away from the heat and boredom in my room.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-7649828341041449028?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/7649828341041449028/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2010/04/i-was-confused.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/7649828341041449028'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/7649828341041449028'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2010/04/i-was-confused.html' title='I was confused'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-4824311326311774232</id><published>2010-04-01T02:52:00.000-07:00</published><updated>2010-04-01T03:03:40.893-07:00</updated><title type='text'>Immediate Concerns</title><content type='html'>First, I need five(5) hardbound copies of my thesis. I have to run after people for their signatures. I hope no one will practice power tripping or it'll scar me for life. (kidding.)&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Second, I have to find a place for my cousin who's coming over for a vacation for a week or two. I hope Balay Kalinaw has a small studio unit available for us. &lt;/div&gt;&lt;div&gt;Second (part two of the above, whatever), I need a place for my mom, sister and her colleague. They also have their eyes on Balay Kalinaw. Please, Lord, let there be a small studio unit as well. If I don't get an air conditioned room with its own toilet and bath, I'll be dead. :(&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Third, I need to pay 300 as graduation fee. My pockets are about to wither.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Fourth, I need to apply for clearance. They provided us with a list of things to do. Good job.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Fifth, I don't remember what else I need to do. But boy I'm glad I'm attending the slumber party at a friend's place tomorrow. That'll make me forget some of my concerns for a short while. This is one busy holy week for me.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;AJA! :D :D :D ---&gt;cheering myself up...&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-4824311326311774232?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/4824311326311774232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2010/04/immediate-concerns.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/4824311326311774232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/4824311326311774232'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2010/04/immediate-concerns.html' title='Immediate Concerns'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-4305614722158234538</id><published>2010-02-09T04:49:00.000-08:00</published><updated>2010-02-24T03:04:43.929-08:00</updated><title type='text'>CLEAN SLATE</title><content type='html'>Ok, I hope I can achieve this entry's title. I removed all of my previous blogs except for this one, which was originally intended for academic purposes. As you can see, my previous entry was written, some time ago, I can't even remember the exact date and I won't bother to check.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;(Hi Jica, I can't seem to post comments. Anyway, to answer your question, I deleted my other blogs. It feels as if someone else had written those. :D I hope to update this often beginning March. )&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-4305614722158234538?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/4305614722158234538/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2010/02/clean-slate.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/4305614722158234538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/4305614722158234538'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2010/02/clean-slate.html' title='CLEAN SLATE'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-104633739330559274</id><published>2009-09-23T20:04:00.000-07:00</published><updated>2009-10-12T08:04:01.660-07:00</updated><title type='text'>ACTIVITY 19 - Restoration of Blurred Image</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/StNESpm-j8I/AAAAAAAAAWg/P-SbzLRztoA/s1600-h/ebony-magazine-cover-april-2008.jpg"&gt;&lt;/a&gt;One of the problems encountered by people who take pictures is the inability to keep the camera steady. Most of the time, images are blurred due to the motion of the camera while the shutter is open. This, together with noise, produce images with poor quality.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In this activity, restoration via filtering in the Fourier domain is being investigated. In particular, we make use of the Weiner filter. Let us use the following image for our study.&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U5aA5wS7v7U/StNCssgIEEI/AAAAAAAAAWY/kSf9GiexGm8/s1600-h/clean.jpg"&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://2.bp.blogspot.com/_U5aA5wS7v7U/StNESpm-j8I/AAAAAAAAAWg/P-SbzLRztoA/s400/ebony-magazine-cover-april-2008.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5391728266090287042" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 321px; height: 400px; " /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;figure 1. Image taken from http://emeagwali.com/images/website/ebony-magazine-cover-april-2008.jpg&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U5aA5wS7v7U/StNCssgIEEI/AAAAAAAAAWY/kSf9GiexGm8/s1600-h/clean.jpg"&gt;&lt;img src="http://4.bp.blogspot.com/_U5aA5wS7v7U/StNCssgIEEI/AAAAAAAAAWY/kSf9GiexGm8/s400/clean.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5391726514520199234" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 321px; height: 400px; " /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt;figure 2. This is the red channel in grayscale.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Let f be the image in figure 2. Then its FT is F. Blurring may be modeled in Fourier space by multiplying F point by point to a function, H, which is an exponential function multiplied by a sine function. H depends on the quantities &lt;i&gt;a&lt;/i&gt; and &lt;i&gt;b&lt;/i&gt;, where these constants represent the velocity of the camera along the horizontal and the vertical respectively as the image is being taken. This product will be called G. If we take  inverse Fourier transform of G, we will get g, which is the blurred version of f. Then, let us add different types of noise into this image.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The Weiner filter involves calculations of H and G. If we know the power spectrum of the added noise, then we can include it in the expression for the Weiner filter and then multiply this by G. Its inverse transform will yield a somewhat good restoration. However, we usually don't know the power spectrum of the noise. We may opt to replace the power spectrum by a constant, K. We need to vary K and observe which value yields the best visual result.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Below are the results. In the first set, we added Gaussian noise with mean and variance of 0.5 and 0.1 respectively. The first image is the blurred version. The next image results upon noise addition. The third image is the restoration with a knowledge of the power spectrum of the Gaussian noise. Below, we have restorations for K=-.5, 0, 1.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://2.bp.blogspot.com/_U5aA5wS7v7U/StNCrHPk7uI/AAAAAAAAAWA/kkz_93Yq2GU/s400/Uniform2.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5391726487338807010" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 331px; " /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;figure 3. Gaussian noise restoration&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Second, we added exponential noise with a mean of .5. The images in the second row made use of the following values K=-1, 0, 0.1, 1.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://3.bp.blogspot.com/_U5aA5wS7v7U/StNCsNyJfhI/AAAAAAAAAWQ/vWuVVEx8NNo/s400/Gaussian+SoS+-.5+0+1.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5391726506274291218" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 331px; " /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;figure 4. Exponential noise restoration&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then, we have uniform noise that spans 0-1. We use K=0, 0.2, 1.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://4.bp.blogspot.com/_U5aA5wS7v7U/StNCrnxM4BI/AAAAAAAAAWI/wVddAbfwUbU/s400/Exponential+SoS+-1+0+.1+1.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5391726496069771282" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 247px; " /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;figure 5. Uniform noise spanning 0-1&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;/b&gt;Finally, we have uniform noise that spans 0.5-1. K=-0.2, 0, 0.2.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://2.bp.blogspot.com/_U5aA5wS7v7U/StNCqo9OntI/AAAAAAAAAV4/sCuZ2X5o2zs/s400/Uniform2.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5391726479208783570" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 331px; " /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;figure 6. Uniform noise, 0.5-1&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;/b&gt;We obtain the best restoration when the power spectrum is known. For certain types of noise, a certain constant K will suffice as we have seen above. In others,  this estimate is not enough. Further investigation is needed on replacing the power spectrum by a suitable estimate.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Rating: 10 for proper execution&lt;/div&gt;&lt;div&gt;Note: imwrite causes my laptop to hang. I opted to use imshow to obtain the blurred images, which shows an incorrect "blurred" version. Apologies to readers.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-104633739330559274?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/104633739330559274/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2009/09/activity-19-restoration-of-blurred.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/104633739330559274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/104633739330559274'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2009/09/activity-19-restoration-of-blurred.html' title='ACTIVITY 19 - Restoration of Blurred Image'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_U5aA5wS7v7U/StNESpm-j8I/AAAAAAAAAWg/P-SbzLRztoA/s72-c/ebony-magazine-cover-april-2008.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-7048013722700095367</id><published>2009-09-14T18:13:00.000-07:00</published><updated>2009-10-12T05:03:27.750-07:00</updated><title type='text'>ACTIVITY 18 - Noise Modelling and Basic Image Reconstruction</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/StMZa1IeUdI/AAAAAAAAAVw/uW_5HioklnE/s1600-h/noisypic.jpg"&gt;&lt;/a&gt;Previous techniques in image processing were highly subjective in nature. In this post, we use a more objective technique. In particular, we assume a model for image noise that may arise from the components of the sensor, lighting conditions during image capture, etc.&lt;br /&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Noise comes in many forms, such as gaussian, exponential, gamma, salt and pepper, constant, etc. There are diferent techniques of reducing noise, each being more effective than others in certain types of noise. We will consider each type of noise and apply 6 techniques which involve replacing a pixel by a specified mean. There are four types of averaging that we can use. We will specify a window around the pixel that would only include a small neighborhood around it.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First, we will generate a tri grayscale image. Its grayscale PDF is given by three dirac deltas of approximately the same height.&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/Srw8BBknKwI/AAAAAAAAAUc/UxIGry7T7vg/s1600-h/00+a.jpg"&gt;&lt;img src="http://2.bp.blogspot.com/_U5aA5wS7v7U/Srw8BBknKwI/AAAAAAAAAUc/UxIGry7T7vg/s400/00+a.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5385245242727803650" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 141px; height: 141px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Figure 1. Image&lt;/b&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/Srw8jIVs-hI/AAAAAAAAAUk/DywufW8kOO4/s1600-h/00+im+pdf.jpg"&gt;&lt;img src="http://3.bp.blogspot.com/_U5aA5wS7v7U/Srw8jIVs-hI/AAAAAAAAAUk/DywufW8kOO4/s400/00+im+pdf.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5385245828659870226" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 255px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Figure 2. PDF of figure 1&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;We will add different types of noise in this image with the following PDFs.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U5aA5wS7v7U/SrriuQ42CZI/AAAAAAAAAUU/Y2ZNZ8b_V0U/s1600-h/00+noise+pdf.jpg"&gt;&lt;img src="http://4.bp.blogspot.com/_U5aA5wS7v7U/SrriuQ42CZI/AAAAAAAAAUU/Y2ZNZ8b_V0U/s400/00+noise+pdf.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5384865588910098834" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 236px; " /&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Figure 3. Noise PDFs&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;The resulting images are shown below. Then four types of averaging are applied:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A.&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Arithmetic Mean&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Let our window be of dimensions m by n and centered at a particular pixel. To obtain the &lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;arithmetic mean, get the sum of all pixels within the window and divide by the total number &lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;of pixels or m*n.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;B.&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Geometric Mean&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Get the product of all m*n pixels and then take its (m*n)th root. This method will notably    &lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;fail within the window surrounding a zero valued pixel.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;C.&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Harmonic Mean&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Take the sum of the inverse pixel values (sum of 1/g, were g is the pixel value). Then &lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;divide m*n by this sum.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;D.&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Contraharmonic Mean&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Let Q be a nonzero integer. If g is the pixel value, take the sum of g^(Q+1). Divide this by &lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;the sum of g^Q. Q is called the filter order.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We get the following noisy images and reconstructed ones using the four methods averaging. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/Srrit5_J2tI/AAAAAAAAAUM/5aaC1He443s/s1600-h/01+Gaussian.jpg"&gt;&lt;img src="http://1.bp.blogspot.com/_U5aA5wS7v7U/Srrit5_J2tI/AAAAAAAAAUM/5aaC1He443s/s400/01+Gaussian.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5384865582762547922" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 115px; " /&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Figure 4. Gaussian Noise&lt;/b&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/Srrit5_J2tI/AAAAAAAAAUM/5aaC1He443s/s1600-h/01+Gaussian.jpg"&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/SrritTFvFBI/AAAAAAAAAUE/Bim1h0F-md8/s1600-h/02+Gamma.jpg"&gt;&lt;img src="http://1.bp.blogspot.com/_U5aA5wS7v7U/SrritTFvFBI/AAAAAAAAAUE/Bim1h0F-md8/s400/02+Gamma.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5384865572321170450" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 115px; " /&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Figure 5. Gamma Noise&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/Srrie_Ya5uI/AAAAAAAAAT8/NsLDw38vBSU/s1600-h/03+Expo.jpg"&gt;&lt;img src="http://2.bp.blogspot.com/_U5aA5wS7v7U/Srrie_Ya5uI/AAAAAAAAAT8/NsLDw38vBSU/s400/03+Expo.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5384865326512662242" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 115px; " /&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;b&gt;Figure 6. Exponential Noise&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/SrrieUXLF-I/AAAAAAAAAT0/1FHwTcTIRNI/s1600-h/04+Uniform.jpg"&gt;&lt;img src="http://1.bp.blogspot.com/_U5aA5wS7v7U/SrrieUXLF-I/AAAAAAAAAT0/1FHwTcTIRNI/s400/04+Uniform.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5384865314964707298" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 115px; " /&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Figure 7. Uniform Noise&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/SrrieAbQxRI/AAAAAAAAATs/FZISLnBG6OE/s1600-h/05+Rayleigh.jpg"&gt;&lt;img src="http://1.bp.blogspot.com/_U5aA5wS7v7U/SrrieAbQxRI/AAAAAAAAATs/FZISLnBG6OE/s400/05+Rayleigh.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5384865309613147410" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 115px; " /&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;b&gt;Figure 8. Rayleigh Noise&lt;/b&gt; &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/SrridkiACUI/AAAAAAAAATk/ZhQOnWOH8bk/s1600-h/06+Pepper.jpg"&gt;&lt;img src="http://3.bp.blogspot.com/_U5aA5wS7v7U/SrridkiACUI/AAAAAAAAATk/ZhQOnWOH8bk/s400/06+Pepper.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5384865302125218114" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 115px; " /&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;Figure 9. Pepper Noise&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;The arithmetic mean produces a blurred version of the original image. This may remove the noise from images but compromises details. However, if the image does not have sharp boundaries but gradual changes in grayscale, this filter will work well. However, even if the image does not have sharp boundaries, it will not work well with noise with a very limited range in its PDF, such as salt/pepper noise. If there are a few such "spots" throughout the image, the reconstructed one will be blotchy in places. If there are several spots, the result will be less blotchy and smoother but the overall brightness will be affected depending on the value of the noise.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The geometric mean generally produces a higher contrast image than the previous. Even when the noisy image is very dim, the reconstructed image will still be bright. It is effective with noise that is highly "imbalanced" such as gamma and exponential noise. One drawback is that blotches from salt/pepper noise are more prominent.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The harmonic mean is an interesting filter. It produces a sharp image. It performs remarkably well on pepper noise and fairly well with uniform noise and gaussian noise. But it does not work with gamma, exponential and salt noise. In the latter, the reconstructed images are very tile-like. With rayleigh noise, the quality is somewhat in between. On the other hand, the tile effect is nice as it does not overpower too much detail.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The contraharmonic filter comes in two flavors. Q may be positive or negative. When Q is positive, pepper noise is removed. We expect it to work well with dim noise. It fails with salt noise and expect it to fail with other types of bright noise. The opposite is true for negative Q.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Another factor that we can look into with filtering is the window size. If the window is small, blurring is minimized but cleaning is reduced as well. If the window is large, more noise is removed but detail is lost. We must find the proper window size that will make a good compromise between the two. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/SrxMu7FzM3I/AAAAAAAAAUs/0esaYv0C8BQ/s1600-h/window+size.jpg"&gt;&lt;img src="http://1.bp.blogspot.com/_U5aA5wS7v7U/SrxMu7FzM3I/AAAAAAAAAUs/0esaYv0C8BQ/s400/window+size.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5385263623447982962" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 170px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Figure 10. Effect of Window Size&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Now let us observe the filters when applied to a more realistic grayscale image such as the one below. Its histogram is spread out rather than being confined to three values. In this image, gaussian noise was applied. We can see that the corrected images do not differ much from those corrected ones of the simple shapes. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://3.bp.blogspot.com/_U5aA5wS7v7U/StMZa1IeUdI/AAAAAAAAAVw/uW_5HioklnE/s400/noisypic.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5391681127622529490" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 62px; " /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Figure 11. Image with gaussian noise and results of filtering&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Each filter has its own advantages and disadvantages. We need to know the nature of the noise in the image so that we can wisely choose the correct filter or set of filters which we can apply successively. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Rating: 10 for completing this very long activity&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/5456089935119994902-7048013722700095367?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/7048013722700095367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2009/09/activity-18-noise-model-and-basic-image.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/7048013722700095367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/7048013722700095367'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2009/09/activity-18-noise-model-and-basic-image.html' title='ACTIVITY 18 - Noise Modelling and Basic Image Reconstruction'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_U5aA5wS7v7U/Srw8BBknKwI/AAAAAAAAAUc/UxIGry7T7vg/s72-c/00+a.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-3846423080144218117</id><published>2009-09-14T18:10:00.000-07:00</published><updated>2009-10-12T04:59:21.522-07:00</updated><title type='text'>ACTIVITY 17 - Stereometry</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/StL-SKEeOEI/AAAAAAAAAU4/neCWSWmd90A/s1600-h/3drecon.bmp"&gt;&lt;/a&gt;&lt;div&gt;Real objects are 3 dimensional (at least that's what we can observe easily). When they are captured by a camera, they reduce to 2 dimensional images. Each pixel in the image would reflect the color of the object and the lighting conditions it was subjected to at the time that it was captured. If we can keep the camera and the object fixed and change the lighting conditions, we may be able to determine the 3D shape of the object based only on the variations of brightness across different images.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The easiest case to work with would be a point source of light. The intensity would depend as 1/r^2, where r is the distance from the point source. The mathematical derivations will not be &lt;/div&gt;&lt;div&gt;shown here. Just note that we need information on the different positions of the light source relative to the object and the following images.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/Sq7p1cL3sQI/AAAAAAAAATM/6-WUePVF-Ik/s1600-h/Is.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 400px; height: 93px;" src="http://1.bp.blogspot.com/_U5aA5wS7v7U/Sq7p1cL3sQI/AAAAAAAAATM/6-WUePVF-Ik/s400/Is.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5381495709062639874" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Figure 1.&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;After applying some matrix operations, we obtain the following reconstruction.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://3.bp.blogspot.com/_U5aA5wS7v7U/StL-SKEeOEI/AAAAAAAAAU4/neCWSWmd90A/s400/3drecon.bmp" border="0" alt="" id="BLOGGER_PHOTO_ID_5391651291810117698" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 292px; " /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Figure 2. Reconstruction&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;The reconstruction is rather good. The noise (not clear from figure 2) is due mainly to rounding off in between calculations. Note from figure 2 that the object need not be monochromatic. This is because the depth information is determined only from variations of a pixel from one image to another. This is why we need to make sure that the object is fixed relative to the camera.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Rating: 10&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-3846423080144218117?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/3846423080144218117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2009/09/activity-17-stereometry.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/3846423080144218117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/3846423080144218117'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2009/09/activity-17-stereometry.html' title='ACTIVITY 17 - Stereometry'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_U5aA5wS7v7U/Sq7p1cL3sQI/AAAAAAAAATM/6-WUePVF-Ik/s72-c/Is.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-4493614855792748400</id><published>2009-09-02T17:50:00.001-07:00</published><updated>2009-10-12T05:02:53.152-07:00</updated><title type='text'>ACTIVITY 16 - Neural Networks</title><content type='html'>We present here yet another method of classifying objects. We will not consider the details but present the overall procedure when using neural networks.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U5aA5wS7v7U/StMYkKGGZFI/AAAAAAAAAVo/S5j-tSsZOaE/s1600-h/neural+network+diagram.jpg"&gt;&lt;img src="http://4.bp.blogspot.com/_U5aA5wS7v7U/StMYkKGGZFI/AAAAAAAAAVo/S5j-tSsZOaE/s400/neural+network+diagram.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5391680188356912210" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 275px; height: 230px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt;figure 1. Schematic of a neural network&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;In a neural network, there are three layers: input, hidden, output. The input layer may consist of the features. These values are then transferred to each node in the hidden layer using a specific weighting factor for each node. Finally, the nodes from the hidden layer transfer data onto the output layer. To obtain the proper weighting factors, the network needs to be trained.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In this activity, we vary the number of iterations done in determining the factors. As we can see below, the result improves significantly in the range 100-7000 iterations. More than that, the accuracy does not increase as quickly. For the given system then, the optimum iteration is seen to be 7000.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://1.bp.blogspot.com/_U5aA5wS7v7U/StMYj4qUfgI/AAAAAAAAAVg/s1Izbt3yjW4/s400/iterations.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5391680183676993026" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 89px; " /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;figure 2. Values as a function of number of iterations&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://1.bp.blogspot.com/_U5aA5wS7v7U/StMYjUlOPVI/AAAAAAAAAVY/ShXLYEngAxk/s400/iterations2.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5391680173991935314" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 123px; " /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;figure 3. Plot of the values as a function of iterations for one object&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;When the number of iterations is too low, the system is barely able to classify an object. The values indicate that it is almost equally like to be one as to be the other. On the other hand, there is some form of saturation. Beyond 7000 iterations for our system, the accuracy does not increase as much. Another limit of the neural network is its inability to classify when one set of features are much larger than the other set. For instance, the area value was supposed to be in the order of tens of thousands. In that case, the network fails. However, if we divide this set my tens of thousands, the resulting values are easier to handle, especially with the red component being anywhere between 0 and 1 only.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For this system, the classification works best at about 4000-5000 iterations. In other words, the compromise between speed and accuracy is rather fair. For a different data set, especially a more difficult one, the calculations need to be repeated to determine the behavior of the network.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Rating: 10 for having completed the work&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-4493614855792748400?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/4493614855792748400/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2009/09/activity-16-neural-networks-unfinished.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/4493614855792748400'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/4493614855792748400'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2009/09/activity-16-neural-networks-unfinished.html' title='ACTIVITY 16 - Neural Networks'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_U5aA5wS7v7U/StMYkKGGZFI/AAAAAAAAAVo/S5j-tSsZOaE/s72-c/neural+network+diagram.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-8739361562683409483</id><published>2009-08-26T17:27:00.001-07:00</published><updated>2009-10-12T05:03:07.779-07:00</updated><title type='text'>Activity 15 - Probabilistic Classification</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/StMYGOtnF-I/AAAAAAAAAVQ/5QAFoPavqj8/s1600-h/sample+calculation.jpg"&gt;&lt;/a&gt;Objects can be classified into categories based on features that can be measured. In the previous activity, we determine class membership by determining which mean feature vector it is closer to. However, this may prove tricky when the distributions fall along parallel lines, for instance. A feature vector may fall along the line crossing one mean vector but be nearer the other mean vector.&lt;br /&gt;&lt;br /&gt;Linear discriminant analysis may be used in such cases. This is a mathematically involved process. The formula to be used is given by&lt;br /&gt;&lt;p&gt;      &lt;/p&gt;&lt;p&gt; &lt;img src="http://people.revoledu.com/kardi/tutorial/LDA/Image/Numerical%20Example_clip_image002_1001.gif" width="215" height="27" /&gt;&lt;/p&gt;&lt;p&gt;where &lt;span style="font-weight: bold;"&gt;C&lt;/span&gt; is the covariance matrix of a set of measurements &lt;span style="font-weight: bold;"&gt;x&lt;/span&gt;,&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;u&lt;/span&gt; is the mean of the set of measurements of the class i,&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;p&lt;/span&gt; is the prior probability (expected value prior to any measurement, usually given by&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                                              number of samples in a class/total number of samples&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;An object with a particular measurement &lt;span style="font-weight: bold;"&gt;x&lt;/span&gt; belongs to the class&lt;span style="font-weight: bold;"&gt; i&lt;/span&gt; which has the largest discriminant function, &lt;span style="font-weight: bold;"&gt;f&lt;/span&gt;.&lt;br /&gt;&lt;/p&gt;&lt;span style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;Using LDA, we obtain a 100% recognition rate. Below is a snapshot of a sample calculation. Note that we made use of the same data set as in the previous activity.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt; &lt;span style="font-family:Times New Roman,serif;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="-webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://1.bp.blogspot.com/_U5aA5wS7v7U/StMYGOtnF-I/AAAAAAAAAVQ/5QAFoPavqj8/s400/sample+calculation.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5391679674200299490" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 156px; " /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;figure 1. Sample calculation&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Rating: 10 for correct classification&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-8739361562683409483?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/8739361562683409483/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2009/08/activity-15-probabilistic.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/8739361562683409483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/8739361562683409483'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2009/08/activity-15-probabilistic.html' title='Activity 15 - Probabilistic Classification'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_U5aA5wS7v7U/StMYGOtnF-I/AAAAAAAAAVQ/5QAFoPavqj8/s72-c/sample+calculation.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-4080131517657203330</id><published>2009-08-26T17:26:00.000-07:00</published><updated>2009-10-05T17:36:27.797-07:00</updated><title type='text'>Activity 14 - Pattern Recognition</title><content type='html'>There are many objects around us that we can recognize. This is because our brains retain certain patterns or features that make an object unique. The simplest features to recognize are shape, size and color. These characteristics may be obtained using the image processing techniques that we have learned in the past activities.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Features may be assigned values in a coordinate system. For instance, in a 3D system, the dimensions may be area, average red and average green. We may choose any other feature for as long as we can quantify it. A set of one type of object will have a distribution of features along this coordinate system. Typically, this distribution is gaussian in form.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A set of another type of object will have its own distribution. If the two distributions do not overlap significantly, we can determine whether one object will belong to one set or the other by finding the distance of its feature point in coordinate space from the average feature point of each set. It belongs to the set with which its feature point is located closer.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Take for example these two sets of snack items.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/Sp8qpNHjiJI/AAAAAAAAAS0/Zakzj7RJQyk/s1600-h/images.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 298px; height: 400px;" src="http://1.bp.blogspot.com/_U5aA5wS7v7U/Sp8qpNHjiJI/AAAAAAAAAS0/Zakzj7RJQyk/s400/images.jpg" alt="" id="BLOGGER_PHOTO_ID_5377063367488014482" border="0" /&gt;&lt;br /&gt;&lt;/a&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Figure 1. abov e-Cheez it, below-Pillows&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;The features of 5 pieces were taken from each set and averaged. Another five were taken from each and then their features are plotted together with the average. For aree and average red, the following were obtained.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0);"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/Sp8qpegTnRI/AAAAAAAAAS8/ijkRmND73Jc/s1600-h/plot.jpg"&gt;&lt;img src="http://2.bp.blogspot.com/_U5aA5wS7v7U/Sp8qpegTnRI/AAAAAAAAAS8/ijkRmND73Jc/s400/plot.jpg" alt="" id="BLOGGER_PHOTO_ID_5377063372155231506" style="margin: 0px 10px 10px 0px; float: left; cursor: pointer; width: 400px; height: 320px;" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Figure 2. Area in pixels vs average red&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;In this example, the objects are very easy to classify. We simply find the feature point or feature vector (f1,f2,f3,..) and find its distance from each mean feature (a1,a2,a3,..) and (b1,b2,b3,...) using the distance formula d=sqrt((f1-a1)^2 + (f2-a2)^2 + (f3-a3)^2 + ...).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In this activity, the classification rate is 100%. The two sets are well separated in feature space. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Rating: 10&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/5456089935119994902-4080131517657203330?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/4080131517657203330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2009/08/activity-14-pattern-recognition.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/4080131517657203330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/4080131517657203330'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2009/08/activity-14-pattern-recognition.html' title='Activity 14 - Pattern Recognition'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_U5aA5wS7v7U/Sp8qpNHjiJI/AAAAAAAAAS0/Zakzj7RJQyk/s72-c/images.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-1098893956801257089</id><published>2009-08-19T21:09:00.000-07:00</published><updated>2009-08-23T04:44:13.718-07:00</updated><title type='text'>Activity 13 - Correcting Geometric Distortion</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/So6k2oVOGtI/AAAAAAAAASk/Z7MjXEYcNIo/s1600-h/osc+thin.jpg"&gt;&lt;/a&gt;&lt;div&gt;Imaging systems are imperfect. Individual components such as lenses usually introduce noticable distortions in images. Many cameras have been designed to minimize such effects. For simpler ones such as camera phones,  the distortions are obvious, especially when the object of interest is considerably far from the optical axis or the middle where distortions are negligible.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Two of the most common distortions are the barrel and pincushion distortion. In the first case, the image becomes smaller as one moves farther from the optical axis. The opposite is true for the second case. Below is an example of a barrel distortion.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U5aA5wS7v7U/SozNLaGUwJI/AAAAAAAAAR8/GorS2j3Y9g0/s1600-h/ideal+grid.bmp"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 251px; height: 251px;" src="http://4.bp.blogspot.com/_U5aA5wS7v7U/SozNLaGUwJI/AAAAAAAAAR8/GorS2j3Y9g0/s400/ideal+grid.bmp" border="0" alt="" id="BLOGGER_PHOTO_ID_5371894051414261906" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Figure 1. Ideal Grid&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U5aA5wS7v7U/SozNK-pudpI/AAAAAAAAAR0/KazCv16INJo/s1600-h/d.bmp"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 251px; height: 251px;" src="http://4.bp.blogspot.com/_U5aA5wS7v7U/SozNK-pudpI/AAAAAAAAAR0/KazCv16INJo/s400/d.bmp" border="0" alt="" id="BLOGGER_PHOTO_ID_5371894044046554770" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Figure 2. Grid with Barrel Distortion&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;In image 2, the distortion is not extreme. In fact, if we look at any square, it still looks like a polygon with four straight sides. Thus, we can work on the corners of one square, find their undistorted counterparts, determine the  linear transformation, and use this knowledge to recover the square, including the pixels contained in the square. The counterpart may be  found by simply generating a straight grid based on the squares in the middle of the image since their distortions are imperceptible.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In principle ,we can fully recover the ideal image. However, images are discretized into pixels. A point on the reconstructed will almost always never fall exactly on a pixel in the distorted image but at some "fraction of a pixel" from it. The simplest is to assume the value of the pixel nearest it. However, the quality may be poor. A more involved but still quick method is to assume a bilinear interpolation. Using the steps outlined here, we get the following reconstructions of the distorted grid in figure 2. Note that each square has its own transformation. In scilab, for loops may be used to go through each square.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://3.bp.blogspot.com/_U5aA5wS7v7U/So6gUT7trxI/AAAAAAAAASE/uURHbezllNs/s400/grid+recon2.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5372407676308139794" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 251px; height: 251px; " /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt;Figure 3. Reconstructed Grid (Nearest Neighbor)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SozNKTqOgUI/AAAAAAAAARs/SbbXH5XwGCE/s1600-h/new.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 251px; height: 251px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SozNKTqOgUI/AAAAAAAAARs/SbbXH5XwGCE/s400/new.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5371894032505930050" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Figure 3. Reconstructed Grid (Bilinear interpolation)&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Figure 3 has a much better quality than figure 2. The lines are smoother and more accurate. This reconstruction may be very useful as shown by the next example below.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U5aA5wS7v7U/So6iwtuBEdI/AAAAAAAAASc/jnKsJppmkDs/s1600-h/osc.JPG"&gt;&lt;img src="http://4.bp.blogspot.com/_U5aA5wS7v7U/So6iwtuBEdI/AAAAAAAAASc/jnKsJppmkDs/s400/osc.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5372410363289604562" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 227px; " /&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;Figure 4. Tilted and distorted image of oscilloscope display&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Some experiments require gathering data that can only be displayed as in figure 4. The usual approach is to estimate the desired parameter manually. Image processing can help improve the accuracy tremendously, especially if the data is not as regular as the example in figure 4. First, we have to reconstruct the image. Note how the gridlines of the display may serve as reference squares and rectangles for the reconstruction. Nearest neighbor and bilinear interpolation produced the following results. &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/So6iwNjok5I/AAAAAAAAASU/lediHdTU5oI/s1600-h/osc+recon1.jpg"&gt;&lt;img src="http://1.bp.blogspot.com/_U5aA5wS7v7U/So6iwNjok5I/AAAAAAAAASU/lediHdTU5oI/s400/osc+recon1.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5372410354656121746" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 228px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Figure 5. Reconstructed Oscilloscope Display (nearest neighbor)&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/So6iv3kZlxI/AAAAAAAAASM/HncvE3TfrXQ/s1600-h/osc+recon.jpg"&gt;&lt;img src="http://1.bp.blogspot.com/_U5aA5wS7v7U/So6iv3kZlxI/AAAAAAAAASM/HncvE3TfrXQ/s400/osc+recon.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5372410348753753874" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 227px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Figure 6.Reconstructed Oscilloscope Display (bilinear interpolation)&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;The result of nearest neighbor approximation for images with "thick" elements are not as bad as for thin ones (compare figure 3 and figure 5), precisely because being one pixel off is not too big for objects much thicker than one pixel. In figure 3, the grid lines are mostly one pixel thick, so being off by one pixel makes a relatively huge difference.&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;The techniques learned from previous blog entries may be used to extract data. For instance, conversion to black and white and thinning may be used to obtain a result such as the following.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://1.bp.blogspot.com/_U5aA5wS7v7U/So6k2oVOGtI/AAAAAAAAASk/Z7MjXEYcNIo/s400/osc+thin.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5372412663945894610" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 227px; " /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Figure 7. Binarized and thinned&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;The quality of figure 7 may be improved, if we will, be additional morplological processes and added care in applying image processing techniques. Then we can determine the coordinates of the white pixels above and convert them via ratio and proportion into physically meaningful variables since each unit length of a side of a square in figure 6 corresponds to, say 10 Volts, which corresponds to 40 pixels (assumed width of an ideal square in figure 7).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This activity was frustrating and fun at the same time. I used four for loops and a few if conditions within, which ate up a lot of my mental energy. I was only too happy when I finally succeeded. 10 points for completely understanding the concepts.&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/5456089935119994902-1098893956801257089?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/1098893956801257089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2009/08/activity-13-correcting-geometric.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/1098893956801257089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/1098893956801257089'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2009/08/activity-13-correcting-geometric.html' title='Activity 13 - Correcting Geometric Distortion'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_U5aA5wS7v7U/SozNLaGUwJI/AAAAAAAAAR8/GorS2j3Y9g0/s72-c/ideal+grid.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-4675376010827156141</id><published>2009-08-05T20:12:00.001-07:00</published><updated>2009-08-06T20:19:15.380-07:00</updated><title type='text'>Activity 12 - Color Image Segmentation</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/Snucd2SN8AI/AAAAAAAAAP0/RYdRUURhdzE/s1600-h/object.jpg"&gt;&lt;/a&gt;&lt;p class="MsoNormal"&gt;Someimes, the region of interest in an image cannot be separated by thresholding because the background is of the same brightness as the foreground. Instead, we work with colors in order to isolate the desired object.&lt;/p&gt;&lt;p class="MsoNormal"&gt;We work with normalized RGB colors and reduce the image to two channels. Let R+G+B=I, and the normalized colors be r=R/I, g=G/I and b=B/I. We can use only r and g since b is not independent but is equal to 1-r-g. These normalized values only show us the chroma of the color and does not indicate its brightness. Then if the region of interest is distinct in terms of color, the histogram of its r and g would occupy a small region.&lt;/p&gt;&lt;p class="MsoNormal"&gt;We isolate the region of interest in two ways. Both methods involve replacing the pixels by its probablility of being found within the region of interest. In the non parametric method, we obtain the r and g histogram of a portion of the object we want to isolate and let it serve as the probability distribution. Colors which are not found in the region will, of course, have zero probability. In the parametric method, we replace the histogram by a Gaussian curve whose mean and deviation is computed based from the histogram.&lt;/p&gt;&lt;p class="MsoNormal"&gt;Below are the results of non parametric and parametric isolation. The parametric solution yields a better result because we make use of a smooth probability distribution function. In the non parametric solution, we get a jagged result because the histogram itself contains kinks. However, the parametric solution also has a greater tendency to include areas outside the region of interest. For instance, a greater portion of the black carton that reflected the orange object is included.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/Snucd2SN8AI/AAAAAAAAAP0/RYdRUURhdzE/s1600-h/object.jpg"&gt;&lt;img src="http://2.bp.blogspot.com/_U5aA5wS7v7U/Snucd2SN8AI/AAAAAAAAAP0/RYdRUURhdzE/s400/object.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5367055417544142850" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 125px; " /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Isolating objects in terms of color works well if it is distinct from other objects. In the example above, we will have to employ a little help from the histogram if we want to eliminate the unwanted portion since it is darker/dimmer than the region of interest.&lt;/p&gt;I rate this work 10 for being able to isolate the region of interest and explain why the parametric method gave the better result.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-4675376010827156141?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/4675376010827156141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.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/5456089935119994902/posts/default/4675376010827156141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/4675376010827156141'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2009/08/activity-12-color-image-segmentation.html' title='Activity 12 - Color Image Segmentation'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_U5aA5wS7v7U/Snucd2SN8AI/AAAAAAAAAP0/RYdRUURhdzE/s72-c/object.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-7181328252393588659</id><published>2009-08-05T19:05:00.000-07:00</published><updated>2009-08-06T21:42:11.851-07:00</updated><title type='text'>Activity 11 - Color Camera Processing</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/SnuwGT_8zpI/AAAAAAAAARM/Dem_iNWf_hw/s1600-h/more.jpg"&gt;&lt;/a&gt;Cameras are designed to simulate the human eyes which are highly adaptive to the surroundings. One property of both sensors is white balancing, which attempts to minimize color casts brought about by the illumination.&lt;br /&gt;For instance, objects that are illuminated by an incandescent bulb appear yellowish. To compensate, sensors minimize the amount of yellow that is received. Cameras have different white balancing settings that we can choose from. Sometimes though, we may choose the incorrect setting and end up with images with unwanted tint.&lt;br /&gt;There are different ways of minimizing unwanted color casts. In this activity, we explore 2 different methods. The first is the &lt;span style="font-weight: bold;"&gt;white patch method&lt;/span&gt;. Most images are different mixtures of red, green and blue. If there is a portion of the image that should be white , it would clearly show the color cast in the image. By dividing each channel by the value of this white portion, we would be able to minimize the color cast. That patch would have the RGB of a "true" white image (R=G=B=1).&lt;br /&gt;The second method is the &lt;span style="font-weight: bold;"&gt;gray world method&lt;/span&gt;. We divide the values in every channel by the average of that channel. This method assumes that in the image, the total amount or red, green and blue is the same.&lt;br /&gt;There are limitations to each of the two methods outlined above. The first requires the presence of  the white patch. We have to choose our points carefully. Without the white patch, we will not have a reference with which to divide the image. In the second, we require that the image be colorful. In images that are dominantly red, for example, applying the gray world method would minimize the red or increase the green and blue in the image. In fact, the color casts may be worsened.&lt;br /&gt;Below are different examples of improperly white balanced images and the results upon applying the two methods.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;A. Improperly White Balanced&lt;/b&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/SnudiE4_laI/AAAAAAAAAQM/CAdiE0k_Hlo/s1600-h/A+improperly+whita+balanced.jpg"&gt;&lt;img src="http://1.bp.blogspot.com/_U5aA5wS7v7U/SnudiE4_laI/AAAAAAAAAQM/CAdiE0k_Hlo/s400/A+improperly+whita+balanced.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5367056589695980962" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 339px; " /&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;B. White Patch Method&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U5aA5wS7v7U/SnudhmlAHWI/AAAAAAAAAQE/-aXkt7-9ObQ/s1600-h/B+white+patch.jpg"&gt;&lt;img src="http://4.bp.blogspot.com/_U5aA5wS7v7U/SnudhmlAHWI/AAAAAAAAAQE/-aXkt7-9ObQ/s400/B+white+patch.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5367056581559065954" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 339px; " /&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;b&gt;C. Gray World Method&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SnudhAXIL3I/AAAAAAAAAP8/qD3cbQZi_-0/s1600-h/C+Gray+world.jpg"&gt;&lt;img src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SnudhAXIL3I/AAAAAAAAAP8/qD3cbQZi_-0/s400/C+Gray+world.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5367056571300327282" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 339px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The white patch method contributed better results than the gray world method. As we can see from the figures, the color casts were considerably lessened. The colors of the images taken at different white balance conditions appear more alike after correction, although the difference is still marked for the “cloudy” images of the first three sets. This may be attributed to the small size of the white patch used. If a bigger spot were present in them, the casts would be more reduced since it would better represent the cast in the image.&lt;/div&gt;&lt;div&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-weight:normal"&gt;As we have noted previously, the gray world method introduced its own color cast into the images. This method will not work in most cases because our there usually exists an inherent imbalance in the distribution of colors.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Here is another set of images. The gray world method fails miserably for images with very limited range of chroma. &lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://3.bp.blogspot.com/_U5aA5wS7v7U/SnuwGT_8zpI/AAAAAAAAARM/Dem_iNWf_hw/s400/more.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5367077003436281490" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 329px; " /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Rating: 10 for completing the work and obtaining expected results&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-7181328252393588659?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/7181328252393588659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2009/08/activity-11-color-camera-processing.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/7181328252393588659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/7181328252393588659'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2009/08/activity-11-color-camera-processing.html' title='Activity 11 - Color Camera Processing'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_U5aA5wS7v7U/SnudiE4_laI/AAAAAAAAAQM/CAdiE0k_Hlo/s72-c/A+improperly+whita+balanced.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-5707094789232250260</id><published>2009-08-03T18:44:00.000-07:00</published><updated>2009-08-06T22:11:03.084-07:00</updated><title type='text'>Activity 10 - Preprocessing Text</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U5aA5wS7v7U/Snu2tWktQmI/AAAAAAAAARk/Udy7pFEOGTI/s1600-h/word+recog.bmp"&gt;&lt;/a&gt;In the last activity, morphological operations were used to help estimate the area of “cells.” In this activity, we apply morphological operations in conjunction with techniques involving Fourier Transforms to process text. A scanned image is provided for us, a copy of which is shown below.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/SneSzqQDVZI/AAAAAAAAAPM/L1f85a0tLE0/s1600-h/Untitled_0001.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 400px;" src="http://3.bp.blogspot.com/_U5aA5wS7v7U/SneSzqQDVZI/AAAAAAAAAPM/L1f85a0tLE0/s400/Untitled_0001.jpg" alt="" id="BLOGGER_PHOTO_ID_5365918897247835538" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;figure 1.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The task is to choose a portion of the text, remove the lines from the form, and extract the text. Line removal is easily handled by noting that in the FT, lines exhibit as bright spots along the x and y axis. We simply mask these frequencies to eliminate them. Note however that the image needs to be rotated in order for the lines to be horizontal and vertical. As we have learned from the FT exercises, the FT also rotates with the image. It would be more difficult to mask the frequencies if they lie at some small angle from the horizontal and vertical. Extraction is done by converting the image to black and white by proper thresholding. For example, the histogram of the grayscale might look like that in the following figure.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/SneTWfWWHDI/AAAAAAAAAPU/9sonALFiGAM/s1600-h/hist.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 128px;" src="http://1.bp.blogspot.com/_U5aA5wS7v7U/SneTWfWWHDI/AAAAAAAAAPU/9sonALFiGAM/s200/hist.jpg" alt="" id="BLOGGER_PHOTO_ID_5365919495616863282" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;The portion that highly resembles a Gaussian is the background, the bright/near white portion of the image. We must set the threshold just to the left of where it begins (shown in arrow). Afterwards, we can fine tune the threshold by observing the resulting black an white image.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;figure 2.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Cleaning needs to be done after isolation because some noise is inevitably carried over. I used erosion to remove small isolated points and dilated to bring back the original size. Then thinning is used to obtain one pixel thick characters. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/Snu0DuLeOhI/AAAAAAAAARU/BF6Bk8U4RBk/s1600-h/attempts.jpg"&gt;&lt;img src="http://2.bp.blogspot.com/_U5aA5wS7v7U/Snu0DuLeOhI/AAAAAAAAARU/BF6Bk8U4RBk/s400/attempts.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5367081356970834450" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 80px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;figure 3.&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;The reconstruction of the letters was not very good.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The morphological operations that we have learned may also be used to rcognize certain words. We can use the process of isolation and thinning above to find instances of the word &lt;b&gt;description&lt;/b&gt; in the document above. The entire document is binarized and then the thinned version of &lt;b&gt;description&lt;/b&gt; is used as the eroding element for the document. At the location where the thinned version is exactly contained within the word, we get a white point. Elsewhere, we get black.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://4.bp.blogspot.com/_U5aA5wS7v7U/Snu2tWktQmI/AAAAAAAAARk/Udy7pFEOGTI/s400/word+recog.bmp" border="0" alt="" id="BLOGGER_PHOTO_ID_5367084271211987554" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 96px; " /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;figure 4. Click to see a bigger version&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Rating: I accomplished everything that is asked for. But I am not satisfied with my reconstruction of the letters. So I rate my work 9.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-5707094789232250260?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/5707094789232250260/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2009/08/activity-10-preprocessing-text.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/5707094789232250260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/5707094789232250260'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2009/08/activity-10-preprocessing-text.html' title='Activity 10 - Preprocessing Text'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_U5aA5wS7v7U/SneSzqQDVZI/AAAAAAAAAPM/L1f85a0tLE0/s72-c/Untitled_0001.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-8013911599935398030</id><published>2009-08-03T18:08:00.000-07:00</published><updated>2009-08-03T18:43:12.077-07:00</updated><title type='text'>Activity 9 - Binary Operations</title><content type='html'>Morphological operations such as the ones considered in the previous activity do not only have artistic appeal. They may also be utilized to remove or enhance features in images. They come in handy when removing noise, for example. Consider the figure below. It consists of pieces of punched paper scattered on a gray background.When we take  the grayscale of a portion of it at optimum threshold, we get the image at the right. Note that it still has some noise.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SneOzqQad0I/AAAAAAAAAO0/KGQYFR2c7UI/s1600-h/Circles002.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 400px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SneOzqQad0I/AAAAAAAAAO0/KGQYFR2c7UI/s400/Circles002.jpg" alt="" id="BLOGGER_PHOTO_ID_5365914499202840386" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;span style="font-weight: bold;"&gt;figure 1.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/SneOze7gpKI/AAAAAAAAAOs/C28-wfuP0bg/s1600-h/C9.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 256px; height: 256px;" src="http://3.bp.blogspot.com/_U5aA5wS7v7U/SneOze7gpKI/AAAAAAAAAOs/C28-wfuP0bg/s400/C9.jpg" alt="" id="BLOGGER_PHOTO_ID_5365914496162374818" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SneOzC0sR9I/AAAAAAAAAOk/puEq5IRNJ8g/s1600-h/noise.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 256px; height: 256px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SneOzC0sR9I/AAAAAAAAAOk/puEq5IRNJ8g/s400/noise.jpg" alt="" id="BLOGGER_PHOTO_ID_5365914488617584594" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;span style="font-weight: bold;"&gt;figure 2.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;By eroding and then dilating the image with a circle about the size of the ones above, the resulting image would be clean. In addition, the process also removes some of the smaller or overlapping pixels.&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SneOzC0sR9I/AAAAAAAAAOk/puEq5IRNJ8g/s1600-h/noise.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 256px; height: 256px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SneOzC0sR9I/AAAAAAAAAOk/puEq5IRNJ8g/s400/noise.jpg" alt="" id="BLOGGER_PHOTO_ID_5365914488617584594" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/SnePrTyEEoI/AAAAAAAAAO8/z13035M57Pc/s1600-h/c9+%282%29.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 256px; height: 256px;" src="http://3.bp.blogspot.com/_U5aA5wS7v7U/SnePrTyEEoI/AAAAAAAAAO8/z13035M57Pc/s400/c9+%282%29.jpg" alt="" id="BLOGGER_PHOTO_ID_5365915455242637954" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;span style="font-weight: bold;"&gt;figure 3.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;By cutting up figure 1 into different subimages and cleaning the them, we will obtain a set pictures containing separate circles.  Then, we can tally the area of each circle and obtain a distribution of areas. I got the following distribution for figure 1 using 11 subimages.&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm; text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SneQ4heSqmI/AAAAAAAAAPE/Onzb6J3yoqQ/s1600-h/Histogram+of+Pixel+Areas.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 271px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SneQ4heSqmI/AAAAAAAAAPE/Onzb6J3yoqQ/s400/Histogram+of+Pixel+Areas.jpg" alt="" id="BLOGGER_PHOTO_ID_5365916781767731810" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;span style="font-weight: bold;"&gt;figure 4.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;The best estimate is 496±36 pixels. The standard deviation was automatically computed by scilab by the function stdev. Judging from the histogram, the deviation appears to be a fair value. The four highest bars are within this range of the best estimate.&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="justify"&gt;&lt;br /&gt;Observe that at the extremes, the largest area is 50% larger than the smallest estimate. This range is expected. Remember that the area of a circle is πr^2. This means that the biggest cell has a radius about the sqrt of 1.5 times or 1.2 times larger than the smallest cell. Although a difference of 20% is a large value, thresholding lead to such deviations. Some subimages tended to contain smaller circles for instance, because a higher threshold value was necessary to avoid certain noise. All in all though, I am satisfied with the results. The extreme cases make up only a small portion of the distribution. About 70% of the distribution falls within one standard deviation of the mean.&lt;br /&gt;I would grade this work 10. I would like to thank Carmen for the useful insights that helped me to accomplish and finish this task.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-8013911599935398030?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/8013911599935398030/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2009/08/activity-9-binary-operations.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/8013911599935398030'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/8013911599935398030'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2009/08/activity-9-binary-operations.html' title='Activity 9 - Binary Operations'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_U5aA5wS7v7U/SneOzqQad0I/AAAAAAAAAO0/KGQYFR2c7UI/s72-c/Circles002.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-632959080820780845</id><published>2009-08-03T17:56:00.000-07:00</published><updated>2009-08-06T20:55:48.058-07:00</updated><title type='text'>Activity 8 -Morphological Operations</title><content type='html'>There are different morphological operations that are available in the SIP toolbox of scilab. These operations have different applications in image processing, some of which will be done in the next activity. In this entry, we experiment with dilate and erode on different shapes using different structuring elements.&lt;br /&gt;When a shape is dilated with a structuring element, another shape results whose values depend on the overlap between the first two shapes. In detail, we first have to choose a pixel in the structuring element to serve as reference. And then we superimpose this pixel on each location or coordinate (i,j) in the image we wish to dilate. Once the images are superimposed, we note whether there is any overlap in the white areas of the two. If there is, then the value at (i,j) in the new image is 1. Otherwise, it is zero. A similar process occurs with eroding. However, the structuring element must be completely within the image to be eroded in order for (i,j) to be 1.&lt;br /&gt;The two processes are inverses of each other. One can almost always undo the effects of one process by doing the other, provided that the structuring element is not big enough to obscure or remove certain details.&lt;br /&gt;In the following figure, the images and structuring elements are given. Guesses based on the definitions or the operations are given as well.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/SneIF9uWcOI/AAAAAAAAAOc/EQWM3fV3FZg/s1600-h/guess.JPG"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 391px; height: 400px;" src="http://3.bp.blogspot.com/_U5aA5wS7v7U/SneIF9uWcOI/AAAAAAAAAOc/EQWM3fV3FZg/s400/guess.JPG" alt="" id="BLOGGER_PHOTO_ID_5365907117084930274" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/SneHw2bkjhI/AAAAAAAAAN0/ZJoaBBurtCo/s1600-h/eroded.jpg"&gt;&lt;br /&gt;&lt;/a&gt;&lt;p&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SneIF5m5HwI/AAAAAAAAAOU/TYx8sNbVitE/s1600-h/dilated.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 351px; height: 400px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SneIF5m5HwI/AAAAAAAAAOU/TYx8sNbVitE/s400/dilated.jpg" alt="" id="BLOGGER_PHOTO_ID_5365907115979906818" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SneIFgiCOJI/AAAAAAAAAOM/jVeaa4BDY-k/s1600-h/eroded.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 351px; height: 400px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SneIFgiCOJI/AAAAAAAAAOM/jVeaa4BDY-k/s400/eroded.jpg" alt="" id="BLOGGER_PHOTO_ID_5365907109248645266" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;"&gt;&lt;span style="font-weight: normal;"&gt;My guesses match with the actual results, except that actual results are jagged in appearance due to the discrete nature of pixels. In the computation, a circle of course is not a perfect one but an approximation made up of dots that have a dimension. However, for very large shapes, a pixel may stand for a point and the actual values approach that of the theoretical guesses, assuming that they are done correctly. I also mistook the width of the cross so that my guess for erosion was partly wrong.&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0cm; font-weight: normal;"&gt;However, I am satisfied with this activity. It was actually fun and exciting because we really utilized our imagination. I grade this work 10.&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-632959080820780845?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/632959080820780845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.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/5456089935119994902/posts/default/632959080820780845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/632959080820780845'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2009/08/activity-8-morphological-operations.html' title='Activity 8 -Morphological Operations'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_U5aA5wS7v7U/SneIF9uWcOI/AAAAAAAAAOc/EQWM3fV3FZg/s72-c/guess.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-7313432191323088036</id><published>2009-07-13T20:07:00.001-07:00</published><updated>2009-08-06T20:54:45.283-07:00</updated><title type='text'>Activity 7 - Enhancement in the Frequency Domain</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/SnukRnQdM-I/AAAAAAAAARE/WI15ax-6ymA/s1600-h/weave.jpg"&gt;&lt;/a&gt;Fourier transforms are very useful in removing certain types of noise. Because Fourier space involves frequencies, patterns that repeat may be removed if a proper filter is used. In the first part of this activity, we familiarize ourselves first with the transforms of a circle and of 2 dots equidistant from the center of the y axis (the middle vertical axis) and later, replace these dots with gaussians.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;FAMILIARIZATION&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;CIRCLE r=64&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/Sl54_MYQfGI/AAAAAAAAALc/9iJ4Yn7ZLKA/s1600-h/circle+r64.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 200px;" src="http://1.bp.blogspot.com/_U5aA5wS7v7U/Sl54_MYQfGI/AAAAAAAAALc/9iJ4Yn7ZLKA/s200/circle+r64.bmp" alt="" id="BLOGGER_PHOTO_ID_5358853633667529826" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/Sl55AgOnmrI/AAAAAAAAAL8/se7W7UZnpsk/s1600-h/FTcircle+r64.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 200px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/Sl55AgOnmrI/AAAAAAAAAL8/se7W7UZnpsk/s200/FTcircle+r64.bmp" alt="" id="BLOGGER_PHOTO_ID_5358853656175680178" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;CIRCLE r=35&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/Sl55AQ21ivI/AAAAAAAAAL0/aor9tLzlUic/s1600-h/circle+r35.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 200px;" src="http://3.bp.blogspot.com/_U5aA5wS7v7U/Sl55AQ21ivI/AAAAAAAAAL0/aor9tLzlUic/s200/circle+r35.bmp" alt="" id="BLOGGER_PHOTO_ID_5358853652049398514" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/Sl54_1c5_UI/AAAAAAAAALs/s2twIR9T4yU/s1600-h/FTcircle+r35.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 200px;" src="http://1.bp.blogspot.com/_U5aA5wS7v7U/Sl54_1c5_UI/AAAAAAAAALs/s2twIR9T4yU/s200/FTcircle+r35.bmp" alt="" id="BLOGGER_PHOTO_ID_5358853644692880706" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;CIRCLE r=10&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/Sl55_PLsEqI/AAAAAAAAAMM/DgTkFJ6VQC8/s1600-h/circle+r10.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 200px;" src="http://1.bp.blogspot.com/_U5aA5wS7v7U/Sl55_PLsEqI/AAAAAAAAAMM/DgTkFJ6VQC8/s200/circle+r10.bmp" alt="" id="BLOGGER_PHOTO_ID_5358854733931745954" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/Sl55r9izsaI/AAAAAAAAAME/5Mmejh9xF3U/s1600-h/FTcircle+r10.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 200px;" src="http://3.bp.blogspot.com/_U5aA5wS7v7U/Sl55r9izsaI/AAAAAAAAAME/5Mmejh9xF3U/s200/FTcircle+r10.bmp" alt="" id="BLOGGER_PHOTO_ID_5358854402779361698" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The circles act as slits in a far-field diffraction setup. As the radius of the circle decreases, light bends further so that the diffraction pattern (the FT) increases in size, as seen above. In the case of a single dot at the center, we may anticipate the FT based on the patter above to be an entirely white image, as the diffraction "rings" spread out to infinity. This is in fact, what happens.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;CIRCLE r=0 or dot at the center&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/Sl6Ctc78o4I/AAAAAAAAAMU/RObQ7TWSTO8/s1600-h/circle.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 200px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/Sl6Ctc78o4I/AAAAAAAAAMU/RObQ7TWSTO8/s200/circle.bmp" alt="" id="BLOGGER_PHOTO_ID_5358864323990823810" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/Sl6CtVGoRxI/AAAAAAAAAMc/O99LEi4FoE4/s1600-h/FTcircle.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 200px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/Sl6CtVGoRxI/AAAAAAAAAMc/O99LEi4FoE4/s200/FTcircle.bmp" alt="" id="BLOGGER_PHOTO_ID_5358864321888143122" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2 DOTS&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U5aA5wS7v7U/Sl6DHQdSLEI/AAAAAAAAAMk/G317vA710vo/s1600-h/dots.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 200px;" src="http://4.bp.blogspot.com/_U5aA5wS7v7U/Sl6DHQdSLEI/AAAAAAAAAMk/G317vA710vo/s200/dots.bmp" alt="" id="BLOGGER_PHOTO_ID_5358864767317584962" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/Sl6DHn0fXrI/AAAAAAAAAMs/-g1U4b-0ehI/s1600-h/FTdots.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 200px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/Sl6DHn0fXrI/AAAAAAAAAMs/-g1U4b-0ehI/s200/FTdots.bmp" alt="" id="BLOGGER_PHOTO_ID_5358864773588934322" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;GAUSSIAN var=10&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U5aA5wS7v7U/Sl6Ep97IgKI/AAAAAAAAANc/AHW31oC4Yuk/s1600-h/gaussiandots+var10.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 200px;" src="http://4.bp.blogspot.com/_U5aA5wS7v7U/Sl6Ep97IgKI/AAAAAAAAANc/AHW31oC4Yuk/s200/gaussiandots+var10.bmp" alt="" id="BLOGGER_PHOTO_ID_5358866463149555874" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/Sl6EgEt9nYI/AAAAAAAAANU/YjovhaQt4_M/s1600-h/FTgaussiandots+var10.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 200px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/Sl6EgEt9nYI/AAAAAAAAANU/YjovhaQt4_M/s200/FTgaussiandots+var10.bmp" alt="" id="BLOGGER_PHOTO_ID_5358866293174672770" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;GAUSSIAN var=5&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U5aA5wS7v7U/Sl6Ef0_0rmI/AAAAAAAAANM/6tgC5fq2pOY/s1600-h/gaussiandots+var5.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 200px;" src="http://4.bp.blogspot.com/_U5aA5wS7v7U/Sl6Ef0_0rmI/AAAAAAAAANM/6tgC5fq2pOY/s200/gaussiandots+var5.bmp" alt="" id="BLOGGER_PHOTO_ID_5358866288954617442" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/Sl6EfT2BD8I/AAAAAAAAANE/wb6GWuTXMdk/s1600-h/FTgaussiandots+var5.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 200px;" src="http://3.bp.blogspot.com/_U5aA5wS7v7U/Sl6EfT2BD8I/AAAAAAAAANE/wb6GWuTXMdk/s200/FTgaussiandots+var5.bmp" alt="" id="BLOGGER_PHOTO_ID_5358866280055115714" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;GAUSSIAN var=1&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/Sl6Ee2HHADI/AAAAAAAAAM8/1Jr6EQoO29M/s1600-h/gaussiandots+var1.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 200px;" src="http://3.bp.blogspot.com/_U5aA5wS7v7U/Sl6Ee2HHADI/AAAAAAAAAM8/1Jr6EQoO29M/s200/gaussiandots+var1.bmp" alt="" id="BLOGGER_PHOTO_ID_5358866272073744434" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/Sl6EemL-yPI/AAAAAAAAAM0/aTRfaXpGdKQ/s1600-h/FTgaussiandots+var1.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 200px;" src="http://1.bp.blogspot.com/_U5aA5wS7v7U/Sl6EemL-yPI/AAAAAAAAAM0/aTRfaXpGdKQ/s200/FTgaussiandots+var1.bmp" alt="" id="BLOGGER_PHOTO_ID_5358866267799210226" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We observe that as the variance of the Gaussians decrease, the more they resemble dots. Likewise, their FTs approach the sinusoid FT of the dots.&lt;br /&gt;&lt;br /&gt;If we invert the Gaussians (1-Gaussian), we get the same modulus for the FTs. The image of the FT loks the same. If we compare the real and imaginary parts however, we find that the real parts are of opposite signs (+,-), whereas the imaginary parts are the same sign, as expected. The real part indicates the magnitude while the imaginary part pertains to phase. An inversion in magnitude in real space leads to an inversion of magnitude in Fourier space.&lt;br /&gt;&lt;br /&gt;After having noticed the different properties of the Fourier transform, it is easy to guess that the transform of a ring is a ring of sinusoid, due to the rotational property of the FT. In fact, this is what we get.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ring r=30&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SmUfQslIBWI/AAAAAAAAANk/LcuaiKXxZNE/s1600-h/co.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 200px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SmUfQslIBWI/AAAAAAAAANk/LcuaiKXxZNE/s200/co.jpg" alt="" id="BLOGGER_PHOTO_ID_5360725303159686498" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U5aA5wS7v7U/SmUfQlCiO5I/AAAAAAAAANs/cDsbm82AoAA/s1600-h/FTco.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 200px;" src="http://4.bp.blogspot.com/_U5aA5wS7v7U/SmUfQlCiO5I/AAAAAAAAANs/cDsbm82AoAA/s200/FTco.jpg" alt="" id="BLOGGER_PHOTO_ID_5360725301135555474" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Being a linear transform, Fourier Transform obeys the convolution theorem. That is, the product of two functions in one space becomes a convolution of the individual transforms in the inverse space. This allows us a convenient way of minimizing unwanted patterns that are regularly spaced. In particular, we may want to "multiply out" the pattern. We just have to find its frequency of occurrence in space. This corresponds to finding the proper spacing between two dots or Gaussians (which we will take this time as being in Fourier space). If the spacing is correct, we may convolute the FT of the image with the dots. Then, if we take the FT again, we will obtain the image multiplied by a certain sinusoid and inverted (rotated 180 degrees).&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt;APPLICATIONS IN ENHANCEMENT&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;We are now ready to apply FT to image processing using the properties that we have seen above.&lt;style type="text/css"&gt;  &lt;!--   @page { margin: 2cm }   P { margin-bottom: 0.21cm }  --&gt;&lt;/style&gt;&lt;span style="font-weight: normal;"&gt; Below, we have the original images as well as their FTs. In order to enhance or diminish certain features, we use a filter to mask unwanted frequencies. Most of the filters below are manually generated. We will be guided by the properties that we learned in the former part of this activity. Note that the images are arranged in this manner:&lt;/span&gt;&lt;p style="margin-bottom: 0cm;"&gt; &lt;/p&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;[original][modified]&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;[    FT    ][   Mask  ]&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the fingerprint, we wish to remove the blotches and enhance the contrast. Compared to the ridges, the blotches occur less frequently. In Fourier space, they contribute to the points nearer the origin. Thus, we must mask these lower frequencies. Note also that fingerprints appear a little like concentric circles. As we have learned above, the transform of concentric circles is a ring. In the FT, we see this as a faint halo. Unfortunately, the image of the fingerprint that I obtained is really small. After several modifications to the mask, this is, so far, the best that I could come up with. The reconstructed image appears like an embossed version of the original. I was not able to improve the image. :(&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/SnugdiGvI9I/AAAAAAAAAQ0/UTdrhiKwPdU/s1600-h/Moon.jpg"&gt;&lt;/a&gt;&lt;img src="http://4.bp.blogspot.com/_U5aA5wS7v7U/SnuiDM2ylHI/AAAAAAAAAQ8/XDj1PG4OG7Y/s400/my+fingerprint2.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5367061556816417906" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 172px; height: 223px; " /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U5aA5wS7v7U/SnugcvXASJI/AAAAAAAAAQc/uJVVlGr40nA/s1600-h/canvass+filter.jpg"&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SnugceJTBHI/AAAAAAAAAQU/4O61FJpMuyA/s1600-h/weave.jpg"&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After the fingerprint, we have a photo of the surface of the moon, which is a composite of several separate images. Our goal is to remove the vertical lines that occur repeatedly. This image reminds us of the two dirac deltas equally spaced from the origin along the horizontal axis. Their transform is a corrugated roof along the horizontal. By adding up corrugated roofs of different frequencies and phases, we get vertical patterns. Therefore, in the FT of the image of the moon, we obtain bright lines along the horizontal axis. In order to remove the unwanted vertical lines, we will mask the horizontal axis. From the reconstructed image, we can see that the lines were significantly reduced. However, there is some remnant because the image is tilted somewhat. This is why the bright lines get blurry as we move away from the origin.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/SnugdiGvI9I/AAAAAAAAAQ0/UTdrhiKwPdU/s1600-h/Moon.jpg"&gt;&lt;img src="http://3.bp.blogspot.com/_U5aA5wS7v7U/SnugdiGvI9I/AAAAAAAAAQ0/UTdrhiKwPdU/s400/Moon.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5367059810173789138" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 151px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SnugdSA3vvI/AAAAAAAAAQs/60erpJjZq-k/s1600-h/FTmoon.jpg"&gt;&lt;img src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SnugdSA3vvI/AAAAAAAAAQs/60erpJjZq-k/s400/FTmoon.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5367059805854220018" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 150px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Finally, we have a photo of a portion of a canvass painting. Bright patterns occur regularly throughout the image due to the surface of the canvass. From its FT, we see that bright spots occur in a regular shape about the origin. The canvass surface may be thought of as the sum corrugated roofs rotated at different angles. If we mask the frequencies that regularly occur about the origin, we will significantly reduce the repeating patterns. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://3.bp.blogspot.com/_U5aA5wS7v7U/Snugc_G6AkI/AAAAAAAAAQk/abJa8-U6a8w/s400/canvasses.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5367059800779260482" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 199px; " /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://4.bp.blogspot.com/_U5aA5wS7v7U/SnugcvXASJI/AAAAAAAAAQc/uJVVlGr40nA/s400/canvass+filter.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5367059796551813266" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 400px; height: 142px; " /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="-webkit-text-decorations-in-effect: underline; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;For the canvass, I included a grayscale version of the image because the effect is clearer. My pc cannot save the image so I got them from the imshow version, which is of rather poor quality for colored images.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If the transform of the inverse of the mask is taken, we get this. It is close in appearance to the surface of the canvass.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="-webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://1.bp.blogspot.com/_U5aA5wS7v7U/SnukRnQdM-I/AAAAAAAAARE/WI15ax-6ymA/s400/weave.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5367064003444814818" style="float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 291px; height: 210px; " /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Rating: 8. Although I accomplished all that was asked for this activity, I am frustrated with the results of the second part, especially the fingerprint. :((((&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-7313432191323088036?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/7313432191323088036/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2009/07/activity-7-enhancement-in-frequency.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/7313432191323088036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/7313432191323088036'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2009/07/activity-7-enhancement-in-frequency.html' title='Activity 7 - Enhancement in the Frequency Domain'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_U5aA5wS7v7U/Sl54_MYQfGI/AAAAAAAAALc/9iJ4Yn7ZLKA/s72-c/circle+r64.bmp' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-5300068807027230842</id><published>2009-07-09T08:36:00.001-07:00</published><updated>2009-07-09T08:36:41.313-07:00</updated><title type='text'>scilab code for activity 6</title><content type='html'>x=-127:1:127; //middle at 0&lt;br /&gt;[X,Y] = meshgrid(x);&lt;br /&gt;sqr=zeros(size(X,1), size(X,2));&lt;br /&gt;for i=-64:1:64&lt;br /&gt; for j=-64:1:64&lt;br /&gt;  sqr(i+127,j+127)=1;&lt;br /&gt; end&lt;br /&gt;end&lt;br /&gt;imwrite(sqr,'C:\Users\Mandee\Documents\Acads\2009-2010 1st sem\AP 186\Activity 6\sqr.bmp')&lt;br /&gt;FTsqr=fftshift(abs(fft2(sqr)));FTsqr=FTsqr/max(FTsqr);&lt;br /&gt;imwrite(FTsqr,'C:\Users\Mandee\Documents\Acads\2009-2010 1st sem\AP 186\Activity 6\FTsqr.bmp')&lt;br /&gt;&lt;br /&gt;annulus=zeros(size(X,1), size(X,2));&lt;br /&gt;r = sqrt(X.^2 + Y.^2);&lt;br /&gt;annulus(find (r&lt;=64)) = 1;&lt;br /&gt;annulus(find (r&lt;=32))=0;&lt;br /&gt;imwrite(annulus,'C:\Users\Mandee\Documents\Acads\2009-2010 1st sem\AP 186\Activity 6\annulus.bmp')&lt;br /&gt;FTannulus=fftshift(abs(fft2(annulus)));FTannulus=FTannulus/max(FTannulus);&lt;br /&gt;imwrite(FTannulus,'C:\Users\Mandee\Documents\Acads\2009-2010 1st sem\AP 186\Activity 6\FTannulus.bmp')&lt;br /&gt;&lt;br /&gt;sqrannulus=sqr;&lt;br /&gt;for i=-32:1:32&lt;br /&gt; for j=-32:1:32&lt;br /&gt;  sqrannulus(i+127,j+127)=0;&lt;br /&gt; end&lt;br /&gt;end&lt;br /&gt;imwrite(sqrannulus,'C:\Users\Mandee\Documents\Acads\2009-2010 1st sem\AP 186\Activity 6\sqrannulus.bmp')&lt;br /&gt;FTsqrannulus=fftshift(abs(fft2(sqrannulus)));FTsqrannulus=FTsqrannulus/max(FTsqrannulus);&lt;br /&gt;imwrite(FTsqrannulus,'C:\Users\Mandee\Documents\Acads\2009-2010 1st sem\AP 186\Activity 6\FTsqrannulus.bmp')&lt;br /&gt;//imshow(circle,[]);&lt;br /&gt;&lt;br /&gt;slits=zeros(size(X,1),size(X,2));&lt;br /&gt;for i=1:1:length(x)&lt;br /&gt; slits(i,-3+127)=1;&lt;br /&gt; slits(i,3+127)=1;&lt;br /&gt;end&lt;br /&gt;imwrite(slits,'C:\Users\Mandee\Documents\Acads\2009-2010 1st sem\AP 186\Activity 6\slits.bmp')&lt;br /&gt;FTslits=fftshift(abs(fft2(slits)));FTslits=FTslits/max(FTslits);&lt;br /&gt;imwrite(FTslits,'C:\Users\Mandee\Documents\Acads\2009-2010 1st sem\AP 186\Activity 6\FTslits.bmp')&lt;br /&gt;&lt;br /&gt;dots=zeros(size(X,1),size(X,2));&lt;br /&gt;dots(0+127,5+127)=1;&lt;br /&gt;dots(0+127,-5+127)=1;&lt;br /&gt;imwrite(dots,'C:\Users\Mandee\Documents\Acads\2009-2010 1st sem\AP 186\Activity 6\dots.bmp')&lt;br /&gt;FTdots=fftshift(abs(fft2(dots)));&lt;br /&gt;imwrite(FTdots,'C:\Users\Mandee\Documents\Acads\2009-2010 1st sem\AP 186\Activity 6\FTdots.bmp')&lt;br /&gt;&lt;br /&gt;nx = 255;&lt;br /&gt;x = linspace(-100,100,nx);&lt;br /&gt;[Y,X] = ndgrid(x,x);//y for row, x for column&lt;br /&gt;f = 5; //frequency – you may change this later.&lt;br /&gt;sine = sin(2*%pi*f*X)/2;&lt;br /&gt;imwrite(sine,'C:\Users\Mandee\Documents\Acads\2009-2010 1st sem\AP 186\Activity 6\sine.bmp')&lt;br /&gt;sine2 = sin(2*%pi*f*2*X)/2;&lt;br /&gt;imwrite(sine2,'C:\Users\Mandee\Documents\Acads\2009-2010 1st sem\AP 186\Activity 6\sine2.bmp')&lt;br /&gt;sinebias=sine/2-min(sine)/2;&lt;br /&gt;imwrite(sinebias,'C:\Users\Mandee\Documents\Acads\2009-2010 1st sem\AP 186\Activity 6\sinebias.bmp')&lt;br /&gt;//imshow(z2,[]);&lt;br /&gt;&lt;br /&gt;FTsine=fftshift(abs(fft2(sine)));FTsine=FTsine/max(FTsine);&lt;br /&gt;imwrite(FTsine,'C:\Users\Mandee\Documents\Acads\2009-2010 1st sem\AP 186\Activity 6\FTsine.bmp')&lt;br /&gt;FTsine2=fftshift(abs(fft2(sine2)));FTsine2=FTsine2/max(FTsine2);&lt;br /&gt;imwrite(FTsine2,'C:\Users\Mandee\Documents\Acads\2009-2010 1st sem\AP 186\Activity 6\FTsine2.bmp')&lt;br /&gt;FTsinebias=fftshift(abs(fft2(sinebias)));FTsinebias=FTsinebias/max(FTsinebias);&lt;br /&gt;imwrite(FTsinebias,'C:\Users\Mandee\Documents\Acads\2009-2010 1st sem\AP 186\Activity 6\FTsinebias.bmp')&lt;br /&gt;&lt;br /&gt;theta=%pi/4;&lt;br /&gt;sinerotated=sin(2*%pi*f/3*(Y*sin(theta) + X*cos(theta)));&lt;br /&gt;imwrite(sinerotated,'C:\Users\Mandee\Documents\Acads\2009-2010 1st sem\AP 186\Activity 6\sinerotated.bmp')&lt;br /&gt;FTsinerotated=fftshift(abs(fft2(sinerotated)));FTsinerotated=FTsinerotated/max(FTsinerotated);&lt;br /&gt;imwrite(FTsinerotated,'C:\Users\Mandee\Documents\Acads\2009-2010 1st sem\AP 186\Activity 6\FTsinerotated.bmp')&lt;br /&gt;&lt;br /&gt;manysines=sinerotated+sin(2*%pi*f/6*(Y*sin(theta) + X*cos(theta)))+sin(2*%pi*f/6*(Y*sin(%pi/2) + X*cos(%pi/2)))+sin(2*%pi*f/6*(Y*sin(3*%pi/4) + X*cos(3*%pi/4)));&lt;br /&gt;imwrite(manysines,'C:\Users\Mandee\Documents\Acads\2009-2010 1st sem\AP 186\Activity 6\manysines.bmp')&lt;br /&gt;FTmanysines=fftshift(abs(fft2(manysines)));FTmanysines=FTmanysines/max(FTmanysines);&lt;br /&gt;imwrite(FTmanysines,'C:\Users\Mandee\Documents\Acads\2009-2010 1st sem\AP 186\Activity 6\FTmanysines.bmp')&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-5300068807027230842?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/5300068807027230842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2009/07/scilab-code-for-activity-6.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/5300068807027230842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/5300068807027230842'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2009/07/scilab-code-for-activity-6.html' title='scilab code for activity 6'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-8286390030350110660</id><published>2009-07-08T17:56:00.000-07:00</published><updated>2009-07-20T18:29:25.572-07:00</updated><title type='text'>Activity 6 - Properties of the 2D Fourier Transform</title><content type='html'>Oftentimes, we obtain data that is a function of time. There are many ways to make sense of the data and interpret possible results. The Fourier Tranform (FT) is very useful as it would give the spatial frequencies of the sinusoids that add up to create our signal. Here, we familiarize ourselves with the properties of the 2D FT.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Part A. FT of Different 2D Patterns&lt;/span&gt;&lt;br /&gt;Let us take the FT of the following shapes.&lt;br /&gt;Note that in imshow, brightness can only vary from 0-1. We have to normalize the FTs first before we attempt to see how they look like. Otherwise, the images would saturate and the resulting patterns, although beautiful, will not make much sense to us.&lt;br /&gt;&lt;br /&gt;a.  square&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SlVgjfG9lvI/AAAAAAAAAGk/wAlhHaXSF0I/s1600-h/sqr.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 255px; height: 255px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SlVgjfG9lvI/AAAAAAAAAGk/wAlhHaXSF0I/s320/sqr.bmp" alt="" id="BLOGGER_PHOTO_ID_5356293494589462258" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/SlYEfmAKEjI/AAAAAAAAAIE/W7xgZMf5qls/s1600-h/FTsqr.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 255px; height: 255px;" src="http://1.bp.blogspot.com/_U5aA5wS7v7U/SlYEfmAKEjI/AAAAAAAAAIE/W7xgZMf5qls/s320/FTsqr.bmp" alt="" id="BLOGGER_PHOTO_ID_5356473747627446834" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;b.  annulus (doughnut)&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SlVg63tLIFI/AAAAAAAAAG0/CckffRKXZWU/s1600-h/annulus.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 255px; height: 255px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SlVg63tLIFI/AAAAAAAAAG0/CckffRKXZWU/s320/annulus.bmp" alt="" id="BLOGGER_PHOTO_ID_5356293896329175122" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/SlYEtpTUFOI/AAAAAAAAAIM/UpZCShy3yBc/s1600-h/FTannulus.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 255px; height: 255px;" src="http://3.bp.blogspot.com/_U5aA5wS7v7U/SlYEtpTUFOI/AAAAAAAAAIM/UpZCShy3yBc/s320/FTannulus.bmp" alt="" id="BLOGGER_PHOTO_ID_5356473989031269602" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;c.  square annulus&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SlVhPt4ctTI/AAAAAAAAAHE/TdPUl17Gfsc/s1600-h/sqrannulus.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 255px; height: 255px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SlVhPt4ctTI/AAAAAAAAAHE/TdPUl17Gfsc/s320/sqrannulus.bmp" alt="" id="BLOGGER_PHOTO_ID_5356294254469362994" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/SlYE_hgun1I/AAAAAAAAAIU/qytvf3dE85Q/s1600-h/FTsqrannulus.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 255px; height: 255px;" src="http://1.bp.blogspot.com/_U5aA5wS7v7U/SlYE_hgun1I/AAAAAAAAAIU/qytvf3dE85Q/s320/FTsqrannulus.bmp" alt="" id="BLOGGER_PHOTO_ID_5356474296177696594" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;d.  2 slits along the center of the x-axis spanning the entire y-axis&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/SlVhfT7OASI/AAAAAAAAAHU/z-gu0Gr7qZs/s1600-h/slits.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 255px; height: 255px;" src="http://3.bp.blogspot.com/_U5aA5wS7v7U/SlVhfT7OASI/AAAAAAAAAHU/z-gu0Gr7qZs/s320/slits.bmp" alt="" id="BLOGGER_PHOTO_ID_5356294522379567394" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U5aA5wS7v7U/SlYFQuqdTUI/AAAAAAAAAIc/B4pkT3EvidA/s1600-h/FTslits.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 255px; height: 255px;" src="http://4.bp.blogspot.com/_U5aA5wS7v7U/SlYFQuqdTUI/AAAAAAAAAIc/B4pkT3EvidA/s320/FTslits.bmp" alt="" id="BLOGGER_PHOTO_ID_5356474591765941570" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;e. 2 dots along the x-axis symmetric about the center&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SlVhztacevI/AAAAAAAAAHk/A2ZIV9CZLow/s1600-h/dots.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 255px; height: 255px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SlVhztacevI/AAAAAAAAAHk/A2ZIV9CZLow/s320/dots.bmp" alt="" id="BLOGGER_PHOTO_ID_5356294872818809586" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/SlYFf755u5I/AAAAAAAAAIk/0sqXaEgR798/s1600-h/FTdots.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 255px; height: 255px;" src="http://1.bp.blogspot.com/_U5aA5wS7v7U/SlYFf755u5I/AAAAAAAAAIk/0sqXaEgR798/s320/FTdots.bmp" alt="" id="BLOGGER_PHOTO_ID_5356474853018418066" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;All the results above agree with experimental data. The FTs correspond to the interference patterns obtained when light is made to pass slits of the above shape, provided that the screen is considerably far from the slits. In the FT for the 2 dots, we get a sinusoid. We may think of the 2 dots as dirac deltas that pertain to the frequency of a sinusoid (since they are symmetric)so that when we get the FT instead of the inverse FT, we obtain a sinusoid although inverted, as we learned from the previous post.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Part B. Anamorphic Property of the Fourier Transform&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Let us take the 2D FT of a sinusoid running along the x-axis. Then observe what happens as we rotate the sinusoid at different angles with respect to the x-axis.&lt;br /&gt;&lt;br /&gt;As we can see below, the transform agrees with what is expected for a 1-D data. We find 2 dirac deltas about the positive and negative of the frequency (5 Hertz) of the sinusoid.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/SlYF6jx2jII/AAAAAAAAAIs/EKf80JL1ZJo/s1600-h/sine.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 255px; height: 255px;" src="http://1.bp.blogspot.com/_U5aA5wS7v7U/SlYF6jx2jII/AAAAAAAAAIs/EKf80JL1ZJo/s320/sine.bmp" alt="" id="BLOGGER_PHOTO_ID_5356475310398672002" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U5aA5wS7v7U/SlYF64v4TJI/AAAAAAAAAI0/WSr2Otb_-lY/s1600-h/FTsine.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 255px; height: 255px;" src="http://4.bp.blogspot.com/_U5aA5wS7v7U/SlYF64v4TJI/AAAAAAAAAI0/WSr2Otb_-lY/s320/FTsine.bmp" alt="" id="BLOGGER_PHOTO_ID_5356475316027542674" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If we change the frequency, for instance increase it, the distance between the two dots increases as well. Below, the frequency was doubled to 10 hertz. The distance between the dots also doubled.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/SlYRcl7cjjI/AAAAAAAAAJ0/UnJYV3uOIXA/s1600-h/sine2.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 255px; height: 255px;" src="http://3.bp.blogspot.com/_U5aA5wS7v7U/SlYRcl7cjjI/AAAAAAAAAJ0/UnJYV3uOIXA/s320/sine2.bmp" alt="" id="BLOGGER_PHOTO_ID_5356487989719240242" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SlYRcYYMxzI/AAAAAAAAAJs/6mBEttyHVL4/s1600-h/FTsine2.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 255px; height: 255px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SlYRcYYMxzI/AAAAAAAAAJs/6mBEttyHVL4/s320/FTsine2.bmp" alt="" id="BLOGGER_PHOTO_ID_5356487986081744690" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In this next set, a constant bias was added. In the FT, it appears as a Dirac Delta at the origin. This is the expected transform of a constant. In most cases in the real world, there is a constant bias whose contribution we wish to ignore. In the FT, we can simply disregard the Dirac Delta at the origin. In cases where a very low frequency signal has meddled with our data, we can remove its contribution by ignoring the dirac deltas near the origin.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/SlYF7CTAjxI/AAAAAAAAAI8/WH6-3El1xJI/s1600-h/sinebias.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 255px; height: 255px;" src="http://1.bp.blogspot.com/_U5aA5wS7v7U/SlYF7CTAjxI/AAAAAAAAAI8/WH6-3El1xJI/s320/sinebias.bmp" alt="" id="BLOGGER_PHOTO_ID_5356475318590803730" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/SlYF7VbbSPI/AAAAAAAAAJE/0r0Glqm0ORc/s1600-h/FTsinebias.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 255px; height: 255px;" src="http://1.bp.blogspot.com/_U5aA5wS7v7U/SlYF7VbbSPI/AAAAAAAAAJE/0r0Glqm0ORc/s320/FTsinebias.bmp" alt="" id="BLOGGER_PHOTO_ID_5356475323726383346" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If we rotate the sinusoid 45 degrees about the x-axis, the FT will rotate as well.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SlYIsZ_gpDI/AAAAAAAAAJU/d3ej3Cc6beQ/s1600-h/sinerotated.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 255px; height: 255px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SlYIsZ_gpDI/AAAAAAAAAJU/d3ej3Cc6beQ/s320/sinerotated.bmp" alt="" id="BLOGGER_PHOTO_ID_5356478365788316722" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SlYIsRnQCVI/AAAAAAAAAJM/CF_udB_vDD4/s1600-h/FTsinerotated.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 255px; height: 255px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SlYIsRnQCVI/AAAAAAAAAJM/CF_udB_vDD4/s320/FTsinerotated.bmp" alt="" id="BLOGGER_PHOTO_ID_5356478363539081554" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Finally, we can add other sinusoids rotated at different angles. Below, we have contributed functions rotated 90 degrees and 135 degrees, in addition to the above. The FT now contains three pairs of dirac deltas corresponding to the frequencies of the individual sinusoids, as expected.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/SlYJogyiiSI/AAAAAAAAAJk/JPChlcA0idM/s1600-h/manysines.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 255px; height: 255px;" src="http://1.bp.blogspot.com/_U5aA5wS7v7U/SlYJogyiiSI/AAAAAAAAAJk/JPChlcA0idM/s320/manysines.bmp" alt="" id="BLOGGER_PHOTO_ID_5356479398405114146" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SlYJoZ7YsOI/AAAAAAAAAJc/t3ZUWpsPHt4/s1600-h/FTmanysines.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 255px; height: 255px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SlYJoZ7YsOI/AAAAAAAAAJc/t3ZUWpsPHt4/s320/FTmanysines.bmp" alt="" id="BLOGGER_PHOTO_ID_5356479396563169506" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I grade myself 10 for completely understanding the activity and for obtaining results that agree with expectations.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-8286390030350110660?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/8286390030350110660/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.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/5456089935119994902/posts/default/8286390030350110660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/8286390030350110660'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2009/07/activity-6-properties-of-2d-fourier.html' title='Activity 6 - Properties of the 2D Fourier Transform'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_U5aA5wS7v7U/SlVgjfG9lvI/AAAAAAAAAGk/wAlhHaXSF0I/s72-c/sqr.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-8029620171381891340</id><published>2009-07-06T21:56:00.001-07:00</published><updated>2009-07-20T18:30:24.273-07:00</updated><title type='text'>Activity 5 Fourier Transform and Model of Image Transformation</title><content type='html'>Fourier transform has many applications, including image processing. Many of the effects that we make use in photo editing actually depend on it! Being a linear transform, fourier transform follows the convolution theorem.&lt;br /&gt;&lt;br /&gt;FAMILIARIZATION&lt;br /&gt;Fourier transforms are integral transforms. We obtain the exact transform of a function if we know its analytic form. In the real world, however, we deal with discrete signals which usually cannot be described by simple equations containing a finite number of terms. A discrete form of the transform must be used. We implement the fast fourier transform or FFT for a few simple images.&lt;br /&gt;&lt;br /&gt;When we obtain the FFT of a simple shape, such as a circle, we obtain the expected analytic transform but with the four quadrants inverted about the origin. We see bright “quarters of a spot” at each corner. This is simply due to the nature of the implementation of the FFT. We need to use fftshift so that the quadrants will be reinverted. When we do so, we will get a bright spot in the middle with a little fringes. The same thing happens to an “A” shape, except that the transform is somewhat squarish.&lt;br /&gt;If we implement FFT on an image twice, the image will be inverted.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U5aA5wS7v7U/SlLZdWsmqeI/AAAAAAAAAF0/_8gGkW_-L9I/s1600-h/circle.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 92px;" src="http://4.bp.blogspot.com/_U5aA5wS7v7U/SlLZdWsmqeI/AAAAAAAAAF0/_8gGkW_-L9I/s320/circle.jpg" alt="" id="BLOGGER_PHOTO_ID_5355582005229038050" border="0" /&gt;&lt;/a&gt; The white spots at the corners are not obvious because they are small. They are noticable only after fftshift put them together at the center.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/SlLW56RfXyI/AAAAAAAAAFk/Nuy0hUIH5RY/s1600-h/A.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 128px; height: 128px;" src="http://3.bp.blogspot.com/_U5aA5wS7v7U/SlLW56RfXyI/AAAAAAAAAFk/Nuy0hUIH5RY/s320/A.bmp" alt="" id="BLOGGER_PHOTO_ID_5355579197280444194" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U5aA5wS7v7U/SlLXM4lI1NI/AAAAAAAAAFs/vktXYWaf940/s1600-h/A+-+Copy.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 128px; height: 128px;" src="http://4.bp.blogspot.com/_U5aA5wS7v7U/SlLXM4lI1NI/AAAAAAAAAFs/vktXYWaf940/s320/A+-+Copy.bmp" alt="" id="BLOGGER_PHOTO_ID_5355579523243496658" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SIMULATION OF AN IMAGING DEVICE&lt;br /&gt;A lens may be thought of as a fourier transform. The quality of an image depends on qualities of the lens, such as the size of the aperture. Assuming that we have scratchfree, smooth lens, we may model it as a white circle at the center of a black background. The lens as a transfer function of the system, will simply be multiplied point by point to the transform of the image we wish to capture, by the convolution theorem. However, we have to fftshift the lens so that it would match with the quadrants of the transform of the image. Then we will obtain the inverse fourier transform of the product. Note that we may simply obtain the FFT of the product. However, the image will have to be rotated 180 degrees in order for it to be upright.&lt;br /&gt;&lt;br /&gt;By playing around with the lens aperture (radius of white circle), we see below that the bigger size is desired to minimize distortions. With smaller aperture, the image gets blurry. Of course, if the circle covers the entire “window” such that the lens is all white, we will get no distortion at all. Mathematically, this is equivalent to convolving the original image with a dirac delta.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/SlLZ3ucCSFI/AAAAAAAAAF8/lF2_S2eGg6g/s1600-h/images.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 103px;" src="http://1.bp.blogspot.com/_U5aA5wS7v7U/SlLZ3ucCSFI/AAAAAAAAAF8/lF2_S2eGg6g/s320/images.jpg" alt="" id="BLOGGER_PHOTO_ID_5355582458278594642" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;TEMPLATE MATCHING USING CORRELATION&lt;br /&gt;Correlation may be used to find exact, or at least, close matches to a certain image. Mathematically, it is similar to convolution, except that when working in fourier space, we multiply the complex conjugate of one transform with the unconjugated transform of the other. We will obtain high values whenever there is a close match, an overlap between a certain shape in one image and in another. For example, if we obtain the correlation of the text below, with the letter A, values will be high (brightness=1) at a certain x and y where the As are found.In the other letters, there would still be some correlation, although it would not be as well defined as the correlation with As.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U5aA5wS7v7U/SlLoiErvxFI/AAAAAAAAAGc/B3K-rjpPevA/s1600-h/TEXT.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 128px; height: 128px;" src="http://4.bp.blogspot.com/_U5aA5wS7v7U/SlLoiErvxFI/AAAAAAAAAGc/B3K-rjpPevA/s320/TEXT.bmp" alt="" id="BLOGGER_PHOTO_ID_5355598578967364690" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U5aA5wS7v7U/SlLobqKdxzI/AAAAAAAAAGU/n_K3DfvG9g8/s1600-h/template.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 128px; height: 128px;" src="http://4.bp.blogspot.com/_U5aA5wS7v7U/SlLobqKdxzI/AAAAAAAAAGU/n_K3DfvG9g8/s320/template.bmp" alt="" id="BLOGGER_PHOTO_ID_5355598468769236786" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/SlLoTGgi-TI/AAAAAAAAAGM/n682cW-34G8/s1600-h/correlation.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 127px; height: 127px;" src="http://3.bp.blogspot.com/_U5aA5wS7v7U/SlLoTGgi-TI/AAAAAAAAAGM/n682cW-34G8/s320/correlation.jpg" alt="" id="BLOGGER_PHOTO_ID_5355598321759222066" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;EDGE DETECTION USING THE CONVOLUTOIN INTEGRAL&lt;br /&gt;We may convolve an image with a matrix that ressembles an edge. At locations where edges are present, the convolution will be high (brightness=1). We may change the appearance of the edge that we wish to detect. For instance:&lt;br /&gt;-1 -1 -1    is the matrix for a horizontal edge&lt;br /&gt;2  2  2&lt;br /&gt;-1 -1 -1&lt;br /&gt;&lt;br /&gt;-1  2 -1    is the matrix for a vertical edge&lt;br /&gt;-1  2 -1&lt;br /&gt;-1  2 -1&lt;br /&gt;&lt;br /&gt;2 -1 -1    is the matrix for a diagonal edge&lt;br /&gt;-1  2 -1&lt;br /&gt;-1 -1  2&lt;br /&gt;&lt;br /&gt;-1 -1  2     is the matrix for a diagonal edge&lt;br /&gt;-1  2 -1&lt;br /&gt;2 -1 -1&lt;br /&gt;&lt;br /&gt;We may use other patterns, but we have to make sure that the matrix elements add up to zero in scilab. We may also use a larger n by n matrix, where n is odd, to simulate more complicated patterns, although it would be tedious to try to copy a pattern onto the matrix. Below are the resulting images after convolving the image VIP with a horizontal edge, vertical edge, diagonal edges, point pattern, and a “lower right” point pattern. By the way, I used the following matrices for the latter 2 cases:&lt;br /&gt;-1 -1 -1&lt;br /&gt;-1  8 -1&lt;br /&gt;-1 -1 -1&lt;br /&gt;&lt;br /&gt;-1 -1 -1&lt;br /&gt;-1 -1 -1&lt;br /&gt;-1 -1  8&lt;br /&gt;&lt;br /&gt;As we can see in the images, edges that resemble the matrix used have high values. For instance, horizontal edges are indeed highlighted when correlated with the corresponding matrix. Diagonal edges, which contain a little of the horizontal, are a little visible as well  whereas vertical edges are ignored.&lt;br /&gt;In the point patterns, all edges where properly highlighted. Each highlighted point indeed traces out the edge. As for the “lower right” point, all edges are lightly traced, but at points that indeed fall lower right to some pixel, the correlation is high and the pixel is bright.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/SlLad-OzQII/AAAAAAAAAGE/A-nTUPoiWvM/s1600-h/edge.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 210px; height: 320px;" src="http://3.bp.blogspot.com/_U5aA5wS7v7U/SlLad-OzQII/AAAAAAAAAGE/A-nTUPoiWvM/s320/edge.jpg" alt="" id="BLOGGER_PHOTO_ID_5355583115353079938" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I grade my work 10 for completing the activity properly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-8029620171381891340?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/8029620171381891340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2009/07/activity-5.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/8029620171381891340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/8029620171381891340'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2009/07/activity-5.html' title='Activity 5 Fourier Transform and Model of Image Transformation'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_U5aA5wS7v7U/SlLZdWsmqeI/AAAAAAAAAF0/_8gGkW_-L9I/s72-c/circle.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-5538153863426241496</id><published>2009-06-29T18:07:00.000-07:00</published><updated>2009-07-20T18:32:55.682-07:00</updated><title type='text'>Activity  4 - Enhancement by Histogram Manipulation</title><content type='html'>Contrast is an important characteristic of images. It enables us to distinguish details. However, conditions may not be optimized to meet the desired contrast. It is often necessary to digitally process images to enhance its appearance.&lt;br /&gt;&lt;br /&gt;In this entry, we show how contrast may be improved with the aid of the CDF or cummulative distribution function. We need the histogram of a grayscale image. This histogram simply shows the number of pixels that have a certain brightness value. (If the histogram is normalized, it pertains to the fraction of the total number of pixels.) The histogram of images with good contrast is well spread throughout the scale. Generally, contrast decreases when the histogram range decreases.&lt;br /&gt;&lt;br /&gt;The CDF of a particular brightness value is simply the cummulative of the histogram from 0 up to that value. Enhancement may be achieved by trying to conform the CDF to a particular shape. For example, let us pick a brightness value and note the corresponding CDF value from the original image. Then let us look at the desired CDF shape and find the CDF value we obtained earlier. We note the brightness value where that CDF value occurs. Then, we replace all pixels with the original brightness value with this new brightness value. If we do this for the entire CDF of the original image, the new image may look drastically different.&lt;br /&gt;&lt;br /&gt;Below is an example of a low contrast image together with its histogram and CDF. In the succeeding plots, we try to achieve a linear CDF and then a sigmoid CDF. And then, we have a third enhancement which does not make use of CDF. In this case, we simply scaled the histogram so that it occupies the entire range available.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/SlAtXb2xJ_I/AAAAAAAAAFM/E65zelReUe8/s1600-h/plots.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 282px;" src="http://1.bp.blogspot.com/_U5aA5wS7v7U/SlAtXb2xJ_I/AAAAAAAAAFM/E65zelReUe8/s320/plots.bmp" alt="" id="BLOGGER_PHOTO_ID_5354829837581232114" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SlAtxpZZuYI/AAAAAAAAAFU/mX0vWPdYp3Y/s1600-h/plots2.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 279px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SlAtxpZZuYI/AAAAAAAAAFU/mX0vWPdYp3Y/s320/plots2.bmp" alt="" id="BLOGGER_PHOTO_ID_5354830287892756866" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/SlAuXMOAx0I/AAAAAAAAAFc/DuiGX8ahLTY/s1600-h/comparison+of+pictures.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 172px;" src="http://3.bp.blogspot.com/_U5aA5wS7v7U/SlAuXMOAx0I/AAAAAAAAAFc/DuiGX8ahLTY/s320/comparison+of+pictures.jpg" alt="" id="BLOGGER_PHOTO_ID_5354830932895385410" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;As we can see, the success of CDF enhancement depends upon the desired shape and on the original histogram. If the original histogram has prominent peaks and troughs, CDF enhancement may produce a high contrast but dirty image. In this blog, the image had a good shape for the histogram since it did not have large “valleys.” It worked fairly well with the  second CDF enhancement, wherein we tried to obtain a linear CDF, although the image appears too bright. The sigmoid CDF did not work well for the image. Isolated parts were preferentially contrasted over others. On the other hand, plain scaling worked well. This is usually the mode by which desired contrast is achieved.&lt;br /&gt;&lt;br /&gt;So far we have worked with in plain grayscale. However, this can be extended to work with colored images. We may work with the histogram of each color channel, RGB or CMYK, and enhance them separately .Then they can be put together to obtain the desired contrast.&lt;br /&gt;&lt;br /&gt;I rate this entry 10 for completing the activity and successfully backprojecting, which was the tricky part in my opinion.&lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;[mat]=imread('C:\Users\Mandee\Documents\Acads\2009-2010 1st sem\AP 186\Activity 4\lowcontrast - gray.jpg');//('F:\AP 186\Activity 4\lowcontrast - gray.JPG');&lt;br /&gt;//xbasc();//to clear image window&lt;br /&gt;gray=(mat(:,:,1)+mat(:,:,2)+mat(:,:,3))/3;  //averaging grays from RGB channels&lt;br /&gt;gray=int(255*gray); //easier to work with whole numbers!&lt;br /&gt;                   //multiplying by 255 will not automatically result to a whole number since the values are averages&lt;br /&gt;n=size(gray);&lt;br /&gt;&lt;br /&gt;trial=gray;&lt;br /&gt;darkest=min(trial);&lt;br /&gt;brightest=max(trial);&lt;br /&gt;middle=(darkest+brightest)/2;&lt;br /&gt;for i=1:1:n(1)*n(2)&lt;br /&gt; old=trial(i);//enhanced image&lt;br /&gt; new=(old-darkest)*255/(brightest-darkest);//to enhance contrast pixel by pixel such that the histogram spreads out proportionally throughout the 256 scales&lt;br /&gt; new=int(new);&lt;br /&gt; trial(i)=new;&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;//Histogram of original image and trial image&lt;br /&gt;grays=0:1:255;&lt;br /&gt;for i=grays&lt;br /&gt;[a,b]=find(gray==i);&lt;br /&gt;[c,d]=find(trial==i);&lt;br /&gt;num1(i+1)=length(a);&lt;br /&gt;num2(i+1)=length(c);&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;//CDF of original image and trial image&lt;br /&gt;CDFa=cumsum(num1);&lt;br /&gt;CDFb=cumsum(num2);&lt;br /&gt;&lt;br /&gt;//analytic form of different CDFs&lt;br /&gt;CDFlinear=n(1)*n(2)*grays/256;&lt;br /&gt;CDFsigmoid=(tanh((grays-128)/50)+1)*n(1)*n(2)/2;&lt;br /&gt;&lt;br /&gt;ENHANCED=(gray);&lt;br /&gt;//CDF enhancement&lt;br /&gt;for i=1:1:256&lt;br /&gt; workingCDF=CDFa(i);&lt;br /&gt; a=find(gray==i-1);&lt;br /&gt; c=find(trial==i-1);&lt;br /&gt; newpixelL=workingCDF*256/n(1)/n(2);//linear&lt;br /&gt; newpixelS=50*(atanh(2*workingCDF/n(1)/n(2))-.999)+128;//sigmoid&lt;br /&gt; for j=[a]&lt;br /&gt;   ENHANCED(j)=int(newpixelS);//change this to correspond to desired CDF&lt;br /&gt; end                            //convert to integer to follow 256 scale&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;//histogram of CDF enhanced images&lt;br /&gt;for i=grays&lt;br /&gt;[a,b]=find(ENHANCED==i);&lt;br /&gt;num11(i+1)=length(a);&lt;br /&gt;end&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-5538153863426241496?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/5538153863426241496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2009/06/activity-4-enhancement-by-histogram.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/5538153863426241496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/5538153863426241496'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2009/06/activity-4-enhancement-by-histogram.html' title='Activity  4 - Enhancement by Histogram Manipulation'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_U5aA5wS7v7U/SlAtXb2xJ_I/AAAAAAAAAFM/E65zelReUe8/s72-c/plots.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-8991745380205193632</id><published>2009-06-22T20:02:00.000-07:00</published><updated>2009-07-01T18:35:06.292-07:00</updated><title type='text'>Activity 3 - Image Types and Basic Image Enhancement</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SkwHwad6QhI/AAAAAAAAAE0/7KKIK-jLKVc/s1600-h/01heat+of+fusion.bmp"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 204px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SkwHwad6QhI/AAAAAAAAAE0/7KKIK-jLKVc/s320/01heat+of+fusion.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5353662585356567058" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Images may be classified into four types based on color information. The simplest type is a binary image. It is basically a black and white photo. On the left is an example of such an image. Each pixel is only one bit long, being only either 0 or 1.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/SkwKKuVIeYI/AAAAAAAAAFE/9-X7eV8Qd0s/s1600-h/fsSPAW407.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 194px; height: 320px;" src="http://1.bp.blogspot.com/_U5aA5wS7v7U/SkwKKuVIeYI/AAAAAAAAAFE/9-X7eV8Qd0s/s320/fsSPAW407.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5353665236388313474" /&gt;&lt;/a&gt;&lt;br /&gt;A slightly more complicated type is a greyscale image. (image at the left taken from http://www.detroitpubliclibrary.org/SPAW%20web%20site/spaw3.10.html) Instead of plain black and white pixels, there are 254 different shades of grey in addition to black and white, for a total of 256 brightness levels. No color information is available. In binary language then, 256 unique combinations are possible for 8 bits of data. In other words, this image has a bit depth of 8.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/SkJbIczjl0I/AAAAAAAAADk/dHO1nExpwWE/s1600-h/3truecolor.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 226px; height: 320px;" src="http://1.bp.blogspot.com/_U5aA5wS7v7U/SkJbIczjl0I/AAAAAAAAADk/dHO1nExpwWE/s320/3truecolor.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5350939507999086402" /&gt;&lt;/a&gt;&lt;br /&gt;The most common type is the truecolor image. The picture shown has a bit depth of 24. 2^24 or about 16.8 million colors may be represented.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SkwIA5EkFRI/AAAAAAAAAE8/xXmy6kPkDFI/s1600-h/04.bmp"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SkwIA5EkFRI/AAAAAAAAAE8/xXmy6kPkDFI/s320/04.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5353662868449662226" /&gt;&lt;/a&gt;&lt;br /&gt;Finally, an image may be classified as indexed. A set of a limited number of colors are assigned a number or an index. The value of each pixel, then, pertains to a particular color. This is picture is a 256 color image. Like the grayscale image above, it has a bit depth of 8. The loss of detail is compensated by the available color information. Due to the smaller bit depth of indexed image, we can see that images made up of few or simpler colors are best saved as an indexed image to save space.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We can obtain the area of a particular figure if it is well separated from the background. In this activity, I did not use the above picture since&lt;br /&gt;the subject is not well separated from the background. If we use the grayscale of the above picture and obtain its histogram, we will get the&lt;br /&gt;following distribution. &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SkjRRqjhyLI/AAAAAAAAAEM/B_CS9ehCxF4/s1600-h/Greyscale+histogram.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 210px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SkjRRqjhyLI/AAAAAAAAAEM/B_CS9ehCxF4/s320/Greyscale+histogram.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5352758258541119666" /&gt;&lt;/a&gt;&lt;br /&gt;It has a fair amount of contrast, even to the naked eye. However, it is difficult to separate the object of interest&lt;br /&gt;from the background in simple means. Here is the program in scilab for plotting the histogram of the photo:&lt;br /&gt;&lt;br /&gt;[mat]=imread('C:\Users\Mandee\Documents\Acads\2009-2010 1st sem\AP 186\Activity 3\3truecolor.jpg');&lt;br /&gt;xbasc();&lt;br /&gt;gray=(mat(:,:,1)+mat(:,:,2)+mat(:,:,3))/3;  //averaging grays from R, G and B channels&lt;br /&gt;f1=scf(0);&lt;br /&gt;imshow(gray);&lt;br /&gt;f2 = scf(1);&lt;br /&gt;histplot(256,gray);//256 is the number of classes (brightness is given in fractional form, usually, 256 different levels are enough to keep details in a photo)&lt;br /&gt;&lt;br /&gt;This photo was used instead. &lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SkjR-HS7BhI/AAAAAAAAAEU/n0MF62W9aZ8/s1600-h/Area.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 316px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SkjR-HS7BhI/AAAAAAAAAEU/n0MF62W9aZ8/s320/Area.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5352759022170342930" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We may obtain a rough estimate of the area by replacing the figure with a combination of rectangles and circles to approximate its shape.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/SkjSOkFopfI/AAAAAAAAAEc/B0ouUppMirM/s1600-h/Area+approx.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 316px;" src="http://1.bp.blogspot.com/_U5aA5wS7v7U/SkjSOkFopfI/AAAAAAAAAEc/B0ouUppMirM/s320/Area+approx.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5352759304777147890" /&gt;&lt;/a&gt;&lt;br /&gt;The geometric shapes have the following dimensions:&lt;br /&gt;r1=50&lt;br /&gt;l2=60 w2=65&lt;br /&gt;r3=33.5&lt;br /&gt;r4=34&lt;br /&gt;l5=117 w5=65&lt;br /&gt;r6=63.5&lt;br /&gt;r7=26&lt;br /&gt;r8=51&lt;br /&gt;All in all, the shapes accupy an area of about 49800 pixels.&lt;br /&gt;&lt;br /&gt;Using the program from exercise 2, we find that the area is 49029 pixels.&lt;br /&gt;&lt;br /&gt;The two estimates are in close agreement, indicating that the program is indeed working.&lt;br /&gt;&lt;br /&gt;Finding an image with proper constrast was the difficult part of this exercise. After looking through my collection of pictures,&lt;br /&gt;I finally decided to use the image of the fish fillet sauce from Chowking. The dark portions are actually drops of soy sauce.&lt;br /&gt;Obviously, I was bored when I took the picture. Anyway, I had to increase the contrast of the picture and erase the unnecessary parts. It was easy to convert the image into black and white after a little adjustment here and there. Here are the modified and the black and white images.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U5aA5wS7v7U/SkjTyy1yr1I/AAAAAAAAAEk/jMMZQI1M_Aw/s1600-h/high+contrast.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 281px;" src="http://4.bp.blogspot.com/_U5aA5wS7v7U/SkjTyy1yr1I/AAAAAAAAAEk/jMMZQI1M_Aw/s320/high+contrast.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5352761026724147026" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/SkjTy1LFbVI/AAAAAAAAAEs/p0A7hBZvk_k/s1600-h/blackandwhite.bmp"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 281px;" src="http://3.bp.blogspot.com/_U5aA5wS7v7U/SkjTy1LFbVI/AAAAAAAAAEs/p0A7hBZvk_k/s320/blackandwhite.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5352761027350326610" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This was, so far, the most time consuming activity. I give myself 10 points for correctly classifying images and determining areas of irregular shapes. I am grateful to Chowking for unknowingly providing me with a subject for this exercise. Hehe.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-8991745380205193632?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/8991745380205193632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.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/5456089935119994902/posts/default/8991745380205193632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/8991745380205193632'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2009/06/activity-3-image-types-and-basic-image.html' title='Activity 3 - Image Types and Basic Image Enhancement'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_U5aA5wS7v7U/SkwHwad6QhI/AAAAAAAAAE0/7KKIK-jLKVc/s72-c/01heat+of+fusion.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-3878719051701579074</id><published>2009-06-22T20:01:00.000-07:00</published><updated>2009-07-20T18:36:58.330-07:00</updated><title type='text'>Activity 2 - Area Estimation of Images with Defined Edges</title><content type='html'>Oftentimes, we want to find the surface area of a particular object. However, it is usually difficult because it can come in any irregular shape. Thanks to Green's theorem, we can compute the area from coordinates of the contour.&lt;br /&gt;&lt;br /&gt;In this exercise, we use a discrete form of the theorem to estimate the area of different shapes. This is done be collecting ordered pairs of the pixel coordinates of the shape. From this set, we compute terms following the formula 0.5 [x(i) * x(i+1) - x(i+1) * y(i)], and then sum them all up.&lt;br /&gt;&lt;br /&gt;To test the theorem, simple shapes whose areas may be analytically computed will be used.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U5aA5wS7v7U/SkLtwCyDqZI/AAAAAAAAAD0/-4e7wyj5NE8/s1600-h/square.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 256px; height: 256px;" src="http://4.bp.blogspot.com/_U5aA5wS7v7U/SkLtwCyDqZI/AAAAAAAAAD0/-4e7wyj5NE8/s320/square.bmp" alt="" id="BLOGGER_PHOTO_ID_5351100716905900434" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;First, let us use following square. One side is 151 pixels long. We know that the area is simply the square of this or 22801 square pixels. Implementing the steps outlined above, we find that the area is estimated as 22500.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For a rectangle of length 209 and width 97, the estimated area is 19665, compared to the theoretical value of 20273.&lt;br /&gt;&lt;br /&gt;For a circle of radius 82 pixels, the estimated area is 20508. Using the formula pi*r^2, the area is 21124.&lt;br /&gt;&lt;br /&gt;Finally, for an ellipse with r1=56 and r2=102, the program estimates its area to be 17542. From pi*r1*r2, the area is about 17945.&lt;br /&gt;&lt;br /&gt;For these simple shapes, the estimated area is no more than 3% off from the "theoretical" area. (note that the theoretical area is itself an estimate of the area of the figure since a continuous figure such as a circle is discretized in an image)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SkN1DoISHdI/AAAAAAAAAEE/lFqxemuJaNg/s1600-h/fig+and+trace.bmp"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 199px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SkN1DoISHdI/AAAAAAAAAEE/lFqxemuJaNg/s320/fig+and+trace.bmp" alt="" id="BLOGGER_PHOTO_ID_5351249487418498514" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It is particularly noticable that the estimates are always lower than the theoretical values. This bias is probably due to the error in tracing the contour. The tracing is actually a little smaller than the image itself. Therefore, the estimate must be lower than the actual area.&lt;br /&gt;&lt;br /&gt;I think that this technique is very accurate. Without the bias, I think the estimate should be within 1% of the actual area. The method of tracing must be improved in order to achieve this.&lt;br /&gt;&lt;br /&gt;Acknowledgements: Thanks Irene and Alva for helping me run the necessary programs. Thanks also to Miguel for figuring out how to make SIP work.&lt;br /&gt;&lt;br /&gt;The following code was executed in scilab:&lt;br /&gt;mandee = imread('C:\Users\Mandee\Documents\Acads\2009-2010 1st sem\AP 186\Activity 2\rectangle.bmp');&lt;br /&gt;mandy=im2bw(mandee,1);&lt;br /&gt;//imshow(mandy);&lt;br /&gt;[x,y] = follow(mandy);&lt;br /&gt;//plot(x,y)&lt;br /&gt;//plot([1;2;3;4],[1;2;3;4])&lt;br /&gt;&lt;br /&gt;n=size(x);//number of pairs of coordinates&lt;br /&gt;n=n(1);&lt;br /&gt;summa=0;&lt;br /&gt;for i=1:(n-1),summa=summa+x(i)*y(i+1)-x(i+1)*y(i);end&lt;br /&gt;summa=summa+x(n)*y(1)-x(1)*y(n);               //since I could not include n+1, I manually added the last term. index n+1 goes back to 1&lt;br /&gt;summa=summa/2&lt;br /&gt;&lt;br /&gt;For this activity, I give myself 10 for properly using the follow command, estimating the area and having verified that the error in the follow command gave an estimate that is lower than the theoretical.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-3878719051701579074?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/3878719051701579074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2009/06/area-estimation-of-images-with-defined.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/3878719051701579074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/3878719051701579074'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2009/06/area-estimation-of-images-with-defined.html' title='Activity 2 - Area Estimation of Images with Defined Edges'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_U5aA5wS7v7U/SkLtwCyDqZI/AAAAAAAAAD0/-4e7wyj5NE8/s72-c/square.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-7140479580037170499</id><published>2009-06-17T19:07:00.000-07:00</published><updated>2009-06-19T06:55:54.023-07:00</updated><title type='text'>Activity 1 - Digital Scanning</title><content type='html'>This activity uses ratio and proportion in order to reconstruct a digitally scanned drawing of a plot. I obtained my graph from X-Rays 3rd Ed. by G.W.C. Kaye, M.A., published by Longmans, Green, and Co. in 1918. Here is a cropped photo of the image.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_U5aA5wS7v7U/SjmielRkPnI/AAAAAAAAACE/eDnsjnPr7Tc/s1600-h/activity+1+photo.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 283px;" src="http://2.bp.blogspot.com/_U5aA5wS7v7U/SjmielRkPnI/AAAAAAAAACE/eDnsjnPr7Tc/s320/activity+1+photo.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5348484678764740210" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I opened the photo in MS Paint. The coordinates of every pixel are shown at the lower right portion of the Paint window. I positioned the mouse pointer at selected points on the graph and obtained their coordinates. I tabulated these in a spreadsheet program and adjusted them accordingly to match with the coordinates of the original graph. This is explained in the next paragraphs.&lt;br /&gt;&lt;br /&gt;In order to properly convert from pixel coordinate to a physical variable, I chose 2 points as reference. I determined the pixel coordinates of these points and estimated their physical values  from the scanned photo. I thought it was easiest to use the following as benchmark.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_U5aA5wS7v7U/SjmlbiHvJSI/AAAAAAAAACM/ICcX86KhbKQ/s1600-h/activity+1+photo+reference.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 283px;" src="http://1.bp.blogspot.com/_U5aA5wS7v7U/SjmlbiHvJSI/AAAAAAAAACM/ICcX86KhbKQ/s320/activity+1+photo+reference.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5348487924913480994" /&gt;&lt;/a&gt;&lt;br /&gt;The first point is found about 3 degrees. The second, about 12.5 degrees. These are just my estimates. I found that the horizontal pixel coordinate corresponding to 3 is 144 while 994 corresponds to 12.5. I fitted a line through these points and found the relationship between pixel coordinate and physical coordinate.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_U5aA5wS7v7U/SjmoC-AF4gI/AAAAAAAAACU/zFjgQWwsqnI/s1600-h/linear+fit.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 189px;" src="http://4.bp.blogspot.com/_U5aA5wS7v7U/SjmoC-AF4gI/AAAAAAAAACU/zFjgQWwsqnI/s320/linear+fit.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5348490801435763202" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I converted the horizontal pixel coordinate to physical coordinate using the relationship that I found. I then did the same for the vertical component. However, there is no explicit unit used along the vertical axis. I was able to generate a new set of vertical components by adding the proper bias but the values could be scaled by any multiplicative factor since these are arbitrary.&lt;br /&gt;&lt;br /&gt;Finally, I used the scanned photo as the background of the plot area. I cropped the photo further so that the axes match with that of the plot that I made. I used OpenOffice Calc for this. I opened OpenOffice Draw, selected the Format menu, clicked area, then chose the Bitmaps tab. From there, I imported my cropped photo.&lt;br /&gt;Then in OpenOffice Calc, I double-clicked the plot area and chose the Area tab. I clicked in Bitmap under Fill and selected the newly imported photo.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_U5aA5wS7v7U/SjmtNGXT17I/AAAAAAAAACc/dvVO2kdcTVQ/s1600-h/Final.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 238px;" src="http://3.bp.blogspot.com/_U5aA5wS7v7U/SjmtNGXT17I/AAAAAAAAACc/dvVO2kdcTVQ/s320/Final.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5348496473037461426" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The red dots correspond to the reconstructed plot. They accurately match the original. I give my work a rating of 10.&lt;br /&gt;&lt;br /&gt;I would like to thank my seatmate Alva, with whom I shared most of my discussions. I would also like to thank both of my instructors, Dr. Perez and Dr. Soriano for guiding me along the way.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-7140479580037170499?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/7140479580037170499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.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/5456089935119994902/posts/default/7140479580037170499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/7140479580037170499'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2009/06/activity-1-digital-scanning.html' title='Activity 1 - Digital Scanning'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_U5aA5wS7v7U/SjmielRkPnI/AAAAAAAAACE/eDnsjnPr7Tc/s72-c/activity+1+photo.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456089935119994902.post-4476355388400032952</id><published>2009-06-15T20:01:00.000-07:00</published><updated>2009-06-15T20:05:38.192-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Malese Jow'/><category scheme='http://www.blogger.com/atom/ns#' term='applied physics'/><title type='text'>Why Malese-ous</title><content type='html'>These blog is named after my favorite Nick star, Malese Jow. This was created in partial fullfillment of the requirements in Applied Physics 186. After this sem, I might still update this. Who knows?... :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456089935119994902-4476355388400032952?l=malese-ous.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://malese-ous.blogspot.com/feeds/4476355388400032952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://malese-ous.blogspot.com/2009/06/why-malese-ous.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/4476355388400032952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456089935119994902/posts/default/4476355388400032952'/><link rel='alternate' type='text/html' href='http://malese-ous.blogspot.com/2009/06/why-malese-ous.html' title='Why Malese-ous'/><author><name>Mandee-ness</name><uri>http://www.blogger.com/profile/06602261478880336985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://2.bp.blogspot.com/_U5aA5wS7v7U/S751XHvVbpI/AAAAAAAAAaQ/JJadwFKKlfo/S220/hybrid3.jpg'/></author><thr:total>1</thr:total></entry></feed>
