<?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; binary</title>
	<atom:link href="http://incisors.wordpress.com/tag/binary/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; binary</title>
		<link>http://incisors.wordpress.com</link>
	</image>
			<item>
		<title>Activity 3: Image Types and Basic Image Enhancement</title>
		<link>http://incisors.wordpress.com/2008/06/24/activity-3-image-types-and-basic-image-enhancement/</link>
		<comments>http://incisors.wordpress.com/2008/06/24/activity-3-image-types-and-basic-image-enhancement/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 02:30:47 +0000</pubDate>
		<dc:creator>jptugaff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[binary]]></category>
		<category><![CDATA[grayscale]]></category>
		<category><![CDATA[histogram]]></category>
		<category><![CDATA[indexed]]></category>
		<category><![CDATA[true color]]></category>

		<guid isPermaLink="false">http://incisors.wordpress.com/?p=20</guid>
		<description><![CDATA[Image Types
True Color Image

from: http://www.flickr.com/photos/8700785@N08/643095209/
FileName: truecolor.jpg
FileSize: 189687
Format: JPEG
Width: 500
Height: 493
Depth: 8
StorageType: truecolor
NumberOfColors: 0
ResolutionUnit: inch
XResolution: 72.000000
YResolution: 72.000000
Indexed Images.

from: http://en.wikipedia.org/wiki/Image:Adaptative_8bits_palette_sample_image.png
FileName: indexed.png
FileSize: 25576
Format: PNG
Width: 150
Height: 200
Depth: 8
StorageType: indexed
NumberOfColors: 256
ResolutionUnit: centimeter
XResolution: 72.000000
YResolution: 72.000000
Grayscale Image.
This is obtained by getting images from the web. However, this image is still 24 bits (which is not a property of grayscale images). To convert [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=incisors.wordpress.com&blog=3941311&post=20&subd=incisors&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>Image Types</strong></p>
<p>True Color Image</p>
<p><a href="http://incisors.files.wordpress.com/2008/06/truecolor.jpg"><img class="alignnone size-medium wp-image-21" src="http://incisors.files.wordpress.com/2008/06/truecolor.jpg?w=245&#038;h=241" alt="//www.flickr.com/photos/8700785@N08/643095209/" width="245" height="241" /></a></p>
<p>from: http://www.flickr.com/photos/8700785@N08/643095209/</p>
<p>FileName: truecolor.jpg<br />
FileSize: 189687<br />
Format: JPEG<br />
Width: 500<br />
Height: 493<br />
Depth: 8<br />
StorageType: truecolor<br />
NumberOfColors: 0<br />
ResolutionUnit: inch<br />
XResolution: 72.000000<br />
YResolution: 72.000000</p>
<p>Indexed Images.</p>
<p><a href="http://incisors.files.wordpress.com/2008/06/indexed.png"><img class="alignnone size-medium wp-image-26" src="http://incisors.files.wordpress.com/2008/06/indexed.png?w=150&#038;h=200" alt="indexed images parrot" width="150" height="200" /></a></p>
<p>from: http://en.wikipedia.org/wiki/Image:Adaptative_8bits_palette_sample_image.png</p>
<p>FileName: indexed.png<br />
FileSize: 25576<br />
Format: PNG<br />
Width: 150<br />
Height: 200<br />
Depth: 8<br />
StorageType: indexed<br />
NumberOfColors: 256<br />
ResolutionUnit: centimeter<br />
XResolution: 72.000000<br />
YResolution: 72.000000</p>
<p>Grayscale Image.</p>
<p>This is obtained by getting images from the web. However, this image is still 24 bits (which is not a property of grayscale images). To convert it to 8 bit (which is true grayscale), use the code:</p>
<p><!-- 	 	 --></p>
<p>im=imread(&#8216;grayscale.jpg&#8217;);<br />
im=im(:,:,1);<br />
imwrite(im(:,:), &#8216;gs.jpg&#8217;);</p>
<p><a href="http://incisors.files.wordpress.com/2008/06/gs.jpg"><img class="alignnone size-medium wp-image-22" src="http://incisors.files.wordpress.com/2008/06/gs.jpg" alt="//blog.paranoidferret.com/files/Tutorials/CSharp/Grayscale/bw_flower.jpg" /></a></p>
<p>from: http://blog.paranoidferret.com/files/Tutorials/CSharp/Grayscale/bw_flower.jpg</p>
<p>FileName: gs.jpg<br />
FileSize: 9217<br />
Format: JPEG<br />
Width: 250<br />
Height: 250<br />
Depth: 8<br />
StorageType: indexed<br />
NumberOfColors: 256<br />
ResolutionUnit: inch<br />
XResolution: 72.000000<br />
YResolution: 72.000000</p>
<p><strong>Histogram and Thresholding</strong></p>
<p>The histogram of the grayscale image was obtained using the following code:</p>
<p><!-- 	 	 --></p>
<p>//Jeric Tugaff<br />
//Histogram</p>
<p>im=imread(&#8216;grayscale.jpg&#8217;);     //opens a 24 bit image<br />
im=im(:,:,1);<br />
imwrite(im(:,:), &#8216;gs.jpg&#8217;);   //converts to 8 bit grayscale image<br />
im=imread(&#8216;gs.jpg&#8217;);<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 />
plot(val, num);   //plot. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>We obtained this plot of the histogram for the image of a grayscale flower:</p>
<p><a href="http://incisors.files.wordpress.com/2008/06/jeric_plot.gif"><img class="alignnone size-medium wp-image-23" src="http://incisors.files.wordpress.com/2008/06/jeric_plot.gif?w=300" alt="Grayscale image histogram" width="300" height="226" /></a></p>
<p>The two peaks in the histogram plot is a hint that the image is of high quality, and is good for tresholding. To do the thresholding, we use the code:</p>
<p>im=imread(&#8216;gs.jpg&#8217;);<br />
thresh=140;<br />
im=im2bw(im, thresh/255);<br />
imshow(im);</p>
<p>This results to this binary image:</p>
<p><a href="http://incisors.files.wordpress.com/2008/06/bw.gif"><img class="alignnone size-medium wp-image-24" src="http://incisors.files.wordpress.com/2008/06/bw.gif?w=300" alt="Binary Image" width="300" height="194" /></a></p>
<p><strong>Application To Getting Area of Images</strong></p>
<p style="text-align:center;"><a href="http://incisors.files.wordpress.com/2008/06/thresholds1.png"><img class="size-medium wp-image-28 aligncenter" src="http://incisors.files.wordpress.com/2008/06/thresholds1.png?w=300" alt="tresholds" width="300" height="132" /></a></p>
<p style="text-align:left;">The images show the effect of tresholding to the leaf image. The name of the image corresponds to the treshold. We can see that the most appriate is using threshold value of 200/255. The method done in using the area follows from the previous exercise. For this activity, the area is  20108.5 while the theoretical area is  20505 with error of 1.9%.</p>
<p style="text-align:left;">//Jeric Tugaff<br />
//Getting image areas through green&#8217;s theorem and grayscale image tresholding</p>
<p>im=imread(&#8216;leaf_cropped.JPG&#8217;);<br />
im=im2gray(im); //convert to grayscale<br />
im=im2bw(im, 200/255);<br />
im=1*(im==0); //inverts the image<br />
[x,y]=follow(im);<br />
x1=[];<br />
x1(1:length(x)-1)=x(2:length(x));<br />
x1(length(x))=x(1);<br />
y1=[];<br />
y1(1:length(y)-1)=y(2:length(y));<br />
y1(length(y))=y(1);<br />
area=0.5*abs(sum(x1.*y-y1.*x))  //green&#8217;s theorem<br />
ta=0;<br />
[sx, sy]=size(im);    //finds the area through recatangles<br />
for i=1:sy<br />
f=find(im(:, i)==1);<br />
ta=ta+max(f)-min(f);<br />
end<br />
ta<br />
err=(area-ta)/ta*100<br />
//[r,s]=imhist(&#8216;leaf_cropped.JPG&#8217;);</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/incisors.wordpress.com/20/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/incisors.wordpress.com/20/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/incisors.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/incisors.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/incisors.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/incisors.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/incisors.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/incisors.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/incisors.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/incisors.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/incisors.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/incisors.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=incisors.wordpress.com&blog=3941311&post=20&subd=incisors&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://incisors.wordpress.com/2008/06/24/activity-3-image-types-and-basic-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/truecolor.jpg?w=300" medium="image">
			<media:title type="html">//www.flickr.com/photos/8700785@N08/643095209/</media:title>
		</media:content>

		<media:content url="http://incisors.files.wordpress.com/2008/06/indexed.png?w=150" medium="image">
			<media:title type="html">indexed images parrot</media:title>
		</media:content>

		<media:content url="http://incisors.files.wordpress.com/2008/06/gs.jpg" medium="image">
			<media:title type="html">//blog.paranoidferret.com/files/Tutorials/CSharp/Grayscale/bw_flower.jpg</media:title>
		</media:content>

		<media:content url="http://incisors.files.wordpress.com/2008/06/jeric_plot.gif?w=300" medium="image">
			<media:title type="html">Grayscale image histogram</media:title>
		</media:content>

		<media:content url="http://incisors.files.wordpress.com/2008/06/bw.gif?w=300" medium="image">
			<media:title type="html">Binary Image</media:title>
		</media:content>

		<media:content url="http://incisors.files.wordpress.com/2008/06/thresholds1.png?w=300" medium="image">
			<media:title type="html">tresholds</media:title>
		</media:content>
	</item>
	</channel>
</rss>