<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
> <i>I am having problems with getting data from the CCD
(basically i don't know how to do it :), can you give me a tip for
doing this? Or explain how you did it please?</i><br>
<br>
I am using the OpenCV library to grab images. Here are the
specific lines of code:<br>
<br>
<pre><div class="line" id="LC109"><span class="bp">self</span><span class="o">.</span><span class="n">capture</span> <span class="o">=</span> <span class="n">cv</span><span class="o">.</span><span class="n">CaptureFromCAM</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span><span class="n">
cv</span><span class="o">.</span><span class="n">SetCaptureProperty</span><span class="p">(</span> <span class="bp">self</span><span class="o">.</span><span class="n">capture</span><span class="p">,</span> <span class="n">cv</span><span class="o">.</span><span class="n">CV_CAP_PROP_FRAME_WIDTH</span><span class="p">,</span> <span class="mi">320</span> <span class="p">);</span><span class="n">
cv</span><span class="o">.</span><span class="n">SetCaptureProperty</span><span class="p">(</span> <span class="bp">self</span><span class="o">.</span><span class="n">capture</span><span class="p">,</span> <span class="n">cv</span><span class="o">.</span><span class="n">CV_CAP_PROP_FRAME_HEIGHT</span><span class="p">,</span> <span class="mi">240</span> <span class="p">);</span><span class="n">
frame</span> <span class="o">=</span> <span class="n">cv</span><span class="o">.</span><span class="n">QueryFrame</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">capture</span><span class="p">) # ...this is done repeatedly in the main loop.</span></div></pre>
<br>
These were copied from the examples that came with OpenCV. I
don't know if this will work under Windows.<br>
<br>
The source code to my script is available online; I recommend
downloading it and playing with it. Also, check out the OpenCV
Python documentation.<br>
<br>
<br>
Thanks,<br>
Derek<br>
<br>
On 09/30/2011 07:06 AM, Ricardo Mansilla wrote:
<blockquote cite="mid:201109300906.43128.rick.mansilla@gmail.com"
type="cite">
<meta name="qrichtext" content="1">
<style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin: 0px; text-indent: 0px;">On Thursday 29 September
2011 21:16:52 you wrote:</p>
<p style="margin: 0px; text-indent: 0px;">> Hello,</p>
<p style="margin: 0px; text-indent: 0px;">> I have a neat
Python project I'd like to share. It does real-time motion</p>
<p style="margin: 0px; text-indent: 0px;">> tracking, using the
Python bindings to the OpenCV library:</p>
<p style="margin: 0px; text-indent: 0px;">> </p>
<p style="margin: 0px; text-indent: 0px;">>
<a class="moz-txt-link-freetext" href="http://derek.simkowiak.net/motion-tracking-with-python/">http://derek.simkowiak.net/motion-tracking-with-python/</a></p>
<p style="margin: 0px; text-indent: 0px;">> </p>
<p style="margin: 0px; text-indent: 0px;">> There is a YouTube
video showing the script in action.</p>
<p style="margin: 0px; text-indent: 0px;">> </p>
<p style="margin: 0px; text-indent: 0px;">> It's especially
neat because my daughter and I worked together on this</p>
<p style="margin: 0px; text-indent: 0px;">> project. We used it
to track her two pet gerbils, as part of her science</p>
<p style="margin: 0px; text-indent: 0px;">> fair project. She
wrote her own (separate) Python script to read the</p>
<p style="margin: 0px; text-indent: 0px;">> motion tracking log
files, compute distance and velocity, and then</p>
<p style="margin: 0px; text-indent: 0px;">> export those values
in a CSV file. Like I say on the web page: "I’m</p>
<p style="margin: 0px; text-indent: 0px;">> convinced that
Python is the best language currently available for</p>
<p style="margin: 0px; text-indent: 0px;">> teaching kids how
to program."</p>
<p style="margin: 0px; text-indent: 0px;">> </p>
<p style="margin: 0px; text-indent: 0px;">> I also use Python
professionally, and it's worked out great every time.</p>
<p style="margin: 0px; text-indent: 0px;">> There's no job
Python can't handle.</p>
<p style="margin: 0px; text-indent: 0px;">> </p>
<p style="margin: 0px; text-indent: 0px;">> </p>
<p style="margin: 0px; text-indent: 0px;">> Thanks,</p>
<p style="margin: 0px; text-indent: 0px;">> Derek Simkowiak</p>
<p style="margin: 0px; text-indent: 0px;">>
<a class="moz-txt-link-freetext" href="http://derek.simkowiak.net">http://derek.simkowiak.net</a></p>
<p style="margin: 0px; text-indent: 0px;">Hi, this is awesome!!</p>
<p style="margin: 0px; text-indent: 0px;"> I'm currently working
in something similar, but I am having problems with getting data
from the CCD (basically i don't know how to do it :), can you
give me a tip for doing this? Or explain how you did it please?</p>
<p style="margin: 0px; text-indent: 0px;">I not a newbie at python
but not as experienced as evidently you are.</p>
<p style="margin: 0px; text-indent: 0px;">Thanks a lot in advance.</p>
<p style="margin: 0px; text-indent: 0px;"><br>
-- </p>
<p style="margin: 0px; text-indent: 0px;"><span style="font-style:
italic;">(...)Also, since that same law states that any system
able to prove its consistency to itself must be inconsistent;
any mind that believes it can prove its own sanity is,
therefore, insane.(...) </span></p>
<p style="margin: 0px; text-indent: 0px;"><span
style="font-weight: 600;">Kurt Gödel</span>. </p>
</blockquote>
<br>
</body>
</html>