<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.phidgets.com/docs21/index.php?action=history&amp;feed=atom&amp;title=Image_Processing_on_the_SBC</id>
	<title>Image Processing on the SBC - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.phidgets.com/docs21/index.php?action=history&amp;feed=atom&amp;title=Image_Processing_on_the_SBC"/>
	<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Image_Processing_on_the_SBC&amp;action=history"/>
	<updated>2026-04-05T15:59:12Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Image_Processing_on_the_SBC&amp;diff=23943&amp;oldid=prev</id>
		<title>Mparadis at 19:10, 7 June 2017</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Image_Processing_on_the_SBC&amp;diff=23943&amp;oldid=prev"/>
		<updated>2017-06-07T19:10:05Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:10, 7 June 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l92&quot;&gt;Line 92:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 92:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You can download the full source code [{{SERVER}}/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;wiki&lt;/del&gt;/images/4/4b/Opencvtest.c here].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You can download the full source code [{{SERVER}}/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;docs21&lt;/ins&gt;/images/4/4b/Opencvtest.c here].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==A note on compiling==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==A note on compiling==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Mparadis</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Image_Processing_on_the_SBC&amp;diff=22841&amp;oldid=prev</id>
		<title>Burley at 16:18, 31 October 2012</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Image_Processing_on_the_SBC&amp;diff=22841&amp;oldid=prev"/>
		<updated>2012-10-31T16:18:01Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:18, 31 October 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Application Guides]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Having a webcam is all well and good, but what can we &amp;#039;&amp;#039;do&amp;#039;&amp;#039; with it?  Well as it turns out, rather a lot.  Computer vision (CV) is a big part of advanced robotics and CV algorithms have become the subject of much interest in recent years.  Allowing your robot to &amp;quot;see&amp;quot; its surroundings is one of the most powerful things you can do to allow it to perform complex tasks.  One of the most prominent tools in CV development is OpenCV.  OpenCV is a set of libraries developed by Intel to aid in image processing tasks.  Luckily for us, OpenCV works well on the SBC and can be installed with minimal difficulty.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Having a webcam is all well and good, but what can we &amp;#039;&amp;#039;do&amp;#039;&amp;#039; with it?  Well as it turns out, rather a lot.  Computer vision (CV) is a big part of advanced robotics and CV algorithms have become the subject of much interest in recent years.  Allowing your robot to &amp;quot;see&amp;quot; its surroundings is one of the most powerful things you can do to allow it to perform complex tasks.  One of the most prominent tools in CV development is OpenCV.  OpenCV is a set of libraries developed by Intel to aid in image processing tasks.  Luckily for us, OpenCV works well on the SBC and can be installed with minimal difficulty.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Burley</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Image_Processing_on_the_SBC&amp;diff=22840&amp;oldid=prev</id>
		<title>Burley: /* Results */</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Image_Processing_on_the_SBC&amp;diff=22840&amp;oldid=prev"/>
		<updated>2012-10-31T16:17:41Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Results&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:17, 31 October 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l107&quot;&gt;Line 107:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 107:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Results==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Results==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:redpixeltest.png]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:redpixeltest.png&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|link=&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;These tests were run with {{Code|./a.out 100 75 75}}.  What that means is it will accept any pixel with an RGB value of &amp;gt;99, &amp;lt;76, &amp;lt;76.  These numbers could be fine-tuned a bit so that you cut out the pixels it was picking up in the carpet but it obviously works in principle.  The second test even shows that it is sensitive enough to pick up a laser dot from a small laser pointer.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;These tests were run with {{Code|./a.out 100 75 75}}.  What that means is it will accept any pixel with an RGB value of &amp;gt;99, &amp;lt;76, &amp;lt;76.  These numbers could be fine-tuned a bit so that you cut out the pixels it was picking up in the carpet but it obviously works in principle.  The second test even shows that it is sensitive enough to pick up a laser dot from a small laser pointer.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Burley</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Image_Processing_on_the_SBC&amp;diff=22839&amp;oldid=prev</id>
		<title>Burley: /* Using OpenCV in your program */</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Image_Processing_on_the_SBC&amp;diff=22839&amp;oldid=prev"/>
		<updated>2012-10-31T16:17:07Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Using OpenCV in your program&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:17, 31 October 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l91&quot;&gt;Line 91:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 91:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You can download the full source code [{{SERVER}}wiki/images/4/4b/Opencvtest.c here].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You can download the full source code [{{SERVER}}&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;/&lt;/ins&gt;wiki/images/4/4b/Opencvtest.c here].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==A note on compiling==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==A note on compiling==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Burley</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Image_Processing_on_the_SBC&amp;diff=22838&amp;oldid=prev</id>
		<title>Burley: /* Using OpenCV in your program */</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Image_Processing_on_the_SBC&amp;diff=22838&amp;oldid=prev"/>
		<updated>2012-10-31T16:16:25Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Using OpenCV in your program&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:16, 31 October 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l91&quot;&gt;Line 91:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 91:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You can download the full source code [{{SERVER}}&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;/&lt;/del&gt;wiki/images/4/4b/Opencvtest.c here].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You can download the full source code [{{SERVER}}wiki/images/4/4b/Opencvtest.c here].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==A note on compiling==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==A note on compiling==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Burley</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs21/index.php?title=Image_Processing_on_the_SBC&amp;diff=22835&amp;oldid=prev</id>
		<title>Burley: Created page with &quot;Having a webcam is all well and good, but what can we &#039;&#039;do&#039;&#039; with it?  Well as it turns out, rather a lot.  Computer vision (CV) is a big part of advanced robotics and CV algo...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs21/index.php?title=Image_Processing_on_the_SBC&amp;diff=22835&amp;oldid=prev"/>
		<updated>2012-10-31T16:14:52Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Having a webcam is all well and good, but what can we &amp;#039;&amp;#039;do&amp;#039;&amp;#039; with it?  Well as it turns out, rather a lot.  Computer vision (CV) is a big part of advanced robotics and CV algo...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Having a webcam is all well and good, but what can we &amp;#039;&amp;#039;do&amp;#039;&amp;#039; with it?  Well as it turns out, rather a lot.  Computer vision (CV) is a big part of advanced robotics and CV algorithms have become the subject of much interest in recent years.  Allowing your robot to &amp;quot;see&amp;quot; its surroundings is one of the most powerful things you can do to allow it to perform complex tasks.  One of the most prominent tools in CV development is OpenCV.  OpenCV is a set of libraries developed by Intel to aid in image processing tasks.  Luckily for us, OpenCV works well on the SBC and can be installed with minimal difficulty.&lt;br /&gt;
