<?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>Jean-Marc Pelletier &#187; Software</title>
	<atom:link href="http://jmpelletier.com/category/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://jmpelletier.com</link>
	<description>Sound, art, media, education</description>
	<lastBuildDate>Wed, 07 Mar 2012 02:22:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>A Simple Eye Tracker For Jitter</title>
		<link>http://jmpelletier.com/a-simple-eye-tracker-for-jitter/</link>
		<comments>http://jmpelletier.com/a-simple-eye-tracker-for-jitter/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 08:20:08 +0000</pubDate>
		<dc:creator>jovansystem</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[cv.jit]]></category>

		<guid isPermaLink="false">http://jmpelletier.com/?p=1087</guid>
		<description><![CDATA[A few years ago, I made a rough eye tracker in Jitter with cv.jit for my own use. It wasn&#8217;t the most thoroughly advanced approach to the problem but it did the job, and it&#8217;s relatively lightweight. I moved on to other projects and I forgot about the patch almost entirely, but from time to [...]]]></description>
			<content:encoded><![CDATA[<p>A few years ago, I made a rough eye tracker in Jitter with <a href="http://jmpelletier.com/cvjit/">cv.jit</a> for my own use. It wasn&#8217;t the most thoroughly advanced approach to the problem but it did the job, and it&#8217;s relatively lightweight.</p>
<p><img src="http://jmpelletier.com/media/eye-tracker.png" alt="" title="eye-tracker" width="428" height="200" class="aligncenter size-full wp-image-1088" /></p>
<p>I moved on to other projects and I forgot about the patch almost entirely, but from time to time I have people writing to me asking question about face tracking (which is different from face detection) and eye tracking. And so, here it is, my eye tracker, for anyone to use.</p>
<p><a href="http://jmpelletier.com/data/Eye_tracker.zip">Download &#8220;Eye tracker&#8221; and necessary abstractions.</a></p>
<p>As a bonus, you also get a number of useful abstractions, although they&#8217;re undocumented and will remain this way. Also, don&#8217;t ask me how they work; I don&#8217;t remember. The names are fairly descriptive, though.</p>
<p>You will need the standard <a href="http://jmpelletier.com/cvjit/">cv.jit</a> objects for this patch to work.</p>
<p>As always, hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://jmpelletier.com/a-simple-eye-tracker-for-jitter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jit.freenect.grab Release Candidate 4</title>
		<link>http://jmpelletier.com/jit-freenect-grab-release-candidate-4/</link>
		<comments>http://jmpelletier.com/jit-freenect-grab-release-candidate-4/#comments</comments>
		<pubDate>Sat, 15 Oct 2011 06:40:16 +0000</pubDate>
		<dc:creator>jovansystem</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[freenect]]></category>

		<guid isPermaLink="false">http://jmpelletier.com/?p=1084</guid>
		<description><![CDATA[A number of people have been writing me about what appeared to be a memory leak in jit.freenect.grab. Indeed, there was. It&#8217;s been found, and as far as I can tell, it&#8217;s been squashed. If any of you wish to compile the external on your own, please beware that it is the OSX version of [...]]]></description>
			<content:encoded><![CDATA[<p>A number of people have been writing me about what appeared to be a memory leak in jit.freenect.grab. Indeed, there was. It&#8217;s been found, and as far as I can tell, it&#8217;s been squashed. If any of you wish to compile the external on your own, please beware that it is the OSX version of libusb that leaks. Be sure to read the libfreenect README carefully to find out how to patch the problem.</p>
<p>I also get people asking me about a Windows external. Unfortunately, it&#8217;s not going to happen soon. At least unless some kind soul does the work for us, because I just don&#8217;t have enough time to dedicate to a port.</p>
<p><a href="http://jmpelletier.com/freenect/">jit.freenect.grab</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jmpelletier.com/jit-freenect-grab-release-candidate-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jit.freenect.grab Release Candidate 3</title>
		<link>http://jmpelletier.com/jit-freenect-grab-release-candidate-3/</link>
		<comments>http://jmpelletier.com/jit-freenect-grab-release-candidate-3/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 15:54:15 +0000</pubDate>
		<dc:creator>jovansystem</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[freenect]]></category>

		<guid isPermaLink="false">http://jmpelletier.com/?p=1078</guid>
		<description><![CDATA[Release candidate 3 is out! jit.freenect.grab It&#8217;s now possible to output the raw image from the infrared camera instead of the RGB image. This is the raw data the Kinect uses to estimate depth. This means that by blocking the infrared projector (on the left side of the device) it&#8217;s now possible to use the [...]]]></description>
			<content:encoded><![CDATA[<p>Release candidate 3 is out!</p>
<p><a href="http://jmpelletier.com/freenect/">jit.freenect.grab</a></p>
<p>It&#8217;s now possible to output the raw image from the infrared camera instead of the RGB image. This is the raw data the Kinect uses to estimate depth. This means that by blocking the infrared projector (on the left side of the device) it&#8217;s now possible to use the Kinect as an infrared camera. Note, however, that the infrared camera was calibrated to work with the infrared projector and you may find ambient infrared light to be either too dim or too bright to be useable.</p>
<p>Even with RC2, some users reported stalling issues. It appears that stalling occurs under heavy CPU load – although I haven&#8217;t verified that this is true in all cases. </p>
]]></content:encoded>
			<wfw:commentRss>http://jmpelletier.com/jit-freenect-grab-release-candidate-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jit.freenect.grab Release Candidate 2 is out (finally)</title>
		<link>http://jmpelletier.com/jit-freenect-grab-release-candidate-2-is-out-finally/</link>
		<comments>http://jmpelletier.com/jit-freenect-grab-release-candidate-2-is-out-finally/#comments</comments>
		<pubDate>Mon, 10 Jan 2011 14:18:02 +0000</pubDate>
		<dc:creator>jovansystem</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[freenect]]></category>

		<guid isPermaLink="false">http://jmpelletier.com/?p=1074</guid>
		<description><![CDATA[Taking a short break from what has been a truly hectic and near-sleepless month, I found the time to upload a slightly improved jit.freenect.grab. Several users have reported to me that jit.freenect.grab stops working after a while. I think I&#8217;ve identified the culprit and this new version may solve the problem. I hope so. jit.freenect.grab [...]]]></description>
			<content:encoded><![CDATA[<p>Taking a short break from what has been a truly hectic and near-sleepless month, I found the time to upload a slightly improved jit.freenect.grab. Several users have reported to me that jit.freenect.grab stops working after a while. I think I&#8217;ve identified the culprit and this new version may solve the problem. I hope so.</p>
<p><a href="http://jmpelletier.com/freenect/">jit.freenect.grab</a></p>
<p>Some people have also asked me about a Windows version of the external. libfreenect, on which this external is based now works on Windows and a port should be possible. Or at least, it would be if I had the time. Currently, my main priority is getting enough sleep to keep a sane mind. However, the code is on Github and if anyone wants to take the time to work on a Windows version, that would be fantastic.</p>
<p>Some people are also interested, of course, in <a href="http://www.primesense.com/?p=515">NITE</a>. Which is a skeleton tracking system developed by Primesense, the company that designed the Kinect&#8217;s depth sensor. As far as I know, NITE requires Primesense&#8217;s own drivers to work, which would require a new external altogether to work in Jitter. It would be a very useful project but unfortunately, my current engagements don&#8217;t allow me the time to work on something like this at the moment.</p>
<p>Here&#8217;s hoping rc2 solves everybody&#8217;s problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://jmpelletier.com/jit-freenect-grab-release-candidate-2-is-out-finally/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jit.freenect.grab page now live</title>
		<link>http://jmpelletier.com/jit-freenect-grab-page-now-live/</link>
		<comments>http://jmpelletier.com/jit-freenect-grab-page-now-live/#comments</comments>
		<pubDate>Fri, 03 Dec 2010 14:48:42 +0000</pubDate>
		<dc:creator>jovansystem</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[freenect]]></category>

		<guid isPermaLink="false">http://jmpelletier.com/?p=1068</guid>
		<description><![CDATA[I just published a page for the jit.freenect.grab external I have been working on. It allows users of Max/MSP/Jitter to get depth and image data from their Kinect. Head over to http://jmpelletier.com/freenect/ for more info!]]></description>
			<content:encoded><![CDATA[<p>I just published a page for the jit.freenect.grab external I have been working on. It allows users of Max/MSP/Jitter to get depth and image data from their Kinect.</p>
<p>Head over to <a href="http://jmpelletier.com/freenect/">http://jmpelletier.com/freenect/</a> for more info!</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/WIJA46ocia0?fs=1&amp;hl=ja_JP&amp;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/WIJA46ocia0?fs=1&amp;hl=ja_JP&amp;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://jmpelletier.com/jit-freenect-grab-page-now-live/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Minor update to cv.jit</title>
		<link>http://jmpelletier.com/minor-update-to-cv-jit/</link>
		<comments>http://jmpelletier.com/minor-update-to-cv-jit/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 01:50:56 +0000</pubDate>
		<dc:creator>jovansystem</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[cv.jit]]></category>

		<guid isPermaLink="false">http://jmpelletier.com/?p=1009</guid>
		<description><![CDATA[I have just released cv.jit version 1.7.1, which fixes two issues. A bug in cv.jit.shift, which also affected cv.jit.touches, was causing memory leaks. Furthermore, some Windows users were seeing 14001 errors when trying to use externals that make use of OpenCV functions. Both problems have now been fixed.]]></description>
			<content:encoded><![CDATA[<p>I have just released cv.jit version 1.7.1, which fixes two issues. A bug in cv.jit.shift, which also affected cv.jit.touches, was causing memory leaks. Furthermore, some Windows users were seeing 14001 errors when trying to use externals that make use of OpenCV functions. Both problems have now been fixed. </p>
]]></content:encoded>
			<wfw:commentRss>http://jmpelletier.com/minor-update-to-cv-jit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using cv.jit.touches: recycling index values</title>
		<link>http://jmpelletier.com/using-cv-jit-touches-recycling-index-values/</link>
		<comments>http://jmpelletier.com/using-cv-jit-touches-recycling-index-values/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 06:38:41 +0000</pubDate>
		<dc:creator>jovansystem</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[cv.jit]]></category>

		<guid isPermaLink="false">http://jmpelletier.com/?p=997</guid>
		<description><![CDATA[cv.jit.touches, a new object added in the 1.7.0 release, tracks the movement of bright spots in a greyscale image and reports &#8220;touch&#8221;, &#8220;drag&#8221; and &#8220;release&#8221; information – when regions appear, move or disappear. Each region is assigned a unique ID number, so that even if they move, you can always know where an object is [...]]]></description>
			<content:encoded><![CDATA[<p><strong>cv.jit.touches</strong>, a new object added in the 1.7.0 release, tracks the movement of bright spots in a greyscale image and reports &#8220;touch&#8221;, &#8220;drag&#8221; and &#8220;release&#8221; information – when regions appear, move or disappear. Each region is assigned a unique ID number, so that even if they move, you can always know where an object is from frame to frame. This is unlike using <strong>cv.jit.label</strong>-based blob analysis, where you are never guaranteed that the same object in a scene will end up with the same index.</p>
<p>By default, <strong>cv.jit.touches</strong> outputs ever-increasing indices, although the counter is always reset to 0 when there are no active regions. For some applications, this is a reasonable approach: every touch event has its own unique ID. However, some may wish to recycle IDs. If you&#8217;re in this situation, I made an abstraction that renumbers the IDs coming out of <strong>cv.jit.touches</strong> to re-use release IDs, and keep their values as low as possible. It will always output the smallest value that isn&#8217;t currently assigned to another active region.</p>
<p><a href="http://jmpelletier.com/data/cv.jit.touches.recycle.maxpat.zip">Download cv.jit.touches.recycle.</a></p>
<p>In order to use this file, just copy it to the &#8220;Max5/Cycling &#8217;74/cv.jit-support/Abstractions&#8221; folder.</p>
<p>You can see how it works by copying the following code and selecting the &#8220;new from clipboard&#8221; option from Max&#8217;s file menu.</p>
<pre>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">----------begin_max5_patcher----------<br />
911.3oc0XssbhBDD8Y8qfhmcslaL.6a6Ovturus0VoPXhRJfwBFiIap7uuLW<br />
zPRDbTPzTQfLyfNm9zce5FdY5D2E7mXUtNe24ONSl7xzISTSImXhY7D27nmh<br />
yhpT2laLOOmUHbmoWSvdRnl+2qJYLmEY7EU6VqXSdZQFSn9hv2ljuQraVfY1<br />
0Qh3UoEKuqjEKzvgR7lCl4.AgxK9pyH3bfyeMemzD0FyW7v27g61y64Ehhnb<br />
lZoeTlFk0bkpz+oVAhmCjy95zoxSy5qsukOjVNwm1zxwcZ4fqpk+qBsOeXLb<br />
LDYsgSCupF9OGTONBCs2vCFECOmUUEsj8ICONiEUNyYcTZgf+XTliGP9ABTG<br />
MW.Jmt9.ATGebIpdEHrdkEQEKadd2tlkVvh4aJTaM4PTM5fTMrKYEcxEQGpE<br />
n3ZJoEtldbtVushmWyzafq69eoAvMTv1VCjO4Ex3QIMIJKB+5fSLJs5rOIWz<br />
QzG9LXDERGAVI9w4OjJlK3ahWwplmTFs8fDD4TIHOOUhIlpqBA75jhfmAEUi<br />
66xiDkoOMnDkjNVuMsHgumIVWxEb4NuGYXDXwyHB3DBlPGkqH.UlU8ushqHf<br />
VHKT64QyT4RWrviZH+bsZ1AsZ7AsZ7wiPvgZ0ktkvAmirxr8TxW2DIDJnQhD<br />
zDbzBMAA2NIRGobnUEvPCRALCEZJfoaUD2R8qvqc4qqf9igeH.pM5OAim7ij<br />
KJWt.ksIOZPMUDQ08nePmOnP+xkFZgm1xmVTyPN.4eybtW9+HOucGtCR9ioY<br />
GS+e95QgsHTesyet.cgakTEdXnZC6piOgT0HRKbs2WUtdD09wfvlAuldNZQ7<br />
mbi9rKRcvr3DGhS7pnRoBsyPK9iLuHAbm8WftsjDspWrSflvGmlBTYjAzN6B<br />
6R2qp5dTYKe3EQp.tb92SZU7Mkw61IixgyaPOgUIRKhDo7hF2C5c2ypzjDVQ<br />
yWJSdZxZdcBtABj.xbOYcAO4ED1e+nV5HvVrRFdrhgAJPBTw7FrpF0SrRGdr<br />
1SDgr.Q9iJhBGdNpoGbP8m9VfU4yb4fOcv56qe72f8i5IXg1B1wyWKgDzFHA<br />
GUHgrARnwCR.K7bAipiyp.+QEQTaBuonaNVRg6yPdfFJu36Q1OpuDH1FzNt9<br />
zKP8RpmtADPPi9PTi5KXAVnbPgipxAEXg.KENpBrTfsYE2V0gniecHfMPBbS<br />
UZj1mRi0Cdc5+MONptI<br />
-----------end_max5_patcher-----------</div></div>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://jmpelletier.com/using-cv-jit-touches-recycling-index-values/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cv.jit 1.7 is finally out!</title>
		<link>http://jmpelletier.com/cv-jit-1-7-is-finally-out/</link>
		<comments>http://jmpelletier.com/cv-jit-1-7-is-finally-out/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 13:40:24 +0000</pubDate>
		<dc:creator>jovansystem</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[cv.jit]]></category>

		<guid isPermaLink="false">http://jmpelletier.com/?p=977</guid>
		<description><![CDATA[The latest version of cv.jit, 1.7.0 is finally out. I say finally because, it&#8217;s been on the brim of release for several months now, but life being what it is, I only now managed to put the finishing touches on it. The most obvious change is that the help files have been completely re-written in [...]]]></description>
			<content:encoded><![CDATA[<p>The latest version of cv.jit, 1.7.0 is finally out. I say finally because, it&#8217;s been on the brim of release for several months now, but life being what it is, I only now managed to put the finishing touches on it.</p>
<p>The most obvious change is that the help files have been completely re-written in Max 5 format. cv.jit 1.6 and earlier help files did not display properly in Max 5, owing to some issue with double-byte comments.</p>
<p>A few objects have been added also. <strong>cv.jit.opticalflow</strong> combines the functionality of cv.jit.LKflow and cv.jit.HSflow. These were two of the earliest externals I wrote, and I now somewhat regret the decision to keep them separate: they essentially do the same thing, albeit in different ways. <strong>cv.jit.opticalflow</strong> also adds support for two newer optical flow estimation algorithms: block-matching and a brand-new bleeding-edge real-time algorithm by Gunnar Farnebäck. To go along with this new external (and the two older optical flow objects), I also added a drawing utility, <strong>cv.jit.flow.draw</strong> that displays the optical flow field using hue for direction and saturation for distance.</p>
<div id="attachment_978" class="wp-caption aligncenter" style="width: 330px"><img class="size-full wp-image-978" title="fb-opticalflow" src="http://jmpelletier.com/media/fb-opticalflow.png" alt="" width="320" height="240" /><p class="wp-caption-text">Farnebäck optical flow, visualized with cv.jit.flow.draw</p></div>
<p>I often get questions about tracking blobs, or about dealing with the fact that cv.jit.label doesn&#8217;t always give the same label to what we would perceive as being the same object. The new object <strong>cv.jit.touches</strong>, sorts of addresses these issues. It&#8217;s a greyscale/binary region tracker. It assumes that the regions are of roughly the same size and don&#8217;t overlap. As the name implies, it was packaged with multi-touch interfaces in mind, and it outputs information such as &#8220;touch&#8221;, &#8220;drag&#8221; and &#8220;release&#8221;, but it can be used with other kinds of inputs.</p>
<p><strong>cv.jit.threshold</strong> implements adaptive thresholding, in which each pixel is compared to the average brightness of its surroundings instead of a fixed value. This is especially useful when working under slightly uneven lighting situations.</p>
<p>Finally, <strong>cv.jit.grab</strong> is a ridiculously simple but very useful abstraction that wraps jit.qt.grab and jit.dx.grab depending on your platform. This allows you to write cross-platform patches.</p>
<p>Another big change, apart from the help files, is that I moved the cv.jit site to my own domain. As mentioned in every help file and abstraction, IAMAS, the great media art institution in Gifu, Japan, has provided support for my work on cv.jit – in the form of computers, software, time, unwitting testers and advice from teachers and colleagues. Alas, my contract having reached its end, I don&#8217;t work there anymore and I thought that it might be best if I gathered all my work under the same roof, here. The actual files are hosted on Sourceforge, so that those who are interested in actually doing some development can dig in to the SVN repository.</p>
<p><a href="http://jmpelletier.com/cvjit/">Head over to the new cv.jit page for downloads!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jmpelletier.com/cv-jit-1-7-is-finally-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Ruby script for generating Jitter attributes</title>
		<link>http://jmpelletier.com/a-ruby-script-for-generating-jitter-attributes/</link>
		<comments>http://jmpelletier.com/a-ruby-script-for-generating-jitter-attributes/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 05:16:34 +0000</pubDate>
		<dc:creator>jovansystem</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[cv.jit]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://jmpelletier.com/?p=778</guid>
		<description><![CDATA[Manually adding attributes to a Jitter external requires a fair amount of tedious boilerplate. This Ruby script will do most of the boring work for you.]]></description>
			<content:encoded><![CDATA[<p>Writing your own Max or Jitter externals in C or C++ isn&#8217;t terribly hard, once you&#8217;ve wrapped your head around the API&#8217;s C approach to object oriented programming. However, it does involve a fair bit of boilerplate. This is especially true for adding attributes to an object – an triply so if this attribute has custom getter and setter methods.</p>
<p>The cv.jit collection now contains more than a few externals and I find myself spending more time trying to find ways to automate some of the repetitive tasks that are required for keeping it up to date. One of the tools I just made is a nifty Ruby script for automatically generating all the necessary attribute-related boilerplate. Simply invoke it at the command line with only a few arguments and it generates a .c file containing the necessary code. It parses the arguments &#8220;-c&#8221;, &#8220;-l&#8221;, &#8220;-f&#8221;, &#8220;-d&#8221;, &#8220;-s&#8221; and &#8220;-a&#8221; as &#8220;char&#8221;, &#8220;long&#8221;, &#8220;float32&#8243;, &#8220;float64&#8243;, &#8220;symbol and &#8220;atom&#8221; types. Numbers (if there are any) as the number of elements in a list. The arguments &#8220;-get&#8221; and &#8220;-set&#8221; specify that the attribute has a custom getter and setter, while &#8220;-clip&#8221; will add a filter to clip argument values. Any other argument is going to be parsed as the name of the attribute, unless it begins with a &#8220;-&#8221;, in which case, it&#8217;s interpreted as your external&#8217;s name (periods are automatically converted to underscores.)</p>
<p>For example:</p>
<div class="codecolorer-container bash dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ruby .<span style="color: #000000; font-weight: bold;">/</span>jitargs.rb <span style="color: #660033;">-f</span> -cv.jit.bigbrother foo</div></div>
<p>This generates a file &#8220;jitter_args.c&#8221; in the current directory that looks like this:</p>
<div class="codecolorer-container cpp dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">//setter/getter declarations</span><br />
<br />
<span style="color: #666666;">//attribute variables</span><br />
<span style="color: #0000ff;">float</span> foo<span style="color: #008080;">;</span><br />
<br />
<span style="color: #666666;">//setters/getters</span><br />
<br />
<span style="color: #666666;">//attribute registration</span><br />
attr <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span>t_jit_object <span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span>jit_object_new<span style="color: #008000;">&#40;</span>_jit_sym_jit_attr_offset,<span style="color: #FF0000;">&quot;foo&quot;</span>,_jit_sym_float32,<br />
&nbsp; &nbsp; attrflags,<span style="color: #008000;">&#40;</span>method<span style="color: #008000;">&#41;</span><span style="color: #0000dd;">0L</span>,<span style="color: #008000;">&#40;</span>method<span style="color: #008000;">&#41;</span><span style="color: #0000dd;">0L</span>,calcoffset<span style="color: #008000;">&#40;</span>t_cv_jit_bigbrother,foo<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
jit_attr_addfilterset_clip<span style="color: #008000;">&#40;</span>attr,<span style="color: #0000dd;">0</span>,<span style="color: #0000dd;">1</span>,TRUE,TRUE<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
jit_class_addattr<span style="color: #008000;">&#40;</span>_cv_jit_bigbrother_class,attr<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<br />
<br />
<span style="color: #666666;">//attribute initialization</span><br />
x<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>foo <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span></div></div>
<p>If you wish to add more attributes, just run the script again with different arguments, new code will be inserted in the appropriate place. For example, by  running the following:</p>
<div class="codecolorer-container bash dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ruby .<span style="color: #000000; font-weight: bold;">/</span>jitargs.rb <span style="color: #660033;">-a</span> <span style="color: #660033;">-get</span> <span style="color: #660033;">-set</span> <span style="color: #000000;">2</span> &nbsp;-cv.jit.bigbrother bar</div></div>
<p>The file above is modified to:</p>
<div class="codecolorer-container cpp dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">//setter/getter declarations</span><br />
t_jit_err cv_jit_bigbrother_set_bar<span style="color: #008000;">&#40;</span>t_cv_jit_bigbrother <span style="color: #000040;">*</span>x, <span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span>attr, <span style="color: #0000ff;">long</span> ac, t_atom <span style="color: #000040;">*</span>av<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
t_jit_err cv_jit_bigbrother_get_bar<span style="color: #008000;">&#40;</span>t_cv_jit_bigbrother <span style="color: #000040;">*</span>x, <span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span>attr, <span style="color: #0000ff;">long</span> <span style="color: #000040;">*</span>ac, t_atom <span style="color: #000040;">**</span>av<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<br />
<span style="color: #666666;">//attribute variables</span><br />
<span style="color: #0000ff;">long</span> barcount<span style="color: #008080;">;</span><br />
t_atom bar<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span><br />
<span style="color: #0000ff;">float</span> foo<span style="color: #008080;">;</span><br />
<br />
<span style="color: #666666;">//setters/getters</span><br />
t_jit_err cv_jit_bigbrother_set_bar<span style="color: #008000;">&#40;</span>t_cv_jit_bigbrother <span style="color: #000040;">*</span>x, <span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span>attr, <span style="color: #0000ff;">long</span> ac, t_atom <span style="color: #000040;">*</span>av<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>ac <span style="color: #000080;">&lt;</span> <span style="color: #0000dd;">2</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666;">//Not enough parameters?</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">return</span> JIT_ERR_NONE<span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">return</span> JIT_ERR_NONE<span style="color: #008080;">;</span><br />
<span style="color: #008000;">&#125;</span><br />
<br />
t_jit_err cv_jit_bigbrother_get_bar<span style="color: #008000;">&#40;</span>t_cv_jit_bigbrother <span style="color: #000040;">*</span>x, <span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span>attr, <span style="color: #0000ff;">long</span> <span style="color: #000040;">*</span>ac, t_atom <span style="color: #000040;">**</span>av<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#123;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">int</span> i<span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #000040;">*</span>ac<span style="color: #008000;">&#41;</span><span style="color: #000040;">&amp;&amp;</span><span style="color: #008000;">&#40;</span><span style="color: #000040;">*</span>av<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666;">//memory passed in, use it</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span> <span style="color: #0000ff;">else</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666;">//otherwise allocate memory</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000040;">*</span>ac <span style="color: #000080;">=</span> <span style="color: #0000dd;">2</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #000040;">!</span><span style="color: #008000;">&#40;</span><span style="color: #000040;">*</span>av <span style="color: #000080;">=</span> jit_getbytes<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">sizeof</span><span style="color: #008000;">&#40;</span>t_atom<span style="color: #008000;">&#41;</span><span style="color: #000040;">*</span><span style="color: #008000;">&#40;</span><span style="color: #000040;">*</span>ac<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000040;">*</span>ac <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">return</span> JIT_ERR_OUT_OF_MEM<span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">for</span><span style="color: #008000;">&#40;</span>i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>i<span style="color: #000080;">&lt;</span><span style="color: #0000dd;">2</span><span style="color: #008080;">;</span>i<span style="color: #000040;">++</span><span style="color: #008000;">&#41;</span>av<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> x<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>bar<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">return</span> JIT_ERR_NONE<span style="color: #008080;">;</span><br />
<span style="color: #008000;">&#125;</span><br />
<br />
<br />
<span style="color: #666666;">//attribute registration</span><br />
attr <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span>t_jit_object <span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span>jit_object_new<span style="color: #008000;">&#40;</span>_jit_sym_jit_attr_offset_array, <span style="color: #FF0000;">&quot;bar&quot;</span>, _jit_sym_atom, <span style="color: #0000dd;">2</span>, <br />
&nbsp; &nbsp; attrflags, <span style="color: #008000;">&#40;</span>method<span style="color: #008000;">&#41;</span>cv_jit_bigbrother_get_bar,<span style="color: #008000;">&#40;</span>method<span style="color: #008000;">&#41;</span>cv_jit_bigbrother_set_bar, <br />
&nbsp; &nbsp; calcoffset<span style="color: #008000;">&#40;</span>t_cv_jit_bigbrother, barcount<span style="color: #008000;">&#41;</span>,calcoffset<span style="color: #008000;">&#40;</span>t_cv_jit_bigbrother,bar<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
jit_class_addattr<span style="color: #008000;">&#40;</span>_cv_jit_bigbrother_class,attr<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<br />
attr <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span>t_jit_object <span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span>jit_object_new<span style="color: #008000;">&#40;</span>_jit_sym_jit_attr_offset,<span style="color: #FF0000;">&quot;foo&quot;</span>,_jit_sym_float32,<br />
&nbsp; &nbsp; attrflags,<span style="color: #008000;">&#40;</span>method<span style="color: #008000;">&#41;</span><span style="color: #0000dd;">0L</span>,<span style="color: #008000;">&#40;</span>method<span style="color: #008000;">&#41;</span><span style="color: #0000dd;">0L</span>,calcoffset<span style="color: #008000;">&#40;</span>t_cv_jit_bigbrother,foo<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
jit_attr_addfilterset_clip<span style="color: #008000;">&#40;</span>attr,<span style="color: #0000dd;">0</span>,<span style="color: #0000dd;">1</span>,TRUE,TRUE<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
jit_class_addattr<span style="color: #008000;">&#40;</span>_cv_jit_bigbrother_class,attr<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<br />
<br />
<span style="color: #666666;">//attribute initialization</span><br />
jit_atom_setlong<span style="color: #008000;">&#40;</span><span style="color: #000040;">&amp;</span>x<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>bar<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #008000;">&#93;</span>,<span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
jit_atom_setlong<span style="color: #008000;">&#40;</span><span style="color: #000040;">&amp;</span>x<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>bar<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#93;</span>,<span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
x<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>foo <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span></div></div>
<p>All you need to do now is copy and paste the code at the appropriate places. Of course, if I was really crazy, I would write a script that parses and modifies the actual external source but I’ll leave that as an exercise for the reader.</p>
<p><a href="http://jmpelletier.com/data/jitargs.rb.zip">Download the script.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jmpelletier.com/a-ruby-script-for-generating-jitter-attributes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cv.jit &#8211; New update available</title>
		<link>http://jmpelletier.com/cv-jit-new-update-available/</link>
		<comments>http://jmpelletier.com/cv-jit-new-update-available/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 03:27:43 +0000</pubDate>
		<dc:creator>jovansystem</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Computer vision]]></category>
		<category><![CDATA[cv.jit]]></category>

		<guid isPermaLink="false">http://localhost/wordpress/2008/cv-jit-new-update-available/</guid>
		<description><![CDATA[A new update to cv.jit, a collection of Max/Jitter externals for computer vision is now available for download. There is only one new object, cv.jit.snake, which is an implementation of active contour algorithms. Starting with this release, cv.jit is now open source. You can now download the source code and project files from the download pages.]]></description>
			<content:encoded><![CDATA[<p>A new update to <a href="http://www.iamas.ac.jp/~jovan02/cv/">cv.jit</a>, a collection of Max/Jitter externals for computer vision is now available for download. There is only one new object, <span class="Apple-style-span" style="font-style: italic;">cv.jit.snake</span>, which is an implementation of active contour algorithms.
<div></div>
<div>Starting with this release, <a href="http://www.iamas.ac.jp/~jovan02/cv/">cv.jit</a> is now open source. You can now download the source code and project files from the <a href="http://www.iamas.ac.jp/~jovan02/cv/download.html">download pages</a>.</div>
]]></content:encoded>
			<wfw:commentRss>http://jmpelletier.com/cv-jit-new-update-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

