<?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/"
	>

<channel>
	<title>Marijn Speelman</title>
	<atom:link href="http://www.marijnspeelman.nl/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.marijnspeelman.nl/blog</link>
	<description></description>
	<lastBuildDate>Wed, 15 Oct 2008 23:25:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Face detection using Flash and C++, revisited</title>
		<link>http://www.marijnspeelman.nl/blog/2008/03/06/face-detection-using-flash-and-c-revisited/</link>
		<comments>http://www.marijnspeelman.nl/blog/2008/03/06/face-detection-using-flash-and-c-revisited/#comments</comments>
		<pubDate>Wed, 05 Mar 2008 23:55:42 +0000</pubDate>
		<dc:creator>Marijn</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>

		<guid isPermaLink="false">http://www.marijnspeelman.nl/blog/2008/03/06/face-detection-using-flash-and-c-revisited/</guid>
		<description><![CDATA[Over the past few months I&#8217;ve been asked several times for the code for face detection in Flash. So I&#8217;ve taken some time to make a short demo application, grabbed from my original Virtual Mirror game (see my two previous blogs).
Here&#8217;s what it does: Flash grabs the webcam image every 60ms, and sends it using [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past few months I&#8217;ve been asked several times for the code for face detection in Flash. So I&#8217;ve taken some time to make a short demo application, grabbed from my original Virtual Mirror game (see my two <a href="http://www.marijnspeelman.nl/blog/2007/06/24/face-detection-using-flash-and-c/">previous</a> <a href="http://www.marijnspeelman.nl/blog/2007/07/12/face-tracking-adding-virtual-objects-in-flash/">blogs</a>).</p>
<p>Here&#8217;s what it does: Flash grabs the webcam image every 60ms, and sends it using a socket connection to a separate C++ server that runs on your localhost. The server uses the OpenCV software library to detect faces, using a haar classifier cascade. When it detects one or more faces it sends the result (coordinates) back to Flash. There, Flash draws a transparent box or image at the coordinates of the face, like this:</p>
<p><img src="http://www.marijnspeelman.nl/blog/downloads/asface-mask.jpg" alt="ActionScript3 + C++, Face detected" /></p>
<p>What makes this cool is that you can perform quite complex image analysis (at least something you can&#8217;t easily do in Flash), and use this data on a platform that is highly suitable for multimedia development (animation, sound, nice graphics, etc).</p>
<p>The demo only handles one face now, but this could be easily expanded.</p>
<p>Download:</p>
<ul>
<li><a href="http://www.marijnspeelman.nl/blog/downloads/asface-binary.zip" aiotarget="false" aiotitle="ActionScript Face detection (Binary)">Binary</a> (1,18 MB)<a href="http://www.marijnspeelman.nl/blog/downloads/asface-binary.zip" aiotarget="false" aiotitle="ActionScript Face detection (Binary)"><br />
</a></li>
<li><a href="http://www.marijnspeelman.nl/blog/downloads/asface-source.zip" title="ActionScript Face detection (Source)">Source</a> (904 KB)</li>
</ul>
<p>At the moment there are no installation instructions included. If you need help you can contact me, or wait untill I create the instructions (which I will) :)<br />
A few quick pointers to get you past some obstacles:</p>
<ul>
<li>Binary: You probably have to add the folder you run the .swf from as trusted directory in your Flash settings. Otherwise you get a security / sandbox violation error.</li>
<li>Binary: Start the server before starting the .swf (client). The .swf tries to connect to the server when it starts.</li>
<li>Binary: The needed OpenCV dll&#8217;s and .xml file for face detection are included in the same folder.</li>
<li>Source: (Server)  If I remember correctly, only <em>pthread</em> is a required dependency. UPX is a file packer for releasing, Visual Leak detector can be turned off if you don&#8217;t want to use it.</li>
<li>Source: (Server) Additional dependencies you should include when compiling/linking: wsock32.lib cv.lib cxcore.lib highgui.lib</li>
</ul>
<p>Last note: This was both my first AS3 and C++ project, I&#8217;m always open to suggestions,  improvements and cool new ideas. Also, when you find this code useful, I would appreciate it if you&#8217;d drop me a line.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marijnspeelman.nl/blog/2008/03/06/face-detection-using-flash-and-c-revisited/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>AS3 font anti-aliasing in AIR and browser</title>
		<link>http://www.marijnspeelman.nl/blog/2007/08/03/as3-font-anti-aliasing-in-air-and-browser/</link>
		<comments>http://www.marijnspeelman.nl/blog/2007/08/03/as3-font-anti-aliasing-in-air-and-browser/#comments</comments>
		<pubDate>Fri, 03 Aug 2007 12:48:47 +0000</pubDate>
		<dc:creator>Marijn</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Actionscript 3.0]]></category>

		<guid isPermaLink="false">http://www.marijnspeelman.nl/blog/2007/08/03/as3-font-anti-aliasing-in-air-and-browser/</guid>
		<description><![CDATA[First of all, I&#8217;m a noob on fonts in AS3. Just posting some differences between AIR (Adobe Integrated Runtime) and the browser I noticed while developing.
Font anti-aliasing is done automatically in the browser when you don&#8217;t add any effects to it like a GlowFilter.  When running AIR the font is not anti-aliased:
Verdana, Not embedded, [...]]]></description>
			<content:encoded><![CDATA[<p>First of all, I&#8217;m a noob on fonts in AS3. Just posting some differences between AIR (Adobe Integrated Runtime) and the browser I noticed while developing.</p>
<p>Font anti-aliasing is done automatically in the browser when you don&#8217;t add any effects to it like a GlowFilter.  When running AIR the font is not anti-aliased:</p>
<p><strong>Verdana, Not embedded, Browser</strong><br />
<img src="http://www.marijnspeelman.nl/blog/downloads/imagequality-browser.jpg" alt="Font quality Browser" /></p>
<p><strong>Verdana, Not embedded, AIR</strong><br />
<img src="http://www.marijnspeelman.nl/blog/downloads/imagequality-air.jpg" alt="Font quality AIR" /></p>
<p>If you want to do effects like alpha and rotation on fonts, you have to embed them into your SWF. This also results in anti-aliasing when you run your application as AIR file:</p>
<p><strong>Verdana, Embedded, Browser</strong><br />
<img src="http://www.marijnspeelman.nl/blog/downloads/imagequality-browser-embed.jpg" alt="Font quality Browser (embedded font)" /></p>
<p><strong>Verdana, Embedded, AIR</strong><br />
<img src="http://www.marijnspeelman.nl/blog/downloads/imagequality-air-embed.jpg" alt="Font quality AIR (embedded font)" /></p>
<p>Though the strange thing is the 0 (zero) and o (O) are missing a bit on the top right.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marijnspeelman.nl/blog/2007/08/03/as3-font-anti-aliasing-in-air-and-browser/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Face tracking, adding virtual objects in Flash</title>
		<link>http://www.marijnspeelman.nl/blog/2007/07/12/face-tracking-adding-virtual-objects-in-flash/</link>
		<comments>http://www.marijnspeelman.nl/blog/2007/07/12/face-tracking-adding-virtual-objects-in-flash/#comments</comments>
		<pubDate>Thu, 12 Jul 2007 00:21:31 +0000</pubDate>
		<dc:creator>Marijn</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>

		<guid isPermaLink="false">http://www.marijnspeelman.nl/blog/2007/07/12/face-tracking-adding-virtual-objects-in-flash/</guid>
		<description><![CDATA[In a previous blog I talked about using Flash and C++ for face detection. I&#8217;m going to use face detection to determine if the player of the game has the right distance to the webcam and is standing in the middle of the screen. But it&#8217;s also lots of fun to attach virtual objects to [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous blog I talked about using <a href="http://www.marijnspeelman.nl/blog/2007/06/24/face-detection-using-flash-and-c/">Flash and C++ for face detection</a>. I&#8217;m going to use face detection to determine if the player of the game has the right distance to the webcam and is standing in the middle of the screen. But it&#8217;s also lots of fun to attach virtual objects to the face (like done in the more expensive Logitech webcam series), or to put filters and effects on the facial area.</p>
<p>Here is a quick example. The Jason Voorhees hockey mask moves along with my head in real time (about 60ms delay). The size of the sprite also changes as you move back and forward.</p>
<p><img src="http://www.marijnspeelman.nl/blog/downloads/facedetectionfun.jpg" alt="Face detection fun" /></p>
<p>Edit: Or go on a killing spree in style ;)</p>
<p><img src="http://www.marijnspeelman.nl/blog/downloads/facedetectionfun-instyle.jpg" alt="Face detection fun (keep your hat on)" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.marijnspeelman.nl/blog/2007/07/12/face-tracking-adding-virtual-objects-in-flash/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>We Feel Fine &amp; Universe</title>
		<link>http://www.marijnspeelman.nl/blog/2007/07/11/we-feel-fine-universe/</link>
		<comments>http://www.marijnspeelman.nl/blog/2007/07/11/we-feel-fine-universe/#comments</comments>
		<pubDate>Wed, 11 Jul 2007 13:28:27 +0000</pubDate>
		<dc:creator>Marijn</dc:creator>
				<category><![CDATA[Information Visualisation]]></category>

		<guid isPermaLink="false">http://www.marijnspeelman.nl/blog/2007/07/11/we-feel-fine-universe/</guid>
		<description><![CDATA[I came across an interesting TED talk by Jonathan Harris. He talked about a few of the applications he has been working on.
One of those is We Feel Fine in which new blog posts are scanned every few hours to collect the feelings of the blogger. Each time someone says &#8216;I feel&#8217; (or I&#8217;m feeling, [...]]]></description>
			<content:encoded><![CDATA[<p>I came across an interesting TED talk by Jonathan Harris. He talked about a few of the applications he has been working on.</p>
<p>One of those is <a href="http://www.wefeelfine.org" aiotarget="false" aiotitle="We Feel Fine">We Feel Fine</a> in which new blog posts are scanned every few hours to collect the feelings of the blogger. Each time someone says &#8216;I feel&#8217; (or I&#8217;m feeling, I felt, &#8230;) the emotion is logged, next to the gender, age and location. This data is then used in some really pretty visualizations. Especially the photo&#8217;s attached to some of the &#8216;I feel&#8217; sentences can be quite impressive. You can play around with it at their website.</p>
<p>The other application that really interested me is called <a href="http://universe.daylife.com/">Universe</a>. The idea behind it is to draw / write the persons, events, etc on the virtual sky. It&#8217;s hard to describe it correctly, so you just have to watch the video below, or check out Jonathan Harris&#8217; <a href="http://www.number27.org/">website</a>.</p>
<p><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/zAvNlh2Z0GI"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/zAvNlh2Z0GI" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.marijnspeelman.nl/blog/2007/07/11/we-feel-fine-universe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Face detection using Flash and C++</title>
		<link>http://www.marijnspeelman.nl/blog/2007/06/24/face-detection-using-flash-and-c/</link>
		<comments>http://www.marijnspeelman.nl/blog/2007/06/24/face-detection-using-flash-and-c/#comments</comments>
		<pubDate>Sat, 23 Jun 2007 23:09:04 +0000</pubDate>
		<dc:creator>Marijn</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>

		<guid isPermaLink="false">http://www.marijnspeelman.nl/2007/06/24/face-detection-using-flash-and-c/</guid>
		<description><![CDATA[As you could read in a previous blog, I&#8217;m trying to create a small webcam game in Flash that supports &#8216;physical input&#8217; using a webcam. The frames are processed by a C++ server that uses existing computer vision libraries. This way it should be fairly easy to build in cool features like face detection.
Now I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>As you could read in a <a href="/blog/2007/04/30/zinc-dll-interface-slow/" aiotarget="false" aiotitle="previous blog">previous blog</a>, I&#8217;m trying to create a small webcam game in Flash that supports &#8216;physical input&#8217; using a webcam. The frames are processed by a C++ server that uses existing computer vision libraries. This way it should be fairly easy to build in cool features like face detection.</p>
<p>Now I&#8217;ve finally managed to get some things working on my Flash / C++ computer vision project. <a href="http://staff.science.uva.nl/~zivkovic/">Zoran</a> (my project advisor at the University of Amsterdam) helped me a lot on the C++ computer vision part.  Using the <a href="http://opencvlibrary.sourceforge.net/" aiotarget="false" aiotitle="OpenCV library">OpenCV</a> library we&#8217;ve managed to put face detection in a Flash application! Input from the webcam is sent via a Socket to a light weight server running localhost.  When a face is detected, a message is sent back to Flash.</p>
<p>The boundaries of the face in the image are also known. I just have to think of some kind of protocol to send and retrieve different kinds (and sizes) of data.</p>
<p>The result of the image detection from OpenCV (using the red color channel here):<br />
<img src="http://www.marijnspeelman.nl/blog/downloads/cvresult.jpg" title="CV face detection" alt="CV face detection" border="1" height="120" width="160" /><br />
<span id="more-7"></span><br />
This is how I display the webcam (AS3 code):</p>
<pre><code>// Show the webcam
var camera:Camera = Camera.getCamera();
camera.setMode(WEBCAM_WIDTH, WEBCAM_HEIGHT, 31);
videoDisplay = new Video(WEBCAM_WIDTH,WEBCAM_HEIGHT);
videoDisplay.attachCamera(camera);
this.addChild(videoDisplay);
</code></pre>
<p>Making the connection:</p>
<pre><code>private function openConnection(evt:Event):void
{
	// Connect to the external server
	s = new Socket();
	s.addEventListener(Event.CONNECT, initializeImageFeed);
	s.addEventListener(ProgressEvent.SOCKET_DATA, receiveData);
	s.addEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler);

	s.connect("localhost", SERVER_PORT);
}
</code></pre>
<p>The timer that sends the feed every x milliseconds (200ms now for me):</p>
<pre><code>/**
* Takes the data of the webcam and sends it to the server
*/
private function sendData(evt:Event):void
{
	var webcamSendWidth:int = 160;
	var webcamSendHeight:int = 120;
	var scale:Number = webcamSendWidth / WEBCAM_WIDTH;

	var scaleMatrix:Matrix = new Matrix();
	</code><code>scaleMatrix</code><code>.scale(scale,scale);

	// Get the bitmap from the webcam
	var now:BitmapData = new BitmapData(webcamSendWidth, webcamSendHeight);
	now.draw(videoDisplay, </code><code>scaleMatrix</code><code>);
	var rect:Rectangle = new Rectangle(0, 0, webcamSendWidth, webcamSendHeight);
	var ba:ByteArray = now.getPixels(rect);

	s.writeBytes(ba);
	s.flush();
}
</code></pre>
<p>The BitmapData that is being sent consists of 4 channels in this order: Alpha, Red, Green, Blue. That is 4 bytes per pixel, which makes 160&#215;120 x 4 = 76800 bytes (75KB) for the complete image. If you want to do this over the Internet, you could compress the Bitmap. Because I&#8217;m running both the Flash application and the server on the same computer, bandwidth usage isn&#8217;t an issue and compressing and decompressing would probably take longer than just sending it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marijnspeelman.nl/blog/2007/06/24/face-detection-using-flash-and-c/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>About</title>
		<link>http://www.marijnspeelman.nl/blog/2007/06/19/about/</link>
		<comments>http://www.marijnspeelman.nl/blog/2007/06/19/about/#comments</comments>
		<pubDate>Tue, 19 Jun 2007 15:53:36 +0000</pubDate>
		<dc:creator>Marijn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.marijnspeelman.nl/blog/about/</guid>
		<description><![CDATA[I&#8217;m a 24 year old Software Engineer at one of the biggest websites in the Netherlands. I&#8217;m a former Information Science student at the University of Amsterdam and a large part of the articles on this website are related to my master thesis there.
This is my humble blog, where I post some interesting stuff now [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a 24 year old Software Engineer at one of the biggest websites in the Netherlands. I&#8217;m a former Information Science student at the <a href="http://www.uva.nl" target="_blank">University of Amsterdam</a> and a large part of the articles on this website are related to my master thesis there.</p>
<p>This is my humble blog, where I post some interesting stuff now and then. For the world to see it and to support my own memories.</p>
<p>You can contact me at: marijn @ [the URL of this website].</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marijnspeelman.nl/blog/2007/06/19/about/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Khronos &#8211; time based photo browser</title>
		<link>http://www.marijnspeelman.nl/blog/2007/05/30/khronos-time-based-photo-browser/</link>
		<comments>http://www.marijnspeelman.nl/blog/2007/05/30/khronos-time-based-photo-browser/#comments</comments>
		<pubDate>Wed, 30 May 2007 16:05:53 +0000</pubDate>
		<dc:creator>Marijn</dc:creator>
				<category><![CDATA[Information Visualisation]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.marijnspeelman.nl/2007/06/19/khronos-time-based-photo-browser/</guid>
		<description><![CDATA[Together with my team mate Meindert, I’ve created a cool photo browser for the Information Visualisation course given at the University of Amsterdam. A screenshot is displayed below with the end result.
The photos are being placed around the time line, based on the moment they are taken. You can slide through the timeline and zoom [...]]]></description>
			<content:encoded><![CDATA[<p class="main">Together with my team mate Meindert, I’ve created a cool photo browser for the Information Visualisation course given at the University of Amsterdam. A screenshot is displayed below with the end result.</p>
<p>The photos are being placed around the time line, based on the moment they are taken. You can slide through the timeline and zoom in to the level of displaying seconds. The positioning of the photo’s is done using a so called force based algorithm, which is often used in graph drawing. The photo’s are being attracted to the position on the timeline that corresponds with the time the photo was created. Also, the photo’s repulse each other. These two forces result in the intuitive positioning of the images. The more you zoom, the more clear you can see where the photo should really be.</p>
<p>Used technologies:</p>
<ul>
<li>Java</li>
<li>JOGL (OpenGL for Java)</li>
<li>Force based algoritme for the positioning of the images.</li>
</ul>
<p>My teacher and assistent were also happy with the result: we won the ‘First Price’ and the ‘OGL Wisselbeker’ Screensaver <img src="http://www.marijnspeelman.nl/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /></p>
<p>Code is available on request.</p>
<p><a href="http://www.marijnspeelman.nl/blog/downloads/photobrowser-eersteprijs.jpg"><img src="http://www.marijnspeelman.nl/blog/downloads/photobrowser-eersteprijs.jpg" title="Winnaar 2007" id="image6" alt="Winnaar 2007" height="96" width="100" /></a> <a href="http://www.marijnspeelman.nl/blog/downloads/photobrowser-dump-25mei-final.jpg"><img src="http://www.marijnspeelman.nl/blog/downloads/photobrowser-dump-25mei-final.jpg" title="photobrowser-dump-25mei-final.png" id="image5" height="95" width="128" /></a></p>
<p><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/QocwaXYpjIQ"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/QocwaXYpjIQ" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.marijnspeelman.nl/blog/2007/05/30/khronos-time-based-photo-browser/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Zinc DLL interface = slow?</title>
		<link>http://www.marijnspeelman.nl/blog/2007/04/30/zinc-dll-interface-slow/</link>
		<comments>http://www.marijnspeelman.nl/blog/2007/04/30/zinc-dll-interface-slow/#comments</comments>
		<pubDate>Mon, 30 Apr 2007 16:05:17 +0000</pubDate>
		<dc:creator>Marijn</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>

		<guid isPermaLink="false">http://www.marijnspeelman.nl/2007/06/19/flash-webcam-zinc-c-dll-interface-slow/</guid>
		<description><![CDATA[At the moment I’m working on a webcam game as part of my Master thesis research. There are many Computer Vision libraries available in C/C++ (for example with optical flow implementations or face detection), but C++ isn’t very suited for rapid prototyping in respect to interface and game graphics.
Flash is very useful for this. Also, [...]]]></description>
			<content:encoded><![CDATA[<p class="main">At the moment I’m working on a webcam game as part of my Master thesis research. There are many Computer Vision libraries available in C/C++ (for example with optical flow implementations or face detection), but C++ isn’t very suited for rapid prototyping in respect to interface and game graphics.</p>
<p>Flash is very useful for this. Also, reading the webcam input is a lot easier in Flash than in C. So, what’s the idea: Flash reads the webcam, sends the image data to C++. Then the C++ application sends back the meta information about the images / frames, which Flash uses to draw the game graphics and execute actions in the game.</p>
<p><strong>Zinc<br />
</strong>My plan was to use <a href="http://www.multidmedia.com/">Zinc</a>. With Zinc you can convert a .swf file (Flash) to a .exe (Executable). Zinc is actually a container like a browser, using an integrated Flash Player. What’s nice about Zinc is that you can shape the window of your application like you want, and they provide additional API functionality. With the extra API calls you can access low level system commands like rebooting the PC, or information like the CPU speed. It also provides database connectivity with MySQL and Access.</p>
<p>Using the Zinc API you can also access external DLL’s. So, what I tried to do was use this DLL access to analyse the webcam data in an external C++ application that uses existing Computer Vision libraries.<br />
To test the DLL connection, I wrote tiny test DLL (<a href="http://www.marijnspeelman.nl/blog/downloads/testdll.cpp">source</a>). It consists of two functies, Init and Process. Init is a pure dummy function, Process returns a small test string.</p>
<p><strong>Flash </strong><br />
Calling the external DLL in Flash (AS3):</p>
<pre><code>// Create the Bitmap
var bmd:BitmapData = new BitmapData(30, 30, false);
var rect:Rectangle = new Rectangle(0, 0, 30, 30);
var bytes:ByteArray = bmd.getPixels(rect);

// DLL
var myDLL:DLL = new DLL("TestDLL.dll");
parameterIndex = myDLL.addParameter("integer", "120");
parameterIndex = myDLL.addParameter("integer", "120");
myDLL.call("none", "Init");
myDLL.clear();

// Send data to DLL
parameterIndex = myDLL.addParameter("unsigned char*", bytes);
var result:String = myDLL.call("unsigned char*", "Process");
myDLL.clear();
myDLL.close();</code></pre>
<p><strong>Result</strong><br />
And we’re done! You would say… Unfortunately, some time profiling shows even the Init dummy function takes 30ms to execute. Sending a 120×120 bitmap takes 180ms. As 10FPS can be considered a minimum you want for analysis, we can conclude this is too slow to be useful.<br />
The next and final attempt (because of time constraints) is to use a C++ server and use a Socket to communicate between Flash and the server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marijnspeelman.nl/blog/2007/04/30/zinc-dll-interface-slow/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

