<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>jagged tooth v2.1 &#187; dilation</title>
	<atom:link href="http://incisors.wordpress.com/tag/dilation/feed/" rel="self" type="application/rss+xml" />
	<link>http://incisors.wordpress.com</link>
	<description>Blog for AP 186</description>
	<lastBuildDate>Mon, 06 Oct 2008 13:54:14 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='incisors.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/ddf399ffdf73266657059c785470b710?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>jagged tooth v2.1 &#187; dilation</title>
		<link>http://incisors.wordpress.com</link>
	</image>
			<item>
		<title>Activity 9: Binary Operations</title>
		<link>http://incisors.wordpress.com/2008/07/17/activity-9-binary-operations/</link>
		<comments>http://incisors.wordpress.com/2008/07/17/activity-9-binary-operations/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 03:26:18 +0000</pubDate>
		<dc:creator>jptugaff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[closing]]></category>
		<category><![CDATA[dilation]]></category>
		<category><![CDATA[erosion]]></category>
		<category><![CDATA[histogram]]></category>
		<category><![CDATA[morphological transform]]></category>
		<category><![CDATA[opening]]></category>

		<guid isPermaLink="false">http://incisors.wordpress.com/?p=107</guid>
		<description><![CDATA[The goal of this activity is to find size of each &#8220;cell&#8221; in then image. We will be implementing the various techniques we have learned so far in solving the problem.

One of the relevant concepts that we will be implementing is the histogram thresholding to separate the background from the image. Another relevant concept is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=incisors.wordpress.com&blog=3941311&post=107&subd=incisors&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The goal of this activity is to find size of each &#8220;cell&#8221; in then image. We will be implementing the various techniques we have learned so far in solving the problem.</p>
<p><a href="http://incisors.files.wordpress.com/2008/07/circles001.jpg"><img class="aligncenter size-medium wp-image-109" src="http://incisors.files.wordpress.com/2008/07/circles001.jpg?w=232&#038;h=192" alt="" width="232" height="192" /></a></p>
<p>One of the relevant concepts that we will be implementing is the histogram thresholding to separate the background from the image. Another relevant concept is the <em>opening</em> and <em>closing</em> operations in morphological transformations. Opening is mathematically defined as</p>
<p><a href="http://incisors.files.wordpress.com/2008/07/opening.png"><img class="aligncenter size-medium wp-image-120" src="http://incisors.files.wordpress.com/2008/07/opening.png?w=185&#038;h=21" alt="" width="185" height="21" /></a></p>
<p>which simply means is the dilation of an erosion (see previous entry). Opening has the effect of removing small objects or noise. Closing on the other hand is defined as</p>
<p><a href="http://incisors.files.wordpress.com/2008/07/closing.png"><img class="aligncenter size-medium wp-image-121" src="http://incisors.files.wordpress.com/2008/07/closing.png?w=185&#038;h=21" alt="" width="185" height="21" /></a></p>
<p>which means the erosion of a dilation. It has the effect of removing small holes in the object.</p>
<p>The image above is divided into 9 images of size 256&#215;256 to remove the burden of using too much memory.</p>
<p>My code for the activity is shown below.<a href="http://incisors.files.wordpress.com/2008/07/activity92.pdf"><br />
</a></p>
<p><span style="color:#0000ff;">getf</span>(<span style="color:#993300;">&#8220;imhist.sce&#8221;</span>);<br />
im=imread(<span style="color:#993300;">&#8216;circ01_01.jpg&#8217;</span>);<br />
<span style="color:#0000ff;">stacksize</span>(4e7);<br />
pref=<span style="color:#993300;">&#8216;circ01_0&#8242;</span>;</p>
<p><span style="color:#008000;">//create filter</span><br />
se=<span style="color:#000080;">ones</span>(10,10);<br />
se=mkfftfilter(se, <span style="color:#800000;">&#8216;binary&#8217;</span>, 4);</p>
<p>area=[];<br />
counter=1</p>
<p><span style="color:#008000;">//scan images</span><br />
<span style="color:#ff00ff;">for</span> i=1:9<br />
im=imread(<span style="color:#000080;">strcat</span>([pref,<span style="color:#0000ff;">string</span>(i),<span style="color:#800000;">'.jpg'</span>]));<br />
im=im2gray(im);<br />
im=im2bw(im, 205/255);<br />
im=erode(im, se); <span style="color:#008000;">//opening</span><br />
im=dilate(im, se);<br />
im=dilate(im, se); <span style="color:#008000;">//closing</span><br />
im=erode(im, se);<br />
[L,n]=bwlabel(im);<br />
<span style="color:#008000;">//scan regions</span><br />
<span style="color:#ff00ff;">for</span> j=1:n<br />
area(counter)=<span style="color:#000080;">length</span>(<span style="color:#0000ff;">find</span>(L==j));<br />
counter=counter+1;<br />
<span style="color:#ff00ff;">end<br />
end</span><br />
<span style="color:#00ffff;">scf</span>(10);<br />
<span style="color:#00ccff;">histplot</span>(<span style="color:#0000ff;">length</span>(area),area);<br />
x=<span style="color:#0000ff;">find</span>(area&lt;600 &amp; area&gt;450);<br />
<span style="color:#00ccff;">scf</span>(11)<br />
<span style="color:#33cccc;">histplot</span>(length(x), area(x));<br />
a=area(x);<br />
a=<span style="color:#0000ff;">sum</span>(a)/<span style="color:#0000ff;">length</span>(x) <span style="color:#008000;">//area</span><br />
y=<span style="color:#00ccff;">stdev</span>(area(x)) <span style="color:#008000;">//error</span></p>
<p>The &#8216;pref&#8217; variable is used to defined the prefix of the subimage, and concatenates it with a counter for loop with the 9 sub-images. We also used the &#8216;bwlabel&#8217; command which looks for continuous regions in a binary image and labels them accordingly.</p>
<p>The histogram yields:</p>
<p><a href="http://incisors.files.wordpress.com/2008/07/histogram.png"><img class="aligncenter size-medium wp-image-115" src="http://incisors.files.wordpress.com/2008/07/histogram.png?w=300&#038;h=226" alt="" width="300" height="226" /></a></p>
<p>We can see that <em>bwlabel</em> has considered overlapping cells as one. However, we limit our interest to areas with less than 800 pixels  and greater than 400 pixels to increase the accuracy the calculation of the average of the cell. As can be seen below, there are regions that were labeled by <em>bwlabel</em> that was extremely small and some regions that were labeled were very large. Thus, setting a limit to the acceptable area is necessary.</p>
<p><a href="http://incisors.files.wordpress.com/2008/07/sample.png"><img class="aligncenter size-medium wp-image-116" src="http://incisors.files.wordpress.com/2008/07/sample.png?w=168&#038;h=164" alt="" width="168" height="164" /></a></p>
<p>The calculated areas is area=538.15 with std deviation of std=22.645. We are confident that this is indeed within the limits of the accepted area. To check the validity of our results, we took a subimage and calculated the area of the &#8220;cells&#8221;. The subimage that we took has completely separted cell, which ensures that the area we calculate is the area of a cell, and not the area of compounded/joint cells.<a href="http://incisors.files.wordpress.com/2008/07/circ01_091.jpg"><img class="aligncenter size-medium wp-image-114" src="http://incisors.files.wordpress.com/2008/07/circ01_091.jpg" alt="" /></a></p>
<p>I gave myself a rating of 10 because i believe that i was able to do the activity right.</p>
<p>Collaborators: Cole, Julie.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/incisors.wordpress.com/107/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/incisors.wordpress.com/107/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/incisors.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/incisors.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/incisors.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/incisors.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/incisors.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/incisors.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/incisors.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/incisors.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/incisors.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/incisors.wordpress.com/107/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=incisors.wordpress.com&blog=3941311&post=107&subd=incisors&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://incisors.wordpress.com/2008/07/17/activity-9-binary-operations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7180bfbb1df0d02507e75d02e265e0fa?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">jptugaff</media:title>
		</media:content>

		<media:content url="http://incisors.files.wordpress.com/2008/07/circles001.jpg" medium="image" />

		<media:content url="http://incisors.files.wordpress.com/2008/07/opening.png?w=185" medium="image" />

		<media:content url="http://incisors.files.wordpress.com/2008/07/closing.png?w=185" medium="image" />

		<media:content url="http://incisors.files.wordpress.com/2008/07/histogram.png?w=300" medium="image" />

		<media:content url="http://incisors.files.wordpress.com/2008/07/sample.png?w=168" medium="image" />

		<media:content url="http://incisors.files.wordpress.com/2008/07/circ01_091.jpg" medium="image" />
	</item>
	</channel>
</rss>