<?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; image enhancement</title>
	<atom:link href="http://incisors.wordpress.com/tag/image-enhancement/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; image enhancement</title>
		<link>http://incisors.wordpress.com</link>
	</image>
			<item>
		<title>Activity 4: Image Enhancement</title>
		<link>http://incisors.wordpress.com/2008/06/26/activity-4-image-enhancement/</link>
		<comments>http://incisors.wordpress.com/2008/06/26/activity-4-image-enhancement/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 03:27:52 +0000</pubDate>
		<dc:creator>jptugaff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[backprojection]]></category>
		<category><![CDATA[histogram]]></category>
		<category><![CDATA[image enhancement]]></category>

		<guid isPermaLink="false">http://incisors.wordpress.com/?p=29</guid>
		<description><![CDATA[This activity enhances images by stretching the histogram of pixel values and stretching it in such a way that the maximum is 255 and the minimum is 0. another requirement is that the image cumulative distribution function (cdf) of the pixel values becomes linear. i wrote here a simple imhist function that can be included [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=incisors.wordpress.com&blog=3941311&post=29&subd=incisors&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This activity enhances images by stretching the histogram of pixel values and stretching it in such a way that the maximum is 255 and the minimum is 0. another requirement is that the image cumulative distribution function (cdf) of the pixel values becomes linear. i wrote here a simple imhist function that can be included in the directory of the source code, and calle using getf(&#8220;imhist.sce&#8221;).</p>
<p>here is the source code of the &#8220;imhist.sce&#8221; function i wrote:</p>
<p>function [val,num]=imhist(im)<br />
val=[];<br />
num=[];<br />
counter=1;<br />
for i=0:1:255<br />
[x,y]=find(im==i);    //finds where im==i<br />
val(counter)=i;<br />
num(counter)=length(x); //find how many pixels of im have value of i<br />
counter=counter+1;<br />
end<br />
return val, num;</p>
<p style="text-align:center;">-oOo-</p>
<p style="text-align:left;">after obtaining the probability distribution function (pdf, which is a normalized histogram), we obtain the cumulative distribution function.</p>
<p><a href="http://incisors.files.wordpress.com/2008/06/aram.jpg"><img class="alignnone size-medium wp-image-31" src="http://incisors.files.wordpress.com/2008/06/aram.jpg?w=186&#038;h=300" alt="" width="186" height="300" /></a></p>
<p>taken from: http://home.earthlink.net/~rogergoodman/XRay-2000-06-05-Modabber.jpg</p>
<p>The probability distribution function and the cumulative distribution function</p>
<p><a href="http://incisors.files.wordpress.com/2008/06/pdf_orig.gif"><img class="alignnone size-medium wp-image-33" src="http://incisors.files.wordpress.com/2008/06/pdf_orig.gif?w=201&#038;h=151" alt="" width="201" height="151" /></a><a href="http://incisors.files.wordpress.com/2008/06/cdf_orig.gif"><img class="alignnone size-medium wp-image-32" src="http://incisors.files.wordpress.com/2008/06/cdf_orig.gif?w=203&#038;h=152" alt="" width="203" height="152" /></a></p>
<p>image enhancement is obtained by obtaining the the values of each pixel and backprojecting. in a sense, we are simple mapping each pixel of the original image to a new array with the CDF as the mapping function.</p>
<p><a href="http://incisors.files.wordpress.com/2008/06/enhanced.jpg"><img class="alignnone size-medium wp-image-30" src="http://incisors.files.wordpress.com/2008/06/enhanced.jpg" alt="" /></a></p>
<p><a href="http://incisors.files.wordpress.com/2008/06/pdf_enhanced.gif"><img class="alignnone size-medium wp-image-34" src="http://incisors.files.wordpress.com/2008/06/pdf_enhanced.gif?w=300" alt="" width="194" height="146" /></a><a href="http://incisors.files.wordpress.com/2008/06/cdf_enhanced.gif"><img class="alignnone size-medium wp-image-35" src="http://incisors.files.wordpress.com/2008/06/cdf_enhanced.gif?w=300" alt="" width="193" height="146" /></a></p>
<p>here is the code, which implemented my own <em>imhist</em> function. the &#8220;imhist.sce&#8221; file is loaded within the same directory as the program below.</p>
<p style="text-align:center;">-oOo-</p>
<p>//Jeric Tugaff<br />
//Image Enahancement</p>
<p>clear all;<br />
getf(&#8220;imhist.sce&#8221;);<br />
im=imread(&#8220;aram.jpg&#8221;);     //opens a 24 bit image<br />
im=im*255;<br />
[val, num]=imhist(im);<br />
[sx, sy]=size(im);<br />
num=num/(sx*sy);<br />
normval=val/max(val);<br />
cumnum=cumsum(num)/max(cumsum(num));<br />
h=scf(1);<br />
plot(normval, num);<br />
h=scf(2);<br />
plot(normval, cumnum);</p>
<p>enhanced=[];<br />
im=im/255;<br />
for i=1:sx<br />
for j=1:sy<br />
enhanced(i,j)=cumnum(find(normval==im(i,j)));<br />
end<br />
end<br />
imwrite(enhanced, &#8220;enhanced.jpg&#8221;);<br />
enhanced=round(enhanced*255);</p>
<p>//hist ulit<br />
[val, num]=imhist(enhanced);<br />
num=num/(sx*sy);<br />
normval=val/max(val);<br />
cumnum=cumsum(num)/max(cumsum(num));<br />
h=scf(3);<br />
plot(normval, num);<br />
h=scf(4);<br />
plot(normval, cumnum);</p>
<p style="text-align:center;">-oOo-</p>
<p style="text-align:left;"><strong>Using any non-linear CDF</strong></p>
<p style="text-align:left;">Using any non-liner CDF, we produced better images than backprojecting along a linear CDF. The flowchart of the pixel backprojecting is summarized by this image from Dr. Soriano&#8217;s lecture.</p>
<p style="text-align:center;"><a href="http://incisors.files.wordpress.com/2008/07/soriano_lecture.png"><img class="size-medium wp-image-37 aligncenter" src="http://incisors.files.wordpress.com/2008/07/soriano_lecture.png?w=300" alt="" width="300" height="176" /></a></p>
<p style="text-align:left;"><a href="http://incisors.files.wordpress.com/2008/07/enhanced_add.gif"><img class="alignnone size-medium wp-image-38" src="http://incisors.files.wordpress.com/2008/07/enhanced_add.gif?w=300" alt="Enhanced Image using parabolic CDF" width="272" height="206" /></a></p>
<p style="text-align:left;"><a href="http://incisors.files.wordpress.com/2008/07/cdf_overlay_add.gif"><img class="alignnone size-medium wp-image-39" src="http://incisors.files.wordpress.com/2008/07/cdf_overlay_add.gif?w=300" alt="Actual and desired parabolic CDF" width="327" height="243" /></a></p>
<p style="text-align:left;">Again, there is good (not perfect) correspondence with the desired (smooth) and actual  (jagged) CDF. Here is my code, which is quite slow but is more general especially when in cases where the inverse function of the CDF is difficult to solve analytically:</p>
<p style="text-align:left;">//Jeric Tugaff<br />
//Image enhancement using parabolic CDF</p>
<p>clear all;<br />
getf(&#8220;imhist.sce&#8221;);<br />
im=imread(&#8220;aram.jpg&#8221;);     //opens a 24 bit image<br />
im=im*255;<br />
[val, num]=imhist(im);<br />
[sx, sy]=size(im);<br />
num=num/(sx*sy);<br />
normval=val/max(val);<br />
cumnum=cumsum(num)/max(cumsum(num));<br />
h=scf(0);<br />
plot(val, num)</p>
<p>enhanced=[];<br />
desired_cdfx=[0:1:255];<br />
desired_cdfy=desired_cdfx.*desired_cdfx;<br />
desired_cdfy=desired_cdfy/max(desired_cdfy);</p>
<p>for i=1:sx<br />
for j=1:sy<br />
step2(i, j)=cumnum(im(i,j));<br />
end<br />
end</p>
<p>enhanced=interp1(desired_cdfy, desired_cdfx, step2);<br />
h=scf(1);<br />
imshow(enhanced, [0 255]);<br />
enhanced=round(enhanced);<br />
//hist ulit<br />
[val, num]=imhist(enhanced);<br />
num=num/(sx*sy);<br />
normval=val/max(val);<br />
cumnum=cumsum(num)/max(cumsum(num));<br />
h=scf(3);<br />
plot(val, cumnum);</p>
<p style="text-align:center;">-oOo-</p>
<p>collaborators: julie, lei, cole</p>
<p>rating: 10, because i&#8217;ve been able to implement my own imhist function and the resulting cumulative disctribution is has good correspondence with the desired CDF. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/incisors.wordpress.com/29/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/incisors.wordpress.com/29/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/incisors.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/incisors.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/incisors.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/incisors.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/incisors.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/incisors.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/incisors.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/incisors.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/incisors.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/incisors.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=incisors.wordpress.com&blog=3941311&post=29&subd=incisors&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://incisors.wordpress.com/2008/06/26/activity-4-image-enhancement/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/06/aram.jpg?w=186" medium="image" />

		<media:content url="http://incisors.files.wordpress.com/2008/06/pdf_orig.gif?w=300" medium="image" />

		<media:content url="http://incisors.files.wordpress.com/2008/06/cdf_orig.gif?w=300" medium="image" />

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

		<media:content url="http://incisors.files.wordpress.com/2008/06/pdf_enhanced.gif?w=300" medium="image" />

		<media:content url="http://incisors.files.wordpress.com/2008/06/cdf_enhanced.gif?w=300" medium="image" />

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

		<media:content url="http://incisors.files.wordpress.com/2008/07/enhanced_add.gif?w=300" medium="image">
			<media:title type="html">Enhanced Image using parabolic CDF</media:title>
		</media:content>

		<media:content url="http://incisors.files.wordpress.com/2008/07/cdf_overlay_add.gif?w=300" medium="image">
			<media:title type="html">Actual and desired parabolic CDF</media:title>
		</media:content>
	</item>
	</channel>
</rss>