&lt;br /&gt;
Note that many image processing applications are extremely computationally intense and may be too much for the SBC to handle.  This makes it important to test your application as early in the development cycle as you can so you can get a good feeling of how the SBC will cope with the amount of work you are requesting of it.&lt;br /&gt;
&lt;br /&gt;
This document is going to walk through setting up OpenCV, and then writing a small program that detects red objects in an image.&lt;br /&gt;
&lt;br /&gt;
==Setting up OpenCV==&lt;br /&gt;
In order to use OpenCV on your machine you will first need to install the libraries and development files.  To do this use {{Code|apt-get install}} and install the following packages from the Debian package repository:&lt;br /&gt;
&lt;br /&gt;
*libcv2.1&lt;br /&gt;
*libhighgui2.1&lt;br /&gt;
*libcvaux2.1&lt;br /&gt;
*libcv-dev&lt;br /&gt;
*libhighgui-dev&lt;br /&gt;
*libaux-dev&lt;br /&gt;
&lt;br /&gt;
If apt-get cannot find these packages that may mean there are newer versions available.  Use {{Code|apt-cache search opencv}} to find out what the most up to date version is and install that instead.&lt;br /&gt;
&lt;br /&gt;
In order to make sure it installed properly, check to see that the files are in the right location.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls /usr/include/opencv&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In particular you are looking for {{Code|cv.h}} and {{Code|highgui.h}}.  Some versions of OpenCV (if you aren&amp;#039;t installing 2.1) put highgui.h in a separate folder and give it a slightly different name (highgui_&amp;#039;&amp;#039;somecharacters&amp;#039;&amp;#039;.h&amp;gt;.  If you do not see both {{Code|cv.h}} and {{Code|highgui.h}} in  /usr/include/opencv then you may have to search around a bit to find them.&lt;br /&gt;
&lt;br /&gt;
==Using OpenCV in your program==&lt;br /&gt;
Once you have installed OpenCV you can begin writing your code.  Make sure you include the necessary libraries:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;cv.h&amp;gt;&lt;br /&gt;
#include &amp;lt;highgui.h&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first thing we should do is capture an image from the webcam:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
CvCapture* capture = cvCaptureFromCAM(CV_CAP_ANY); //select which webcam to capture from (in this case whichever it can find)&lt;br /&gt;
if(!capture){ //make sure it found a camera to capture from&lt;br /&gt;
	fprintf(stderr, &amp;quot;Error: capture is NULL \n&amp;quot;);&lt;br /&gt;
	getchar();&lt;br /&gt;
	return -1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
IplImage* img = cvQueryFrame(capture); //take the picture&lt;br /&gt;
IplImage* copy = cvCreateImage(cvGetSize(img),8,3); //create a new image of 8 bit 3 channel.  this will store to modifications we make.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we want to check to image and search for red pixels:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
for(int i=0;i&amp;lt;(img-&amp;gt;height);i++){ //in the image.. go loop until the vertical pixel reaches the height of img&lt;br /&gt;
	for(int j=0;j&amp;lt;(img-&amp;gt;width);j++){ //in the image.. loop until horizontal pixel reaches the width of img&lt;br /&gt;
		s=cvGet2D(img,i,j); //get the RGB values of img&amp;#039;s i,j, into a scalar container, s&lt;br /&gt;
		if((s.val[2]&amp;gt;atoi(&amp;amp;*argv[1]))&amp;amp;&amp;amp;(s.val[1]&amp;lt;atoi(&amp;amp;*argv[2]))&amp;amp;&amp;amp;(s.val[0]&amp;lt;atoi(&amp;amp;*argv[3]))){ //if(RED&amp;gt;redlower &amp;amp;&amp;amp; GREEN&amp;lt;greenupper &amp;amp;&amp;amp; BLUE&amp;lt;blueupper)&lt;br /&gt;
&lt;br /&gt;
			c.val[2] = s.val[2];&lt;br /&gt;
			c.val[1] = s.val[1];&lt;br /&gt;
			c.val[0] = s.val[0];&lt;br /&gt;
			cvSet2D(copy,i,j,c);&lt;br /&gt;
			redpixelcount++;&lt;br /&gt;
		}&lt;br /&gt;
		else&lt;br /&gt;
		{&lt;br /&gt;
			c.val[2] = 255;&lt;br /&gt;
			c.val[1] = 255;&lt;br /&gt;
			c.val[0] = 255;&lt;br /&gt;
			cvSet2D(copy,i,j,c); //make any non-red pixel white&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice we have the limits for color be settable via command-line argument.  Once this is all done we can save the images and print out the red pixel tally:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
printf(&amp;quot;Red pixel count is: %d \n&amp;quot;, redpixelcount);&lt;br /&gt;
&lt;br /&gt;
cvSaveImage(&amp;quot;original.jpg&amp;quot;,img);	&lt;br /&gt;
cvSaveImage(&amp;quot;redDetect.jpg&amp;quot;,copy);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can download the full source code [{{SERVER}}/wiki/images/4/4b/Opencvtest.c here].&lt;br /&gt;
&lt;br /&gt;
==A note on compiling==&lt;br /&gt;
To compile you will need to link the correct libraries.  To do this use the pkg-config tool.  You may need to install it with apt-get before you can use it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;source&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
g++ opencvtest.c `pkg-config --cflags --libs opencv`&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you had to search for highgui.h previously because it was not in the same directory as cv.h then you will need to link it separately based on what path it got installed to (likely opencv2 or highgui).&lt;br /&gt;
&lt;br /&gt;
Note that since OpenCV is designed for C++ you will need to use g++ rather than gcc in order to compile.&lt;br /&gt;
&lt;br /&gt;
==Results==&lt;br /&gt;
[[File:redpixeltest.png]]&lt;br /&gt;
&lt;br /&gt;
These tests were run with {{Code|./a.out 100 75 75}}.  What that means is it will accept any pixel with an RGB value of &amp;gt;99, &amp;lt;76, &amp;lt;76.  These numbers could be fine-tuned a bit so that you cut out the pixels it was picking up in the carpet but it obviously works in principle.  The second test even shows that it is sensitive enough to pick up a laser dot from a small laser pointer.&lt;/div&gt;</summary>
		<author><name>Burley</name></author>
	</entry>
</feed>