Logitech Orbit C# and C++ webcam control

Posted by Mike Dwyer | Filed under

Really just posting this to get some info out there.  This is a project I would like to enhance as far as the detection portion.  The current state of the project is I have written a C# .NET app running with unmanaged dll to control a logitech web cam.  For those unfamiliar with the logitech orpit, it is a pan tilt zoom camara (PTZ).   The goal of this app was to have the .NET code control the webcam motors.  The second part is to add face detection.  I use the openCV for the face detection and tracking.  Currently the app works fairly well in my office following me, but not so well in the living room following others at a distance.  Part of the problem is the detection that I am using is very slow.  I haven't fully tied into the openCV, so that is part of the problem.  Secondly, the code I use to determine which way to move the motors of the cam needs a little work.  It tries to follow the motion of the face and move, but it is a little choppy.  If I move slow, it does in face follow me and zoom to keep me centered.  If I move to quick, it will lose me.  I have not coded in to follow the motion and make a guess as to which way to keep moving to try and find me again.  I am looking for others to help keep this project moving as I would like to add other detection capabilities besides just faces.  

 The code attached has a clever project name of "test".  In it you will find one of the projects has a form.  Open the form to see the different controls, I think it is all pretty self explanatory on the controls on the form.  The main point here was to run the unmanaged code to control the camara.  This should be very easy from the samples included to run in an ASP.NET webcam to monitor your house from remote and control the direction of the camara.  The face detection routines, like I mentioned, or a little slow, but can be pulled out for monitoring your house from remote.  Please upload any changes/ideas.  If you would like to help with this project, feel free to contact me.

 The orbitCamControlDotNet.zip references the project webcamlib.  I had all folders in c:\projects.  If you create your own folder structure, make sure to reference the project accordingly.

 Also, you will need to get and install OpenCV.  Make sure you download version 1.0 (2006-10-19 15:43), otherwise you will get compile errors.  You can download opencv from:  http://sourceforge.net/project/showfiles.php?group_id=22870&package_id=16937

NEW:  If you use a newer version of OpenCV, Open objectLocater.h
Look for: char* Helper( const CvSeq *seq, int index )
Add the word signed in front, so it will look like:
signed char* Helper( const CvSeq *seq, int index )

Rebuild and all should be good.

If you get an error that a module can not be found when running the app, go to the binl folder for openCV (c:\program files\opencv\bin) and copy the following files to your working bin folder:
cv100.dll (or cv110.dll for newer versions)
cxcore100.dll (or cxcore110.dll)
libguide40.dll

OrbitCamControlDotNet.zip (2.12 mb)

webcamlib.zip (76.33 kb)

Cascades.zip (364.13 kb) (unzip into a folder called cascades in the folder where the exe runs)

 For the record, the face detection code and explanation can be found at:
http://www.codeproject.com/KB/library/eyes.aspx

 10/14/2009 UPDATE:  Ben Ford has given me a version of PTZ that uses pure .NET (no external DLLS).  I have not looked at this yet, but thought I would post as is.  I assume it is only camara control and not face detection, so this may give most users a little more what they want:  ptz.zip (227.56 kb)

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading