<?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>New Media Installation: Art that Learns</title>
	<atom:link href="http://artthatlearns.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://artthatlearns.wordpress.com</link>
	<description></description>
	<lastBuildDate>Sun, 10 May 2009 23:35:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='artthatlearns.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>New Media Installation: Art that Learns</title>
		<link>http://artthatlearns.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://artthatlearns.wordpress.com/osd.xml" title="New Media Installation: Art that Learns" />
	<atom:link rel='hub' href='http://artthatlearns.wordpress.com/?pushpress=hub'/>
		<item>
		<title>The Curator.</title>
		<link>http://artthatlearns.wordpress.com/2009/05/07/747/</link>
		<comments>http://artthatlearns.wordpress.com/2009/05/07/747/#comments</comments>
		<pubDate>Thu, 07 May 2009 17:31:21 +0000</pubDate>
		<dc:creator>patrickgage</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://artthatlearns.wordpress.com/?p=747</guid>
		<description><![CDATA[The Curator Polo Chau François Chu Sue Ann Hong Patrick Gage Kelley Art That Learns 2009. Introduction This installation explores the act of acceptance and rejection, of the artist, and the influence of institutions such as museums and galleries on artists&#8217; directions as well as that of artists on such institutions. Here, a computer automatically [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=artthatlearns.wordpress.com&amp;blog=6099835&amp;post=747&amp;subd=artthatlearns&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1>The Curator</h1>
<p>Polo Chau<br />
<br />François Chu<br />
<br />Sue Ann Hong<br />
<br />Patrick Gage Kelley </p>
<p>Art That Learns 2009.</p>
<h2>Introduction</h2>
<p>
This installation explores the act of acceptance and rejection, of the artist, and the influence of institutions such as museums and galleries on artists&#8217; directions as well as that of artists on such institutions.
</p>
<p>
Here, a computer automatically decides whether to add to its collection simple drawings submitted by the audience. While various criteria are used in judgment and reception of art in our society, &#8220;The Curator&#8221; simulates a simple aspect: originality.
</p>
<p>
It uses a machine learning algorithm based on anomaly detection to determine the acceptance of pieces, rejecting the ones similar to those already seen. (Also, to simulate the concept of revival, after a time, older pieces are forgotten by the algorithm.)
</p>
<p>
Hence the computer adapts to respond to the artistic ideas given by the audience, while we hope that the decisions made by the computer shape the submissions as the audience attempts to please the machine, and avoid brutal rejection.
</p>
<h2>The Process</h2>
<p>
Our design was an iterative process from the beginning. The idea, a cousin to that of an early concept presented to the class referred to as &#8220;Lack,&#8221; incorporated children by allowing them to create their own artworks which would be appraised.
</p>
<p>
Early on we decided to have two end states, an acceptance, and a rejection, where work would be destroyed. However the physical incarnations changed, from clear acrylic boxes to the idea of the shreds simply tumbling to the floor.
</p>
<p>
The best example of our attempts to build simplicity into our design come from the submission module. We knew there needed to be a way for the children to enter their work into the machine, however the specifics of this mechanism changed frequently. From a fed document strip scanner, to a vertical slot, a horizontal slot, a deconstructed flatbed scanner, we in the end went with a design that was a single slot in a piece of acrylic.
</p>
<p>
Our physical construction involved laser cutting, wood work, bending acrylic, priming, painting, the deconstruction of a mouse, the deconstruction of a shredder, and finally electrical work.
</p>
<p>
The final circuit used was simple, an arduino powered two servos, one for acceptance, the other for rejection, and additionally a relay, through a transistor, powered by a 9V battery, to control the timing of the shredder (whose automatic mechanism &amp; safety switch were removed).
</p>
<p>
The shredder itself was deconstructed and rebuilt inside of a clear acrylic box.
</p>
<p>
For the learning algorithm we use a simple anomaly detection algorithm. We keep around the last n (we use 30) drawings in the form of a orthonormal basis: every time we get a drawing, we compare its feature vector (of pixels) v to the existing basis vectors (except the oldest one, which is what we&#8217;re replacing), and store the component of v orthogonal to them. Before creating the new basis vector, we test the drawing for acceptance by projecting onto the space of the orthonormal basis, then compute the reconstruction error.  If the reconstruction error is greater than our threshold for acceptance, then the drawing is accepted. Intuitively, if the current drawing can be described well by the last 30 drawings (and hence not &#8220;original&#8221;), we do not accept it.  Note that since the feature space is much larger (300&#215;200=60,000?) than the basis space, the basis should not span the space of drawings.
</p>
<p>
We also learn the threshold for acceptance over time to maintain the specified acceptance rate (e.g. we used 40%). After deciding the fate of each drawing, we set the threshold such that the threshold would have accepted 40% of the last 30 drawings.
</p>
<h2>The Installation.</h2>
<p>
The installation was reasonably straight forward. We late in the process found out about the light up wall that would be the backdrop of our work, added frames to compensate for the space, which increased the overall impact of the artwork, and added a second stage of &#8220;acceptance&#8221; (albeit, a human stage, not one controlled by learning).
</p>
<p>
We made a few changes during the process including changing the timing of the button (adding a delay), adjusting the acceptance threshold, and fixing one of the servos which was overdrawing power from the arduino.
</p>
<h2>Observations.</h2>
<p>
One success is that we were actually able to get children&#8217;s attention and keep it, possibly for too long. Many parents had to take their children away from the exhibit. Children were pleased with acceptance and rejection, the clear box was a sign of winning, but the shredder was fun, loud, and visceral. As everything was a reward, they wanted to keep drawing, sometimes to the point of mass producing scribbles&#8230;, artwork.
</p>
<h2>Conclusion</h2>
<p>
We are going to call this a success, children liked it, no one cried, no one got hurt, it was able to stay in the museum, the learning worked (well enough), and it photographed well. The biggest failure is that it likely did not truly accomplish it&#8217;s intended reflection on rejection in society, but with six year olds, this may be a near impossible task to accomplish.</p>
<p><a href="http://www.flickr.com/photos/patrickgage/sets/72157617711889776/">Photos &amp; Videos</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/artthatlearns.wordpress.com/747/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/artthatlearns.wordpress.com/747/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/artthatlearns.wordpress.com/747/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/artthatlearns.wordpress.com/747/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/artthatlearns.wordpress.com/747/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/artthatlearns.wordpress.com/747/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/artthatlearns.wordpress.com/747/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/artthatlearns.wordpress.com/747/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/artthatlearns.wordpress.com/747/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/artthatlearns.wordpress.com/747/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/artthatlearns.wordpress.com/747/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/artthatlearns.wordpress.com/747/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/artthatlearns.wordpress.com/747/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/artthatlearns.wordpress.com/747/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=artthatlearns.wordpress.com&amp;blog=6099835&amp;post=747&amp;subd=artthatlearns&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://artthatlearns.wordpress.com/2009/05/07/747/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">patrickgage</media:title>
		</media:content>
	</item>
		<item>
		<title>Sole Identity</title>
		<link>http://artthatlearns.wordpress.com/2009/05/07/sole-identity/</link>
		<comments>http://artthatlearns.wordpress.com/2009/05/07/sole-identity/#comments</comments>
		<pubDate>Thu, 07 May 2009 17:04:04 +0000</pubDate>
		<dc:creator>Jesse</dc:creator>
				<category><![CDATA[Assignment]]></category>
		<category><![CDATA[Assignment 3]]></category>

		<guid isPermaLink="false">http://artthatlearns.wordpress.com/?p=719</guid>
		<description><![CDATA[Sole Identity by Jesse Chorng My piece attempts to answer the question &#8220;What do our shoes say about us?&#8221; by using machine learning to analyze and classify the bottom of users&#8217; shoes. Sole Identity captures ones out-sole and tries to determine the intended purpose the shoe was designed for. Much like a thumbprint, one&#8217;s shoe [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=artthatlearns.wordpress.com&amp;blog=6099835&amp;post=719&amp;subd=artthatlearns&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><i>Sole Identity</i> by Jesse Chorng</p>
<p><img src="http://farm4.static.flickr.com/3401/3478066077_5d00a62dd0.jpg" width="375" height="500" alt="3" /></a></p>
<p>My piece attempts to answer the question &#8220;What do our shoes say about us?&#8221; by using machine learning to analyze and classify the bottom of users&#8217; shoes. </p>
<p>Sole Identity captures ones out-sole and tries to determine the intended purpose the shoe was designed for. Much like a thumbprint, one&#8217;s shoe print has unique characteristics that can identify an individual. In the shoe design process, special attention is paid to the sole because of its importance in ensuring durability and comfort. Once a person&#8217;s shoe is identified as either a casual, skate, or athletic type, an image of the shoe is then placed into an environment where it is animated and interacts with other pairs according to characteristics specific to their classification. </p>
<p>The goal of the project is to demonstrate to the user how their shoes were meant to behave. By giving life to ones footwear, a person can visually understand the purpose of their shoes and determine whether their shoe choices do indeed reflect who they are. </p>
<p><b>INPUT:</b> the bottom of people&#8217;s shoes<br />
<b>BLACK BOX:</b> classification of soles as Casual, Athletic, or Skateboarding<br />
<b>OUTPUT:</b> animated environment of captured soles</p>
<p><a href="http://www.mediafire.com/?sharekey=6ef4925e22c7d97708f8df73f2072ed6e04e75f6e8ebb871">Download Code</a><br />
<a href="http://www.mediafire.com/?sharekey=6ef4925e22c7d97708f8df73f2072ed6e04e75f6e8ebb871">Download Powerpoint</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/artthatlearns.wordpress.com/719/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/artthatlearns.wordpress.com/719/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/artthatlearns.wordpress.com/719/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/artthatlearns.wordpress.com/719/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/artthatlearns.wordpress.com/719/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/artthatlearns.wordpress.com/719/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/artthatlearns.wordpress.com/719/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/artthatlearns.wordpress.com/719/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/artthatlearns.wordpress.com/719/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/artthatlearns.wordpress.com/719/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/artthatlearns.wordpress.com/719/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/artthatlearns.wordpress.com/719/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/artthatlearns.wordpress.com/719/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/artthatlearns.wordpress.com/719/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=artthatlearns.wordpress.com&amp;blog=6099835&amp;post=719&amp;subd=artthatlearns&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://artthatlearns.wordpress.com/2009/05/07/sole-identity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Jesse</media:title>
		</media:content>

		<media:content url="http://farm4.static.flickr.com/3401/3478066077_5d00a62dd0.jpg" medium="image">
			<media:title type="html">3</media:title>
		</media:content>
	</item>
		<item>
		<title>Matt&#8217;s Assignment 3 &#8211; Brighten Your Day!</title>
		<link>http://artthatlearns.wordpress.com/2009/05/07/matts-assignment-3-brighten-your-day/</link>
		<comments>http://artthatlearns.wordpress.com/2009/05/07/matts-assignment-3-brighten-your-day/#comments</comments>
		<pubDate>Thu, 07 May 2009 16:53:48 +0000</pubDate>
		<dc:creator>mfinder1</dc:creator>
				<category><![CDATA[Assignment 3]]></category>

		<guid isPermaLink="false">http://artthatlearns.wordpress.com/?p=718</guid>
		<description><![CDATA[Above are some images of &#8220;Brighten Your Day!&#8221; at the Children&#8217;s Museum of Pittsburgh. ============================================================== Description: Have you ever wondered what it would be like if household products could see you and react to you? By using a machine learning library that detects people, their faces, and other qualities, this lamp is able to turn on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=artthatlearns.wordpress.com&amp;blog=6099835&amp;post=718&amp;subd=artthatlearns&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-medium wp-image-725" title="img_0671" src="http://artthatlearns.files.wordpress.com/2009/05/img_0671.jpg?w=300&#038;h=225" alt="img_0671" width="300" height="225" /><br />
<img class="aligncenter size-medium wp-image-724" title="img_0687-e" src="http://artthatlearns.files.wordpress.com/2009/05/img_0687-e.jpg?w=300&#038;h=225" alt="img_0687-e" width="300" height="225" /><img class="aligncenter size-medium wp-image-723" title="img_0682" src="http://artthatlearns.files.wordpress.com/2009/05/img_0682.jpg?w=225&#038;h=300" alt="img_0682" width="225" height="300" /><img class="aligncenter size-medium wp-image-722" title="img_0681" src="http://artthatlearns.files.wordpress.com/2009/05/img_0681.jpg?w=225&#038;h=300" alt="img_0681" width="225" height="300" /></p>
<p>Above are some images of &#8220;Brighten Your Day!&#8221; at the Children&#8217;s Museum of Pittsburgh.</p>
<p>==============================================================</p>
<p>Description:</p>
<p>Have you ever wondered what it would be like if household products could see you and react to you? By using a machine learning library that detects people, their faces, and other qualities, this lamp is able to turn on and look at you when you look at it. However, the lamp will only respond to people who believe that it can come to life. Are you a believer?</p>
<p>==============================================================</p>
<p>Materials:</p>
<p>The mechanical components and wires were secured in a support structure made of MDF with a vacuum-formed plastic cover that I made for the installation.</p>
<p>Processing 1.0.1</p>
<p>Open CV Library</p>
<p>Webcam (Apple iSight from a MacBook Pro for the installation)</p>
<p>Breadboard (now Perfboard)</p>
<p>Servo</p>
<p>5 Volt Relay</p>
<p>Diode</p>
<p>22-Gauge Solid Wire</p>
<p>12 Volt Power Adapter</p>
<p>Desk Lamp</p>
<p>Extension Cord</p>
<p>USB Cable</p>
<p>Solder</p>
<p>==============================================================</p>
<p>Processing Code:</p>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">import processing.serial.*;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">import hypermedia.video.*;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">OpenCV opencv;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">int contrast_value    = 0;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">int brightness_value  = 0;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">float A = 0;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">Serial myPort;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">void setup() {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">size(1920,1200);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">background(0);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">opencv = new OpenCV( this );</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">opencv.capture( 180,135 );</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">opencv.cascade( OpenCV.CASCADE_FRONTALFACE_ALT );</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">println(Serial.list());</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">myPort = new Serial(this, Serial.list()[0], 9600);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">public void stop() {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">opencv.stop();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">super.stop();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">void draw() {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">A+=15;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">opencv.read();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">opencv.convert( GRAY );</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">opencv.contrast( contrast_value );</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">opencv.brightness( brightness_value );</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">Rectangle[] faces = opencv.detect( 1.2, 2, OpenCV.HAAR_DO_CANNY_PRUNING, 40, 40 );</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">image( opencv.image(), 0, 0 );</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">noFill();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">stroke(255,0,0);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">for( int i=0; i&lt;faces.length; i++ ) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">int faceX = (((int)(faces[i].x)));</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">rect( faces[i].x, faces[i].y, faces[i].width, faces[i].height );</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">println(faceX);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">if((faces[i].y)&gt;25){</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">if(faceX&gt;=60 &amp;&amp; faceX&lt;=100){</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">myPort.write(faceX);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">else if(faceX&lt;50){</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">myPort.write(50);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">else if(faceX&gt;100){</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">myPort.write(100);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">background(0);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">noStroke();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">smooth();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">fill(random(50,255));</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">ellipse(width/2,height/2,15,15);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">noFill();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">noSmooth();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">void mouseDragged() {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">contrast_value   = (int) map( mouseX, 0, width, -128, 128 );</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">brightness_value = (int) map( mouseY, 0, width, -128, 128 );</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1052px;width:1px;height:1px;">}</div>
<p>import processing.serial.*;</p>
<p>import hypermedia.video.*;</p>
<p>OpenCV opencv;</p>
<p>int contrast_value    = 0;</p>
<p>int brightness_value  = 0;</p>
<p>float A = 0;</p>
<p>Serial myPort;</p>
<p>void setup() {</p>
<p>size(1920,1200);</p>
<p>background(0);</p>
<p>opencv = new OpenCV( this );</p>
<p>opencv.capture( 180,135 );</p>
<p>opencv.cascade( OpenCV.CASCADE_FRONTALFACE_ALT );</p>
<p>println(Serial.list());</p>
<p>myPort = new Serial(this, Serial.list()[0], 9600);</p>
<p>}</p>
<p>public void stop() {</p>
<p>opencv.stop();</p>
<p>super.stop();</p>
<p>}</p>
<p>void draw() {</p>
<p>A+=15;</p>
<p>opencv.read();</p>
<p>opencv.convert( GRAY );</p>
<p>opencv.contrast( contrast_value );</p>
<p>opencv.brightness( brightness_value );</p>
<p>Rectangle[] faces = opencv.detect( 1.2, 2, OpenCV.HAAR_DO_CANNY_PRUNING, 40, 40 );</p>
<p>image( opencv.image(), 0, 0 );</p>
<p>noFill();</p>
<p>stroke(255,0,0);</p>
<p>for( int i=0; i&lt;faces.length; i++ ) {</p>
<p>int faceX = (((int)(faces[i].x)));</p>
<p>rect( faces[i].x, faces[i].y, faces[i].width, faces[i].height );</p>
<p>println(faceX);</p>
<p>if((faces[i].y)&gt;25){</p>
<p>if(faceX&gt;=60 &amp;&amp; faceX&lt;=100){</p>
<p>myPort.write(faceX);</p>
<p>}</p>
<p>else if(faceX&lt;50){</p>
<p>myPort.write(50);</p>
<p>}</p>
<p>else if(faceX&gt;100){</p>
<p>myPort.write(100);</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p>background(0);</p>
<p>noStroke();</p>
<p>smooth();</p>
<p>fill(random(50,255));</p>
<p>ellipse(width/2,height/2,15,15);</p>
<p>noFill();</p>
<p>noSmooth();</p>
<p>}</p>
<p>void mouseDragged() {</p>
<p>contrast_value   = (int) map( mouseX, 0, width, -128, 128 );</p>
<p>brightness_value = (int) map( mouseY, 0, width, -128, 128 );</p>
<p>}</p>
<p>==============================================================</p>
<p>Arduino Code:</p>
<p>#include &lt;Servo.h&gt;</p>
<p>int incomingByte = 0;</p>
<p>Servo myservo;</p>
<p>int pos = 0;</p>
<p>int ledPin = 11;</p>
<p>int value = LOW;</p>
<p>long previousMillis = 0;</p>
<p>long interval = 1000;</p>
<p>void setup()</p>
<p>{</p>
<p>pinMode(ledPin, OUTPUT);</p>
<p>myservo.attach(9);</p>
<p>Serial.begin(9600);</p>
<p>}</p>
<p>void loop()</p>
<p>{</p>
<p>if (Serial.available() &gt; 0)  {</p>
<p>incomingByte = Serial.read();</p>
<p>if (incomingByte&gt;50 &amp;&amp; incomingByte&lt;100){</p>
<p>value = LOW;</p>
<p>digitalWrite(ledPin, value);</p>
<p>}</p>
<p>else{</p>
<p>value = HIGH;</p>
<p>digitalWrite(ledPin, value);</p>
<p>}</p>
<p>}</p>
<p>Serial.println(incomingByte);</p>
<p>myservo.write(incomingByte*.75);</p>
<p>}</p>
<div></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/artthatlearns.wordpress.com/718/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/artthatlearns.wordpress.com/718/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/artthatlearns.wordpress.com/718/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/artthatlearns.wordpress.com/718/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/artthatlearns.wordpress.com/718/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/artthatlearns.wordpress.com/718/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/artthatlearns.wordpress.com/718/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/artthatlearns.wordpress.com/718/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/artthatlearns.wordpress.com/718/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/artthatlearns.wordpress.com/718/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/artthatlearns.wordpress.com/718/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/artthatlearns.wordpress.com/718/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/artthatlearns.wordpress.com/718/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/artthatlearns.wordpress.com/718/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=artthatlearns.wordpress.com&amp;blog=6099835&amp;post=718&amp;subd=artthatlearns&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://artthatlearns.wordpress.com/2009/05/07/matts-assignment-3-brighten-your-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mfinder1</media:title>
		</media:content>

		<media:content url="http://artthatlearns.files.wordpress.com/2009/05/img_0671.jpg?w=300" medium="image">
			<media:title type="html">img_0671</media:title>
		</media:content>

		<media:content url="http://artthatlearns.files.wordpress.com/2009/05/img_0687-e.jpg?w=300" medium="image">
			<media:title type="html">img_0687-e</media:title>
		</media:content>

		<media:content url="http://artthatlearns.files.wordpress.com/2009/05/img_0682.jpg?w=225" medium="image">
			<media:title type="html">img_0682</media:title>
		</media:content>

		<media:content url="http://artthatlearns.files.wordpress.com/2009/05/img_0681.jpg?w=225" medium="image">
			<media:title type="html">img_0681</media:title>
		</media:content>
	</item>
		<item>
		<title>Matt&#8217;s Exercise 5 &#8211; Chair Clustering</title>
		<link>http://artthatlearns.wordpress.com/2009/05/07/matts-exercise-5-chair-clustering/</link>
		<comments>http://artthatlearns.wordpress.com/2009/05/07/matts-exercise-5-chair-clustering/#comments</comments>
		<pubDate>Thu, 07 May 2009 16:53:46 +0000</pubDate>
		<dc:creator>mfinder1</dc:creator>
				<category><![CDATA[Exercise 5]]></category>

		<guid isPermaLink="false">http://artthatlearns.wordpress.com/?p=701</guid>
		<description><![CDATA[Above is an image of my Exercise 5. ============================================================== Description: This Processing applet was made to explore how machine learning can be used to cluster chairs into categories. The applet clusters images from a database I made of chairs designed by Verner Panton, Charles and Ray Eames, Le Corbusier, Pierre Jeanneret, Charlotte Perriand, Harry Bertoia, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=artthatlearns.wordpress.com&amp;blog=6099835&amp;post=701&amp;subd=artthatlearns&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-medium wp-image-716" title="chair-clustering" src="http://artthatlearns.files.wordpress.com/2009/05/chair-clustering.jpg?w=300&#038;h=183" alt="chair-clustering" width="300" height="183" /></p>
<p>Above is an image of my Exercise 5.</p>
<p>==============================================================</p>
<p>Description:</p>
<p>This Processing applet was made to explore how machine learning can be used to cluster chairs into categories. The applet clusters images from a database I made of chairs designed by Verner Panton, Charles and Ray Eames, Le Corbusier, Pierre Jeanneret, Charlotte Perriand, Harry Bertoia, and Eero Saarinen. When the applet is ran, it clusters all of the chairs into categories.</p>
<p>==============================================================</p>
<p>Code:</p>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">import wekaizing.*;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">import java.io.File;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">import java.lang.Integer;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">class digitImage {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">int number;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">PImage digit_image;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">int[] pixeldata;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">public digitImage(int image_size) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">pixeldata = new int[image_size*image_size];}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">WekaData digits_data;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">WekaClusterer clusterer;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">digitImage[] digits;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">int NUM_DIGITS = 100;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">int TRAIN_IMAGE_SIZE = 20;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">int NUM_CLUSTERS = 10;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">int[] clusters;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">PFont courier_font;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">void setup() {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">background(0);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">size(1800,1200);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">courier_font = loadFont(&#8220;CourierNew-12.vlw&#8221;);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">textFont(courier_font, 15);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">digits_data = new WekaData();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">for (int i = 0; i &lt; TRAIN_IMAGE_SIZE*TRAIN_IMAGE_SIZE; i++) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">digits_data.AddAttribute(Integer.toString(i));</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">loadDigits(&#8220;digits&#8221;);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">clusterer = new WekaClusterer(WekaClusterer.EM);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">clusters = clusterer.clusterData(digits_data,NUM_CLUSTERS);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">print(&#8220;Training done&#8221;);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">drawResults();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">void loadDigits(String digitfolder) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">File digitfiles = new File(sketchPath, &#8220;data/&#8221; + digitfolder);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">String[] files = digitfiles.list(filter);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">if(files.length &lt; NUM_DIGITS)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">NUM_DIGITS = files.length;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">digits = new digitImage[NUM_DIGITS];</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">String numbers[] = loadStrings(digitfolder + &#8220;/digits.txt&#8221;);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">for (int i = 0; i&lt;NUM_DIGITS ; i++) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">println(&#8220;Loading image &#8221; + files[i]);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">digits[i] = new digitImage(TRAIN_IMAGE_SIZE);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">digits[i].digit_image = loadImage(&#8220;data/&#8221; + digitfolder + &#8220;/&#8221; + files[i]);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">digits[i].number = Integer.valueOf(numbers[i]);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">PImage resizedImg = loadImage(&#8220;data/&#8221; + digitfolder + &#8220;/&#8221; + files[i]);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">resizedImg.resize(TRAIN_IMAGE_SIZE,TRAIN_IMAGE_SIZE);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">resizedImg.loadPixels();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">for (int j = 0; j &lt; TRAIN_IMAGE_SIZE*TRAIN_IMAGE_SIZE; j++) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">digits[i].pixeldata[j] = resizedImg.pixels[j];</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">digits_data.InsertData(digits[i].pixeldata);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">void drawResults() {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">int imgx=0, imgy=0;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">for (int j=0;j&lt;NUM_CLUSTERS;j++)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">{</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">for (int i = 0; i &lt; digits.length; i++) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">if(clusters[i] == j)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">{</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">image(digits[i].digit_image,imgx,imgy);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">imgx += digits[0].digit_image.width;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">if(imgx&gt;width-digits[0].digit_image.width)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">{</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">imgx = 0;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">imgy += digits[0].digit_image.height;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">imgx = 0;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">imgy += digits[0].digit_image.height*1.25;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">stroke(0,255,0);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">line(0,imgy,width,imgy);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">imgy += digits[0].digit_image.height/4;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">FilenameFilter filter = new FilenameFilter() {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;"><span style="white-space:pre;"> </span>public boolean accept(File dir, String name) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;"><span style="white-space:pre;"> </span>if (name.toLowerCase().endsWith(&#8220;.png&#8221;) || name.toLowerCase().endsWith(&#8220;.jpg&#8221;) || name.toLowerCase().endsWith(&#8220;.gif&#8221;)) return true;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;"><span style="white-space:pre;"> </span>return false;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;"><span style="white-space:pre;"> </span>}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">};</div>
<p>import wekaizing.*;</p>
<p>import java.io.File;</p>
<p>import java.lang.Integer;</p>
<p>class digitImage {</p>
<p>int number;</p>
<p>PImage digit_image;</p>
<p>int[] pixeldata;</p>
<p>public digitImage(int image_size) {</p>
<p>pixeldata = new int[image_size*image_size];}</p>
<p>}</p>
<p>WekaData digits_data;</p>
<p>WekaClusterer clusterer;</p>
<p>digitImage[] digits;</p>
<p>int NUM_DIGITS = 100;</p>
<p>int TRAIN_IMAGE_SIZE = 20;</p>
<p>int NUM_CLUSTERS = 10;</p>
<p>int[] clusters;</p>
<p>PFont courier_font;</p>
<p>void setup() {</p>
<p>background(0);</p>
<p>size(1800,1200);</p>
<p>courier_font = loadFont(&#8220;CourierNew-12.vlw&#8221;);</p>
<p>textFont(courier_font, 15);</p>
<p>digits_data = new WekaData();</p>
<p>for (int i = 0; i &lt; TRAIN_IMAGE_SIZE*TRAIN_IMAGE_SIZE; i++) {</p>
<p>digits_data.AddAttribute(Integer.toString(i));</p>
<p>}</p>
<p>loadDigits(&#8220;digits&#8221;);</p>
<p>clusterer = new WekaClusterer(WekaClusterer.EM);</p>
<p>clusters = clusterer.clusterData(digits_data,NUM_CLUSTERS);</p>
<p>print(&#8220;Training done&#8221;);</p>
<p>drawResults();</p>
<p>}</p>
<p>void loadDigits(String digitfolder) {</p>
<p>File digitfiles = new File(sketchPath, &#8220;data/&#8221; + digitfolder);</p>
<p>String[] files = digitfiles.list(filter);</p>
<p>if(files.length &lt; NUM_DIGITS)</p>
<p>NUM_DIGITS = files.length;</p>
<p>digits = new digitImage[NUM_DIGITS];</p>
<p>String numbers[] = loadStrings(digitfolder + &#8220;/digits.txt&#8221;);</p>
<p>for (int i = 0; i&lt;NUM_DIGITS ; i++) {</p>
<p>println(&#8220;Loading image &#8221; + files[i]);</p>
<p>digits[i] = new digitImage(TRAIN_IMAGE_SIZE);</p>
<p>digits[i].digit_image = loadImage(&#8220;data/&#8221; + digitfolder + &#8220;/&#8221; + files[i]);</p>
<p>digits[i].number = Integer.valueOf(numbers[i]);</p>
<p>PImage resizedImg = loadImage(&#8220;data/&#8221; + digitfolder + &#8220;/&#8221; + files[i]);</p>
<p>resizedImg.resize(TRAIN_IMAGE_SIZE,TRAIN_IMAGE_SIZE);</p>
<p>resizedImg.loadPixels();</p>
<p>for (int j = 0; j &lt; TRAIN_IMAGE_SIZE*TRAIN_IMAGE_SIZE; j++) {</p>
<p>digits[i].pixeldata[j] = resizedImg.pixels[j];</p>
<p>}</p>
<p>digits_data.InsertData(digits[i].pixeldata);</p>
<p>}</p>
<p>}</p>
<p>void drawResults() {</p>
<p>int imgx=0, imgy=0;</p>
<p>for (int j=0;j&lt;NUM_CLUSTERS;j++)</p>
<p>{</p>
<p>for (int i = 0; i &lt; digits.length; i++) {</p>
<p>if(clusters[i] == j)</p>
<p>{</p>
<p>image(digits[i].digit_image,imgx,imgy);</p>
<p>imgx += digits[0].digit_image.width;</p>
<p>if(imgx&gt;width-digits[0].digit_image.width)</p>
<p>{</p>
<p>imgx = 0;</p>
<p>imgy += digits[0].digit_image.height;</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p>imgx = 0;</p>
<p>imgy += digits[0].digit_image.height*1.25;</p>
<p>stroke(0,255,0);</p>
<p>line(0,imgy,width,imgy);</p>
<p>imgy += digits[0].digit_image.height/4;</p>
<p>}</p>
<p>}</p>
<p>FilenameFilter filter = new FilenameFilter() {</p>
<p><span style="white-space:pre;"> </span>public boolean accept(File dir, String name) {</p>
<p><span style="white-space:pre;"> </span>if (name.toLowerCase().endsWith(&#8220;.png&#8221;) || name.toLowerCase().endsWith(&#8220;.jpg&#8221;) || name.toLowerCase().endsWith(&#8220;.gif&#8221;)) return true;</p>
<p><span style="white-space:pre;"> </span>return false;</p>
<p><span style="white-space:pre;"> </span>}</p>
<p>};</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/artthatlearns.wordpress.com/701/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/artthatlearns.wordpress.com/701/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/artthatlearns.wordpress.com/701/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/artthatlearns.wordpress.com/701/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/artthatlearns.wordpress.com/701/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/artthatlearns.wordpress.com/701/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/artthatlearns.wordpress.com/701/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/artthatlearns.wordpress.com/701/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/artthatlearns.wordpress.com/701/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/artthatlearns.wordpress.com/701/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/artthatlearns.wordpress.com/701/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/artthatlearns.wordpress.com/701/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/artthatlearns.wordpress.com/701/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/artthatlearns.wordpress.com/701/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=artthatlearns.wordpress.com&amp;blog=6099835&amp;post=701&amp;subd=artthatlearns&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://artthatlearns.wordpress.com/2009/05/07/matts-exercise-5-chair-clustering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mfinder1</media:title>
		</media:content>

		<media:content url="http://artthatlearns.files.wordpress.com/2009/05/chair-clustering.jpg?w=300" medium="image">
			<media:title type="html">chair-clustering</media:title>
		</media:content>
	</item>
		<item>
		<title>Matt&#8217;s Exercise 4 &#8211; Chair Classification</title>
		<link>http://artthatlearns.wordpress.com/2009/05/07/matts-exercise-4-chair-classification/</link>
		<comments>http://artthatlearns.wordpress.com/2009/05/07/matts-exercise-4-chair-classification/#comments</comments>
		<pubDate>Thu, 07 May 2009 16:53:43 +0000</pubDate>
		<dc:creator>mfinder1</dc:creator>
				<category><![CDATA[Exercise 4]]></category>

		<guid isPermaLink="false">http://artthatlearns.wordpress.com/?p=700</guid>
		<description><![CDATA[Above is an image of my Exercise 4. ============================================================== Description: This Processing applet was made to explore how machine learning can be used to classify chairs. The applet classifies images from a database I made of chairs designed by Verner Panton, Charles and Ray Eames, Le Corbusier, Pierre Jeanneret, Charlotte Perriand, Harry Bertoia, and Eero [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=artthatlearns.wordpress.com&amp;blog=6099835&amp;post=700&amp;subd=artthatlearns&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-medium wp-image-712" title="chair-classification" src="http://artthatlearns.files.wordpress.com/2009/05/chair-classification.jpg?w=300&#038;h=300" alt="chair-classification" width="300" height="300" /></p>
<p>Above is an image of my Exercise 4.</p>
<p>==============================================================</p>
<p>Description:</p>
<p>This Processing applet was made to explore how machine learning can be used to classify chairs. The applet classifies images from a database I made of chairs designed by Verner Panton, Charles and Ray Eames, Le Corbusier, Pierre Jeanneret, Charlotte Perriand, Harry Bertoia, and Eero Saarinen. When the applet is ran, it chooses nine chair images and tries to classify them by their designers. The number on the top left of each image represents the actual designer of the chair and the number on the top right of each image represents the applet&#8217;s guess for the the designer of the chair. The applet learns from a database of chairs and their designers prior to choosing the nine to guess, and the applet&#8217;s guess is displayed in red if it is incorrect, and is displayed in green if it is correct. The designers that the numbers represent are as follows:</p>
<p>1:  Bertoia</p>
<p>2:  Eames</p>
<p>3:  Panton</p>
<p>4:  Saarinen</p>
<p>5:  Le Corbusier, Jeanneret, and Perriand</p>
<p>==============================================================</p>
<p>Code:</p>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">import wekaizing.*;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">import java.io.File;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">import java.lang.Integer;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">class digitImage {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">int number;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">PImage digit;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">int[] pixeldata;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">public digitImage() {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">pixeldata = new int[101];}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">WekaData digitsTrain;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">WekaData digitsTest;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">WekaClassifier classifier;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">digitImage[] digits;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">int[] results;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">PFont HNL_font;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">void setup() {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">background(0);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">size(680,680);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">HNL_font = loadFont(&#8220;HelveticaNeue-Light-100.vlw&#8221;);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">textFont(HNL_font, 15);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">digitsTrain = new WekaData();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">digitsTest = new WekaData();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">for (int i = 0; i &lt; 100; i++) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">digitsTrain.AddAttribute(Integer.toString(i));</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">digitsTest.AddAttribute(Integer.toString(i));</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">Object[] digitarray = new Object[] {0,1,2,3,4,5,6,7,8,9};</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">digitsTrain.AddAttribute(&#8220;digit&#8221;,digitarray);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">digitsTest.AddAttribute(&#8220;digit&#8221;,digitarray);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">loadDigits(&#8220;digits&#8221;);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">digitsTrain.setClassIndex(100);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">digitsTest.setClassIndex(100);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">classifier = new WekaClassifier(WekaClassifier.LOGISTIC);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">classifier.Build(digitsTrain);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">print(&#8220;Training done&#8221;);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">results = classifier.Classify(digitsTest);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">print(&#8220;Classification done&#8221;);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">drawResults();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">void loadDigits(String digitfolder) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">File digitfiles = new File(sketchPath, &#8220;data/&#8221; + digitfolder);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">String[] files = digitfiles.list(filter);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">digits = new digitImage[files.length];</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">String numbers[] = loadStrings(digitfolder + &#8220;/digits.txt&#8221;);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">for (int i = 0; i &lt; files.length; i++) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">println(&#8220;Loading image &#8221; + files[i]);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">digits[i] = new digitImage();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">digits[i].digit = loadImage(&#8220;data/&#8221; + digitfolder + &#8220;/&#8221; + files[i]);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">digits[i].number = Integer.valueOf(numbers[i]);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">PImage resizedImg = loadImage(&#8220;data/&#8221; + digitfolder + &#8220;/&#8221; + files[i]);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">resizedImg.resize(10,10);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">resizedImg.loadPixels();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">for (int j = 0; j &lt; 100; j++) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">digits[i].pixeldata[j] = resizedImg.pixels[j];</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">digits[i].pixeldata[100] = digits[i].number;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">if (i &lt; 40) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">digitsTest.InsertData(digits[i].pixeldata);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">} else {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">digitsTrain.InsertData(digits[i].pixeldata);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">void drawResults() {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">float num_correct = 0.0, total = 0.0;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">int imgx, imgy;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">for (int i = 0; i &lt; 12; i++) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">imgx = (i % 3) * 220 + 20;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">imgy = (i / 3) * 220 + 20;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">image(digits[i].digit,imgx,imgy);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">for (int i = 0; i &lt; 9; i++) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">imgx = (i % 3) * 220 + 25;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">imgy = (i / 3) * 220 + 35;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">fill(0);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">text(digits[i].number, imgx, imgy);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">if(digits[i].number == results[i]){</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">fill(0,255,0);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">else{</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">fill(255,0,0);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">text(results[i], imgx + 180, imgy);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">total += 1.0;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">if(digits[i].number == results[i])</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">num_correct += 1.0;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">println(&#8220;\n&#8221; + &#8220;Accuracy = &#8221; + num_correct/total*40 + &#8220;%&#8221;);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">FilenameFilter filter = new FilenameFilter() {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;"><span style="white-space:pre;"> </span>public boolean accept(File dir, String name) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;"><span style="white-space:pre;"> </span>if (name.toLowerCase().endsWith(&#8220;.png&#8221;) || name.toLowerCase().endsWith(&#8220;.jpg&#8221;) || name.toLowerCase().endsWith(&#8220;.gif&#8221;)) return true;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;"><span style="white-space:pre;"> </span>return false;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;"><span style="white-space:pre;"> </span>}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:242px;width:1px;height:1px;">};</div>
<p>import wekaizing.*;</p>
<p>import java.io.File;</p>
<p>import java.lang.Integer;</p>
<p>class digitImage {</p>
<p>int number;</p>
<p>PImage digit;</p>
<p>int[] pixeldata;</p>
<p>public digitImage() {</p>
<p>pixeldata = new int[101];}</p>
<p>}</p>
<p>WekaData digitsTrain;</p>
<p>WekaData digitsTest;</p>
<p>WekaClassifier classifier;</p>
<p>digitImage[] digits;</p>
<p>int[] results;</p>
<p>PFont HNL_font;</p>
<p>void setup() {</p>
<p>background(0);</p>
<p>size(680,680);</p>
<p>HNL_font = loadFont(&#8220;HelveticaNeue-Light-100.vlw&#8221;);</p>
<p>textFont(HNL_font, 15);</p>
<p>digitsTrain = new WekaData();</p>
<p>digitsTest = new WekaData();</p>
<p>for (int i = 0; i &lt; 100; i++) {</p>
<p>digitsTrain.AddAttribute(Integer.toString(i));</p>
<p>digitsTest.AddAttribute(Integer.toString(i));</p>
<p>}</p>
<p>Object[] digitarray = new Object[] {0,1,2,3,4,5,6,7,8,9};</p>
<p>digitsTrain.AddAttribute(&#8220;digit&#8221;,digitarray);</p>
<p>digitsTest.AddAttribute(&#8220;digit&#8221;,digitarray);</p>
<p>loadDigits(&#8220;digits&#8221;);</p>
<p>digitsTrain.setClassIndex(100);</p>
<p>digitsTest.setClassIndex(100);</p>
<p>classifier = new WekaClassifier(WekaClassifier.LOGISTIC);</p>
<p>classifier.Build(digitsTrain);</p>
<p>print(&#8220;Training done&#8221;);</p>
<p>results = classifier.Classify(digitsTest);</p>
<p>print(&#8220;Classification done&#8221;);</p>
<p>drawResults();</p>
<p>}</p>
<p>void loadDigits(String digitfolder) {</p>
<p>File digitfiles = new File(sketchPath, &#8220;data/&#8221; + digitfolder);</p>
<p>String[] files = digitfiles.list(filter);</p>
<p>digits = new digitImage[files.length];</p>
<p>String numbers[] = loadStrings(digitfolder + &#8220;/digits.txt&#8221;);</p>
<p>for (int i = 0; i &lt; files.length; i++) {</p>
<p>println(&#8220;Loading image &#8221; + files[i]);</p>
<p>digits[i] = new digitImage();</p>
<p>digits[i].digit = loadImage(&#8220;data/&#8221; + digitfolder + &#8220;/&#8221; + files[i]);</p>
<p>digits[i].number = Integer.valueOf(numbers[i]);</p>
<p>PImage resizedImg = loadImage(&#8220;data/&#8221; + digitfolder + &#8220;/&#8221; + files[i]);</p>
<p>resizedImg.resize(10,10);</p>
<p>resizedImg.loadPixels();</p>
<p>for (int j = 0; j &lt; 100; j++) {</p>
<p>digits[i].pixeldata[j] = resizedImg.pixels[j];</p>
<p>}</p>
<p>digits[i].pixeldata[100] = digits[i].number;</p>
<p>if (i &lt; 40) {</p>
<p>digitsTest.InsertData(digits[i].pixeldata);</p>
<p>} else {</p>
<p>digitsTrain.InsertData(digits[i].pixeldata);</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p>void drawResults() {</p>
<p>float num_correct = 0.0, total = 0.0;</p>
<p>int imgx, imgy;</p>
<p>for (int i = 0; i &lt; 12; i++) {</p>
<p>imgx = (i % 3) * 220 + 20;</p>
<p>imgy = (i / 3) * 220 + 20;</p>
<p>image(digits[i].digit,imgx,imgy);</p>
<p>}</p>
<p>for (int i = 0; i &lt; 9; i++) {</p>
<p>imgx = (i % 3) * 220 + 25;</p>
<p>imgy = (i / 3) * 220 + 35;</p>
<p>fill(0);</p>
<p>text(digits[i].number, imgx, imgy);</p>
<p>if(digits[i].number == results[i]){</p>
<p>fill(0,255,0);</p>
<p>}</p>
<p>else{</p>
<p>fill(255,0,0);</p>
<p>}</p>
<p>text(results[i], imgx + 180, imgy);</p>
<p>total += 1.0;</p>
<p>if(digits[i].number == results[i])</p>
<p>num_correct += 1.0;</p>
<p>}</p>
<p>println(&#8220;\n&#8221; + &#8220;Accuracy = &#8221; + num_correct/total*40 + &#8220;%&#8221;);</p>
<p>}</p>
<p>FilenameFilter filter = new FilenameFilter() {</p>
<p><span style="white-space:pre;"> </span>public boolean accept(File dir, String name) {</p>
<p><span style="white-space:pre;"> </span>if (name.toLowerCase().endsWith(&#8220;.png&#8221;) || name.toLowerCase().endsWith(&#8220;.jpg&#8221;) || name.toLowerCase().endsWith(&#8220;.gif&#8221;)) return true;</p>
<p><span style="white-space:pre;"> </span>return false;</p>
<p><span style="white-space:pre;"> </span>}</p>
<p>};</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/artthatlearns.wordpress.com/700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/artthatlearns.wordpress.com/700/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/artthatlearns.wordpress.com/700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/artthatlearns.wordpress.com/700/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/artthatlearns.wordpress.com/700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/artthatlearns.wordpress.com/700/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/artthatlearns.wordpress.com/700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/artthatlearns.wordpress.com/700/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/artthatlearns.wordpress.com/700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/artthatlearns.wordpress.com/700/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/artthatlearns.wordpress.com/700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/artthatlearns.wordpress.com/700/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/artthatlearns.wordpress.com/700/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/artthatlearns.wordpress.com/700/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=artthatlearns.wordpress.com&amp;blog=6099835&amp;post=700&amp;subd=artthatlearns&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://artthatlearns.wordpress.com/2009/05/07/matts-exercise-4-chair-classification/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mfinder1</media:title>
		</media:content>

		<media:content url="http://artthatlearns.files.wordpress.com/2009/05/chair-classification.jpg?w=300" medium="image">
			<media:title type="html">chair-classification</media:title>
		</media:content>
	</item>
		<item>
		<title>Matt&#8217;s Exercise 3 &#8211; Logo Similarity</title>
		<link>http://artthatlearns.wordpress.com/2009/05/07/matts-exercise-3-logo-similarity/</link>
		<comments>http://artthatlearns.wordpress.com/2009/05/07/matts-exercise-3-logo-similarity/#comments</comments>
		<pubDate>Thu, 07 May 2009 16:53:42 +0000</pubDate>
		<dc:creator>mfinder1</dc:creator>
				<category><![CDATA[Exercise 3]]></category>

		<guid isPermaLink="false">http://artthatlearns.wordpress.com/?p=699</guid>
		<description><![CDATA[Above is an image of my Exercise 3. ============================================================== Description: This Processing applet was made to explore how machine learning can be used to sort logos by similarity. The applet looks at a collection of logos and sorts them based on how similar they are to a user-chosen logo from the collection. The logos all [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=artthatlearns.wordpress.com&amp;blog=6099835&amp;post=699&amp;subd=artthatlearns&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-medium wp-image-704" title="logos" src="http://artthatlearns.files.wordpress.com/2009/05/logos.jpg?w=300&#038;h=168" alt="logos" width="300" height="168" /></p>
<p>Above is an image of my Exercise 3.</p>
<p>==============================================================</p>
<p>Description:</p>
<p>This Processing applet was made to explore how machine learning can be used to sort logos by similarity. The applet looks at a collection of logos and sorts them based on how similar they are to a user-chosen logo from the collection. The logos all begin at full brightness, and when a logo is chosen, the other logos fade to black until they are sorted with the most similar logo as the brightest and the least similar logo as the darkest.</p>
<p>==============================================================</p>
<p>Code:</p>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">import java.io.File;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">import java.io.FilenameFilter;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">import imagelib.*;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">import similarity.*;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">ArrayList histograms;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">PImage[] images;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">int picIndex;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">float px = 0;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">float py = 0;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">float pz = 0;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">float mx = 0;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">float my = 0;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">float circleX = 0;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">float circleY = 0;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">float circleDiameter = 0;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">float colorVariable = 0;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">float opacity;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">float vOpacity;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">float vBoxOpacity;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">int colorStart;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">int frame;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">color c;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">float boxOpacity = 17;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">//float idealBoxOpacity;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">void setup() {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">picIndex=-1;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">size(1280,720);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">File datafolder = new File(sketchPath, &#8220;data&#8221;);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">String[] files = datafolder.list(filter);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">if (files==null|files.length&lt;1){</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">println(&#8220;You must add images in jpg format to the data subdirectory of your sketch.&#8221;);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">exit();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">images = new PImage[files.length];</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">int num_bins = 6;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">histograms = new ArrayList(files.length);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">double[] histogram;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">for (int i = 0; i &lt; files.length; i++) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">println(files[i]);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">images[i] = loadImage(files[i]);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">histogram = ImageParsing.histHue(this, images[i],num_bins);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">histograms.add(i, histogram);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">resetImages();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">fill(0,220);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">rect(0,0, 1280,720);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">noFill();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">void resetImages() {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">int picy = 0;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">int picx = 0;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">background(255);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">for (int i = 0; i &lt; images.length ;i++) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">if (picx &gt;= width) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">picx = 0;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">picy += 240;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">image(images[i],picx,picy,320,240);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">picx += 320;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">void draw() {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">smooth();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">noStroke();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">float A = 0.90;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">float B = 1.0-A;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">mx = A*mx + B*mouseX;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">my = A*my + B*mouseY;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">circleDiameter = 40;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">vOpacity = -10;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">opacity = vOpacity+opacity;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">if(opacity&lt;25){</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">opacity=25;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">if(picIndex&gt;-1){</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">markSimilars(picIndex);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">void mousePressed() {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">boxOpacity = 0;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">opacity = 255;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">c = color(random(0,255),random(150,255),random(0,255));</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">if (mouseButton == LEFT) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">picIndex = (mouseY / 240) * 4 + mouseX / 320;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">if (picIndex &lt; images.length) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">markSimilars(picIndex);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">void markSimilars(int index) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">int rectx, recty;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">resetImages();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">int[] similars = Similarity.similarVectors(histograms, index);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">PFont Serif_48;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">Serif_48 = loadFont(&#8220;Serif-48.vlw&#8221;);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">textFont(Serif_48, 48);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">for (int i = 0; i &lt; similars.length; i++) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">println(i);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">rectx = (similars[i] % 4) * 320;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">recty = (similars[i] / 4) * 240;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">/*fill(255,255,0);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">text(i,rectx+30,recty+90);*/</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">float idealBoxOpacity = (i+1)*20;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">println(idealBoxOpacity);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">if(boxOpacity&gt;idealBoxOpacity){</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">vBoxOpacity = -2;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">boxOpacity = vBoxOpacity+boxOpacity;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">else if(boxOpacity&lt;idealBoxOpacity){</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">vBoxOpacity = 2;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">boxOpacity = vBoxOpacity+boxOpacity;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">else{</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">boxOpacity=idealBoxOpacity;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">fill(0,boxOpacity);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">noStroke();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">rect(rectx,recty,320,240);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">FilenameFilter filter = new FilenameFilter() {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">public boolean accept(File dir, String name) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">if (name.toLowerCase().endsWith(&#8220;.jpg&#8221;)) return true;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">return false;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:44px;width:1px;height:1px;">};</div>
<p>import java.io.File;</p>
<p>import java.io.FilenameFilter;</p>
<p>import imagelib.*;</p>
<p>import similarity.*;</p>
<p>ArrayList histograms;</p>
<p>PImage[] images;</p>
<p>int picIndex;</p>
<p>float px = 0;</p>
<p>float py = 0;</p>
<p>float pz = 0;</p>
<p>float mx = 0;</p>
<p>float my = 0;</p>
<p>float circleX = 0;</p>
<p>float circleY = 0;</p>
<p>float circleDiameter = 0;</p>
<p>float colorVariable = 0;</p>
<p>float opacity;</p>
<p>float vOpacity;</p>
<p>float vBoxOpacity;</p>
<p>int colorStart;</p>
<p>int frame;</p>
<p>color c;</p>
<p>float boxOpacity = 17;</p>
<p>//float idealBoxOpacity;</p>
<p>void setup() {</p>
<p>picIndex=-1;</p>
<p>size(1280,720);</p>
<p>File datafolder = new File(sketchPath, &#8220;data&#8221;);</p>
<p>String[] files = datafolder.list(filter);</p>
<p>if (files==null|files.length&lt;1){</p>
<p>println(&#8220;You must add images in jpg format to the data subdirectory of your sketch.&#8221;);</p>
<p>exit();</p>
<p>}</p>
<p>images = new PImage[files.length];</p>
<p>int num_bins = 6;</p>
<p>histograms = new ArrayList(files.length);</p>
<p>double[] histogram;</p>
<p>for (int i = 0; i &lt; files.length; i++) {</p>
<p>println(files[i]);</p>
<p>images[i] = loadImage(files[i]);</p>
<p>histogram = ImageParsing.histHue(this, images[i],num_bins);</p>
<p>histograms.add(i, histogram);</p>
<p>}</p>
<p>resetImages();</p>
<p>fill(0,220);</p>
<p>rect(0,0, 1280,720);</p>
<p>noFill();</p>
<p>}</p>
<p>void resetImages() {</p>
<p>int picy = 0;</p>
<p>int picx = 0;</p>
<p>background(255);</p>
<p>for (int i = 0; i &lt; images.length ;i++) {</p>
<p>if (picx &gt;= width) {</p>
<p>picx = 0;</p>
<p>picy += 240;</p>
<p>}</p>
<p>image(images[i],picx,picy,320,240);</p>
<p>picx += 320;</p>
<p>}</p>
<p>}</p>
<p>void draw() {</p>
<p>smooth();</p>
<p>noStroke();</p>
<p>float A = 0.90;</p>
<p>float B = 1.0-A;</p>
<p>mx = A*mx + B*mouseX;</p>
<p>my = A*my + B*mouseY;</p>
<p>circleDiameter = 40;</p>
<p>vOpacity = -10;</p>
<p>opacity = vOpacity+opacity;</p>
<p>if(opacity&lt;25){</p>
<p>opacity=25;</p>
<p>}</p>
<p>if(picIndex&gt;-1){</p>
<p>markSimilars(picIndex);</p>
<p>}</p>
<p>}</p>
<p>void mousePressed() {</p>
<p>boxOpacity = 0;</p>
<p>opacity = 255;</p>
<p>c = color(random(0,255),random(150,255),random(0,255));</p>
<p>if (mouseButton == LEFT) {</p>
<p>picIndex = (mouseY / 240) * 4 + mouseX / 320;</p>
<p>if (picIndex &lt; images.length) {</p>
<p>markSimilars(picIndex);</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p>void markSimilars(int index) {</p>
<p>int rectx, recty;</p>
<p>resetImages();</p>
<p>int[] similars = Similarity.similarVectors(histograms, index);</p>
<p>PFont Serif_48;</p>
<p>Serif_48 = loadFont(&#8220;Serif-48.vlw&#8221;);</p>
<p>textFont(Serif_48, 48);</p>
<p>for (int i = 0; i &lt; similars.length; i++) {</p>
<p>println(i);</p>
<p>rectx = (similars[i] % 4) * 320;</p>
<p>recty = (similars[i] / 4) * 240;</p>
<p>/*fill(255,255,0);</p>
<p>text(i,rectx+30,recty+90);*/</p>
<p>float idealBoxOpacity = (i+1)*20;</p>
<p>println(idealBoxOpacity);</p>
<p>if(boxOpacity&gt;idealBoxOpacity){</p>
<p>vBoxOpacity = -2;</p>
<p>boxOpacity = vBoxOpacity+boxOpacity;</p>
<p>}</p>
<p>else if(boxOpacity&lt;idealBoxOpacity){</p>
<p>vBoxOpacity = 2;</p>
<p>boxOpacity = vBoxOpacity+boxOpacity;</p>
<p>}</p>
<p>else{</p>
<p>boxOpacity=idealBoxOpacity;</p>
<p>}</p>
<p>fill(0,boxOpacity);</p>
<p>noStroke();</p>
<p>rect(rectx,recty,320,240);</p>
<p>}</p>
<p>}</p>
<p>FilenameFilter filter = new FilenameFilter() {</p>
<p>public boolean accept(File dir, String name) {</p>
<p>if (name.toLowerCase().endsWith(&#8220;.jpg&#8221;)) return true;</p>
<p>return false;</p>
<p>}</p>
<p>};</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/artthatlearns.wordpress.com/699/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/artthatlearns.wordpress.com/699/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/artthatlearns.wordpress.com/699/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/artthatlearns.wordpress.com/699/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/artthatlearns.wordpress.com/699/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/artthatlearns.wordpress.com/699/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/artthatlearns.wordpress.com/699/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/artthatlearns.wordpress.com/699/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/artthatlearns.wordpress.com/699/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/artthatlearns.wordpress.com/699/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/artthatlearns.wordpress.com/699/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/artthatlearns.wordpress.com/699/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/artthatlearns.wordpress.com/699/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/artthatlearns.wordpress.com/699/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=artthatlearns.wordpress.com&amp;blog=6099835&amp;post=699&amp;subd=artthatlearns&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://artthatlearns.wordpress.com/2009/05/07/matts-exercise-3-logo-similarity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mfinder1</media:title>
		</media:content>

		<media:content url="http://artthatlearns.files.wordpress.com/2009/05/logos.jpg?w=300" medium="image">
			<media:title type="html">logos</media:title>
		</media:content>
	</item>
		<item>
		<title>Matt&#8217;s Exercise 2 &#8211; Interactive Driving Applet</title>
		<link>http://artthatlearns.wordpress.com/2009/05/07/matts-exercise-2-interactive-driving-applet/</link>
		<comments>http://artthatlearns.wordpress.com/2009/05/07/matts-exercise-2-interactive-driving-applet/#comments</comments>
		<pubDate>Thu, 07 May 2009 16:53:41 +0000</pubDate>
		<dc:creator>mfinder1</dc:creator>
				<category><![CDATA[Exercise 2]]></category>

		<guid isPermaLink="false">http://artthatlearns.wordpress.com/?p=675</guid>
		<description><![CDATA[Above is a short video of my Exercise 2 and the physical interface that I made to control it. ============================================================== Description: This interactive driving applet consists of a Processing applet that simulates a road and a physical interface that controls it.  The physical interface was created by rewiring an optical mouse to switches and mounting [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=artthatlearns.wordpress.com&amp;blog=6099835&amp;post=675&amp;subd=artthatlearns&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="line-height:19px;font:normal normal normal 13px/normal Georgia;text-align:left;margin:0 0 13px;"><span style="text-align:center; display: block;"><a href="http://artthatlearns.wordpress.com/2009/05/07/matts-exercise-2-interactive-driving-applet/"><img src="http://img.youtube.com/vi/Ud1g6NtLbOY/2.jpg" alt="" /></a></span></p>
<p style="line-height:19px;font:normal normal normal 13px/normal Georgia;margin:0 0 13px;"><img class="aligncenter size-medium wp-image-692" title="dsc_00021" src="http://artthatlearns.files.wordpress.com/2009/05/dsc_00021.jpg?w=300&#038;h=199" alt="dsc_00021" width="300" height="199" /></p>
<p style="line-height:19px;font:normal normal normal 13px/normal Georgia;margin:0 0 13px;">Above is a short video of my Exercise 2 and the physical interface that I made to control it.</p>
<p style="line-height:19px;font:normal normal normal 13px/normal Georgia;margin:0 0 13px;"><span style="line-height:19px;">==============================================================</span></p>
<p style="line-height:19px;font:normal normal normal 13px/normal Georgia;margin:0 0 13px;">Description:</p>
<p style="line-height:19px;font:normal normal normal 13px/normal Georgia;margin:0 0 13px;">This interactive driving applet consists of a Processing applet that simulates a road and a physical interface that controls it.  The physical interface was created by rewiring an optical mouse to switches and mounting them in a foam core enclosure that I made to resemble a car interior.</p>
<p style="line-height:19px;font:normal normal normal 13px/normal Georgia;margin:0 0 13px;"><span style="line-height:19px;">==============================================================</span></p>
<p style="line-height:19px;font:normal normal normal 13px/normal Georgia;margin:0 0 13px;">Controls:</p>
<p style="line-height:19px;font:normal normal normal 13px/normal Georgia;margin:0 0 13px;">Steering Wheel/Mouse Wheel: Turn left or right.</p>
<p style="line-height:19px;font:normal normal normal 13px/normal Georgia;margin:0 0 13px;">Gas Pedal/Left Click: Accelerate.</p>
<p style="line-height:19px;font:normal normal normal 13px/normal Georgia;margin:0 0 13px;">Shifter/Right Click: Reverse On/Off.</p>
<p style="line-height:19px;font:normal normal normal 13px/normal Georgia;margin:0 0 13px;">Brake Pedal/Middle Click: Brake.</p>
<p style="line-height:19px;font:normal normal normal 13px/normal Georgia;margin:0 0 13px;"><span style="line-height:19px;">==============================================================</span></p>
<p style="line-height:19px;font:normal normal normal 13px/normal Georgia;margin:0 0 13px;">Code:</p>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">PImage road;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">float y = -1200;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">boolean inDrive;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">boolean inReverse;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">boolean brake;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">boolean turnLeft;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">boolean turnRight;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">void setup(){</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">addMouseWheelListener(new java.awt.event.MouseWheelListener() {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">mouseWheel(evt.getWheelRotation());</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">road = loadImage (&#8220;Road.jpg&#8221;);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">size(800,600);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">background(0);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">void mousePressed() {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">if ( (mouseEvent.getModifiers() &amp; InputEvent.BUTTON2_MASK) != 0) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">inDrive=false;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">inReverse=false;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">brake=true;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">else if (mouseButton==LEFT){</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">inReverse=false;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">brake=false;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">inDrive=true;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">else if (mouseButton==RIGHT) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">inDrive=false;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">brake=false;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">inReverse=true;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">else if(mouseButton!=RIGHT){</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">inReverse=false;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">void draw(){</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">if(y&gt;0){</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">y=-1600;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">if(y&lt;-1600){</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">y=0;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">if(inDrive){</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">y+=20;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">if(inReverse){</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">y-=10;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">if(turnLeft){</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">rotate(PI/10);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">if(turnRight){</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">rotate(-PI/10);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">image(road,-200,y);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">void mouseWheel(int delta) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">println(delta);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">if(delta&lt;0){</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">turnLeft=false;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">turnRight=true;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">if(delta&gt;0){</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">turnRight=false;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">turnLeft=true;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:121px;width:1px;height:1px;">}</div>
<p>PImage road;</p>
<p>float y = -1200;</p>
<p>boolean inDrive;</p>
<p>boolean inReverse;</p>
<p>boolean brake;</p>
<p>boolean turnLeft;</p>
<p>boolean turnRight;</p>
<p>void setup(){</p>
<p>addMouseWheelListener(new java.awt.event.MouseWheelListener() {</p>
<p>public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {</p>
<p>mouseWheel(evt.getWheelRotation());</p>
<p>}</p>
<p>}</p>
<p>);</p>
<p>road = loadImage (&#8220;Road.jpg&#8221;);</p>
<p>size(800,600);</p>
<p>background(0);</p>
<p>}</p>
<p>void mousePressed() {</p>
<p>if ( (mouseEvent.getModifiers() &amp; InputEvent.BUTTON2_MASK) != 0) {</p>
<p>inDrive=false;</p>
<p>inReverse=false;</p>
<p>brake=true;</p>
<p>}</p>
<p>else if (mouseButton==LEFT){</p>
<p>inReverse=false;</p>
<p>brake=false;</p>
<p>inDrive=true;</p>
<p>}</p>
<p>else if (mouseButton==RIGHT) {</p>
<p>inDrive=false;</p>
<p>brake=false;</p>
<p>inReverse=true;</p>
<p>}</p>
<p>else if(mouseButton!=RIGHT){</p>
<p>inReverse=false;</p>
<p>}</p>
<p>}</p>
<p>void draw(){</p>
<p>if(y&gt;0){</p>
<p>y=-1600;</p>
<p>}</p>
<p>if(y&lt;-1600){</p>
<p>y=0;</p>
<p>}</p>
<p>if(inDrive){</p>
<p>y+=20;</p>
<p>}</p>
<p>if(inReverse){</p>
<p>y-=10;</p>
<p>}</p>
<p>if(turnLeft){</p>
<p>rotate(PI/10);</p>
<p>}</p>
<p>if(turnRight){</p>
<p>rotate(-PI/10);</p>
<p>}</p>
<p>image(road,-200,y);</p>
<p>}</p>
<p>void mouseWheel(int delta) {</p>
<p>println(delta);</p>
<p>if(delta&lt;0){</p>
<p>turnLeft=false;</p>
<p>turnRight=true;</p>
<p>}</p>
<p>if(delta&gt;0){</p>
<p>turnRight=false;</p>
<p>turnLeft=true;</p>
<p>}</p>
<p>}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/artthatlearns.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/artthatlearns.wordpress.com/675/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/artthatlearns.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/artthatlearns.wordpress.com/675/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/artthatlearns.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/artthatlearns.wordpress.com/675/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/artthatlearns.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/artthatlearns.wordpress.com/675/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/artthatlearns.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/artthatlearns.wordpress.com/675/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/artthatlearns.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/artthatlearns.wordpress.com/675/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/artthatlearns.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/artthatlearns.wordpress.com/675/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=artthatlearns.wordpress.com&amp;blog=6099835&amp;post=675&amp;subd=artthatlearns&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://artthatlearns.wordpress.com/2009/05/07/matts-exercise-2-interactive-driving-applet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mfinder1</media:title>
		</media:content>

		<media:content url="http://artthatlearns.files.wordpress.com/2009/05/dsc_00021.jpg?w=300" medium="image">
			<media:title type="html">dsc_00021</media:title>
		</media:content>
	</item>
		<item>
		<title>Matt&#8217;s Exercise 1 &#8211; To Disney&#8217;s Main Street Electrical Parade</title>
		<link>http://artthatlearns.wordpress.com/2009/05/07/matts-exercise-1-to-disneys-main-street-electrical-parade/</link>
		<comments>http://artthatlearns.wordpress.com/2009/05/07/matts-exercise-1-to-disneys-main-street-electrical-parade/#comments</comments>
		<pubDate>Thu, 07 May 2009 16:53:40 +0000</pubDate>
		<dc:creator>mfinder1</dc:creator>
				<category><![CDATA[Exercise 1]]></category>

		<guid isPermaLink="false">http://artthatlearns.wordpress.com/?p=667</guid>
		<description><![CDATA[Above is a short video of my Exercise 1 along with the song for which it was made. ============================================================== Description: This interactive applet features colored tiles that can be &#8220;played&#8221; to a song of the user&#8217;s choice, in this case, Disney&#8217;s Main Street Electrical Parade. ============================================================== Controls: &#8217;1&#8242;: Play and/or pause the song. Left and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=artthatlearns.wordpress.com&amp;blog=6099835&amp;post=667&amp;subd=artthatlearns&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;"><span style="text-align:center; display: block;"><a href="http://artthatlearns.wordpress.com/2009/05/07/matts-exercise-1-to-disneys-main-street-electrical-parade/"><img src="http://img.youtube.com/vi/YEJqPfN1QqA/2.jpg" alt="" /></a></span></p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">Above is a short video of my Exercise 1 along with the song for which it was made.</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">==============================================================</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">Description:</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">This interactive applet features colored tiles that can be &#8220;played&#8221; to a song of the user&#8217;s choice, in this case, Disney&#8217;s Main Street Electrical Parade.</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">==============================================================</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">Controls:</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">&#8217;1&#8242;: Play and/or pause the song.</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">Left and Right Mouse Click: Large and small white tiles that vary slightly in size and appear where the mouse is clicked.</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">&#8216;V&#8217;,'B&#8217;,'N&#8217;, and &#8216;M&#8217;: The middle four colored tiles of the applet.</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">&#8216;A&#8217;,'S&#8217;,'D&#8217;,'F&#8217;,'J&#8217;,'K&#8217;,'L&#8217;,';&#8217;: The 16 little colored tiles on the top and bottom of the applet.</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">==============================================================</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">Code:</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">import ddf.minim.*;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">AudioPlayer player;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">Minim minim;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">boolean sound;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">int frame;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">float shapeSize;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">float BBwidth;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">float SBwidth;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">color bg = color(50,45,45);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">color c = color(255);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">color c2 = color(255);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">color c3 = color(225,75,75);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">color c4 = color(200,150,250);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">color c5 = color(250,225,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">color c6 = color(100,250,200);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">color c7 = color(100,250,200);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">color c8 = color(100,250,200);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">color c9 = color(250,225,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">color c10 = color(250,225,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">color c11 = color(200,150,250);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">color c12 = color(200,150,250);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">color c13 = color(225,75,75);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">color c14 = color(225,75,75);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">void setup(){</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">size(800,600);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">background(bg);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rectMode(RADIUS);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">noStroke();</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">minim = new Minim(this);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">player = minim.loadFile(&#8220;ElectricalParade2.mp3&#8243;, 2048);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">}</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">void draw(){</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">if(frame == frameCount-1 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-2 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-3 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-4 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-5 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-6 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-7 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-8 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-9 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-10 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-11 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-12 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-13 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-14 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-15 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-16 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-17 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-18 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-19 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-20 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-21 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-22 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-23 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-24 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-25 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-26 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-27 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-28 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-29 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-30 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-31 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-32 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-33 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-34 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-35 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-36 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-37 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-38 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-39 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-40 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-41 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-42 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-43 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-44 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-45 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-46 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-47 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-48 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-49 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-50 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-51 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-52 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-53 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-54 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-55 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-56 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-57 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-58 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-59 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame == frameCount-60){</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">fill(bg,25);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rect(0,0,800,600);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">}</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">if(sound == true){</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">player.play();</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">}</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">if(sound == false){</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">player.pause();</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">}</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">}</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">void mousePressed(){</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">fill(c);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">if(mouseButton==LEFT){</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rectMode(RADIUS);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">shapeSize = random(100,150);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rect(mouseX,mouseY,shapeSize,shapeSize);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">}</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">fill(c2);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">if(mouseButton==RIGHT){</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rectMode(RADIUS);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">shapeSize = random(15,40);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rect(mouseX,mouseY,shapeSize,shapeSize);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">}</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">}</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">void keyPressed(){</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">float BBwidth = width/4;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">float SBwidth = BBwidth/2;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rectMode(CORNER);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">noStroke();</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">switch(key){</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">case &#8216;v&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">fill(c3);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rect(0,100,BBwidth,400);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">case &#8216;b&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">fill(c4);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rect(200,100,BBwidth,400);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">case &#8216;n&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">fill(c5);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rect(400,100,BBwidth,400);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">case &#8216;m&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">fill(c6);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rect(600,100,BBwidth,400);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">case &#8216;a&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">fill(c7);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rect(0,0,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rect(0,500,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">case &#8216;s&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">fill(c8);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rect(SBwidth,0,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rect(SBwidth,500,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">case &#8216;d&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">fill(c9);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rect(SBwidth*2,0,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rect(SBwidth*2,500,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">case &#8216;f&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">fill(c10);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rect(SBwidth*3,0,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rect(SBwidth*3,500,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">case &#8216;j&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">fill(c11);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rect(SBwidth*4,0,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rect(SBwidth*4,500,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">case &#8216;k&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">fill(c12);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rect(SBwidth*5,0,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rect(SBwidth*5,500,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">case &#8216;l&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">fill(c13);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rect(SBwidth*6,0,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rect(SBwidth*6,500,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">case &#8216;;&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">fill(c14);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rect(SBwidth*7,0,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">rect(SBwidth*7,500,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">case &#8217;1&#8242;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">if(sound == false){</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">sound = true;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">}</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">if(sound == true){</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">sound = false;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">}</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">}</p>
<p style="line-height:19px;font:13px Georgia;margin:0;">}</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">import ddf.minim.*;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">AudioPlayer player;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">Minim minim;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">boolean sound;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">int frame;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">float shapeSize;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">float BBwidth;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">float SBwidth;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">color bg = color(50,45,45);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">color c = color(255);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">color c2 = color(255);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">color c3 = color(225,75,75);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">color c4 = color(200,150,250);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">color c5 = color(250,225,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">color c6 = color(100,250,200);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">color c7 = color(100,250,200);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">color c8 = color(100,250,200);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">color c9 = color(250,225,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">color c10 = color(250,225,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">color c11 = color(200,150,250);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">color c12 = color(200,150,250);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">color c13 = color(225,75,75);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">color c14 = color(225,75,75);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">void setup(){</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">size(800,600);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">background(bg);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rectMode(RADIUS);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">noStroke();</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">minim = new Minim(this);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">player = minim.loadFile(&#8220;ElectricalParade2.mp3&#8243;, 2048);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">}</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">void draw(){</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">if(frame == frameCount-1 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-2 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-3 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-4 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-5 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-6 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-7 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-8 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-9 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-10 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-11 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-12 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-13 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-14 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-15 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-16 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-17 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-18 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-19 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-20 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-21 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-22 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-23 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-24 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-25 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-26 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-27 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-28 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-29 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-30 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-31 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-32 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-33 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-34 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-35 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-36 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-37 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-38 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-39 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-40 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-41 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-42 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-43 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-44 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-45 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-46 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-47 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-48 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-49 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-50 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-51 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-52 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-53 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-54 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-55 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-56 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-57 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-58 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-59 ||</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame == frameCount-60){</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">fill(bg,25);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rect(0,0,800,600);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">}</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">if(sound == true){</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">player.play();</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">}</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">if(sound == false){</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">player.pause();</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">}</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">}</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">void mousePressed(){</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">fill(c);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">if(mouseButton==LEFT){</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rectMode(RADIUS);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">shapeSize = random(100,150);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rect(mouseX,mouseY,shapeSize,shapeSize);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">}</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">fill(c2);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">if(mouseButton==RIGHT){</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rectMode(RADIUS);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">shapeSize = random(15,40);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rect(mouseX,mouseY,shapeSize,shapeSize);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">}</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">}</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">void keyPressed(){</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">float BBwidth = width/4;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">float SBwidth = BBwidth/2;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rectMode(CORNER);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">noStroke();</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">switch(key){</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">case &#8216;v&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">fill(c3);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rect(0,100,BBwidth,400);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">case &#8216;b&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">fill(c4);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rect(200,100,BBwidth,400);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">case &#8216;n&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">fill(c5);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rect(400,100,BBwidth,400);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">case &#8216;m&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">fill(c6);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rect(600,100,BBwidth,400);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">case &#8216;a&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">fill(c7);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rect(0,0,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rect(0,500,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">case &#8216;s&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">fill(c8);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rect(SBwidth,0,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rect(SBwidth,500,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">case &#8216;d&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">fill(c9);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rect(SBwidth*2,0,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rect(SBwidth*2,500,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">case &#8216;f&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">fill(c10);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rect(SBwidth*3,0,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rect(SBwidth*3,500,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">case &#8216;j&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">fill(c11);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rect(SBwidth*4,0,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rect(SBwidth*4,500,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">case &#8216;k&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">fill(c12);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rect(SBwidth*5,0,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rect(SBwidth*5,500,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">case &#8216;l&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">fill(c13);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rect(SBwidth*6,0,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rect(SBwidth*6,500,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">case &#8216;;&#8217;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">fill(c14);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rect(SBwidth*7,0,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">rect(SBwidth*7,500,SBwidth,100);</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">frame = frameCount;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">case &#8217;1&#8242;:</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">if(sound == false){</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">sound = true;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">}</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">if(sound == true){</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">sound = false;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">break;</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">}</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">}</p>
<p style="line-height:19px;font:13px Georgia;margin:0 0 13px;">}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/artthatlearns.wordpress.com/667/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/artthatlearns.wordpress.com/667/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/artthatlearns.wordpress.com/667/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/artthatlearns.wordpress.com/667/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/artthatlearns.wordpress.com/667/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/artthatlearns.wordpress.com/667/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/artthatlearns.wordpress.com/667/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/artthatlearns.wordpress.com/667/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/artthatlearns.wordpress.com/667/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/artthatlearns.wordpress.com/667/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/artthatlearns.wordpress.com/667/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/artthatlearns.wordpress.com/667/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/artthatlearns.wordpress.com/667/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/artthatlearns.wordpress.com/667/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=artthatlearns.wordpress.com&amp;blog=6099835&amp;post=667&amp;subd=artthatlearns&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://artthatlearns.wordpress.com/2009/05/07/matts-exercise-1-to-disneys-main-street-electrical-parade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mfinder1</media:title>
		</media:content>
	</item>
		<item>
		<title></title>
		<link>http://artthatlearns.wordpress.com/2009/05/07/664/</link>
		<comments>http://artthatlearns.wordpress.com/2009/05/07/664/#comments</comments>
		<pubDate>Thu, 07 May 2009 12:20:25 +0000</pubDate>
		<dc:creator>lpaolett</dc:creator>
				<category><![CDATA[Assignment 3]]></category>

		<guid isPermaLink="false">http://artthatlearns.wordpress.com/?p=664</guid>
		<description><![CDATA[Click here Here is a website with our documentation. I also uploaded the word doc with all the photos and everything.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=artthatlearns.wordpress.com&amp;blog=6099835&amp;post=664&amp;subd=artthatlearns&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://andrew.cmu.edu/user/lpaolett/frienddocumentation.htm">Click here</a><br />
Here is a website with our documentation. I also uploaded the word doc with all the photos and everything.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/artthatlearns.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/artthatlearns.wordpress.com/664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/artthatlearns.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/artthatlearns.wordpress.com/664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/artthatlearns.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/artthatlearns.wordpress.com/664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/artthatlearns.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/artthatlearns.wordpress.com/664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/artthatlearns.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/artthatlearns.wordpress.com/664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/artthatlearns.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/artthatlearns.wordpress.com/664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/artthatlearns.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/artthatlearns.wordpress.com/664/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=artthatlearns.wordpress.com&amp;blog=6099835&amp;post=664&amp;subd=artthatlearns&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://artthatlearns.wordpress.com/2009/05/07/664/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">lpaolett</media:title>
		</media:content>
	</item>
		<item>
		<title>Synch</title>
		<link>http://artthatlearns.wordpress.com/2009/05/07/synch/</link>
		<comments>http://artthatlearns.wordpress.com/2009/05/07/synch/#comments</comments>
		<pubDate>Thu, 07 May 2009 04:13:46 +0000</pubDate>
		<dc:creator>jiricou</dc:creator>
				<category><![CDATA[Assignment 3]]></category>

		<guid isPermaLink="false">http://artthatlearns.wordpress.com/?p=650</guid>
		<description><![CDATA[SYNCHRONIZATION JET, Joana Ricou, Paul Shen This piece explores how self-organization emerges in the search for synchronization, where synchronization appears to be an ubiquitous and old principle that holds together all living things. The installation  consists of 144 entities who will synch with their closest neighbors, until the whole population is synched. The presence of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=artthatlearns.wordpress.com&amp;blog=6099835&amp;post=650&amp;subd=artthatlearns&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-649" title="sync21webres" src="http://artthatlearns.files.wordpress.com/2009/05/sync21webres.png?w=300&#038;h=400" alt="sync21webres" width="300" height="400" />SYNCHRONIZATION</p>
<p><em>JET, Joana Ricou, Paul Shen</em></p>
<p>This piece explores how self-organization emerges in the search for synchronization, where synchronization appears to be an ubiquitous and old principle that holds together all living things.</p>
<p>The installation  consists of 144 entities who will synch with their closest neighbors, until the whole population is synched. The presence of visitors will disrupt the synchronization.</p>
<p>INPUT: presence of visitors</p>
<p>BLACK BOX: consensus algorithm to synchronize pulsing.</p>
<p>OUTPUT: synchronized blinking </p>
<p>Problem to be solved:</p>
<ul>
<li>Arduino stops lighting LEDs to receive data so an LED controller will be added</li>
</ul>
<p>Code: <a href="http://storage.paulshen.name/Fireflies.tar.gz" target="_blank">http://storage.paulshen.name/Fireflies.tar.gz</a></p>
<p><a href="http://storage.paulshen.name/Fireflies.tar.gz" target="_blank"></a>Powerpoint:<a href="http://joanaricou.com/transferfiles/Synch.pptx">http://joanaricou.com/transferfiles/Synch.pptx</a></p>
<p><a href="http://storage.paulshen.name/Fireflies.tar.gz" target="_blank"></a></p>
<p><a href="http://storage.paulshen.name/Fireflies.tar.gz" target="_blank"></a></p>
<p><a href="http://storage.paulshen.name/Fireflies.tar.gz" target="_blank"></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/artthatlearns.wordpress.com/650/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/artthatlearns.wordpress.com/650/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/artthatlearns.wordpress.com/650/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/artthatlearns.wordpress.com/650/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/artthatlearns.wordpress.com/650/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/artthatlearns.wordpress.com/650/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/artthatlearns.wordpress.com/650/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/artthatlearns.wordpress.com/650/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/artthatlearns.wordpress.com/650/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/artthatlearns.wordpress.com/650/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/artthatlearns.wordpress.com/650/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/artthatlearns.wordpress.com/650/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/artthatlearns.wordpress.com/650/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/artthatlearns.wordpress.com/650/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=artthatlearns.wordpress.com&amp;blog=6099835&amp;post=650&amp;subd=artthatlearns&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://artthatlearns.wordpress.com/2009/05/07/synch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">jiricou</media:title>
		</media:content>

		<media:content url="http://artthatlearns.files.wordpress.com/2009/05/sync21webres.png" medium="image">
			<media:title type="html">sync21webres</media:title>
		</media:content>
	</item>
	</channel>
</rss>
