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

ajaxcontroltoolkit

Posted by Mike Dwyer | Filed under
I was pretty excited to see the ajaxcontroltoolkit and have tried to use it quite a bit.  Unfortunately, I have run into walls with real world implementations of these items.  Fortunately, the authors have made it open source so making changes, though difficult at times, is possible.  I have customized the autocomplete extender and am currently working on the masked edit extender.  I will post all code once I have updates.  I would be interested in others to work on some of these extenders, or at least post some wish list items as I make releases.  I will see as we go along, what is needed to post the items to codeplex so maybe they implement some of the customizations.

Be the first to rate this post

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

Ajaxcontroltoolkit Masked Extender Extended

Posted by Mike Dwyer | Filed under

For those who have worked around with the ajaxcontroltoolkit masked edit extender, you most likely have noticed how difficult it is for users to edit text.  For instance, if you are using a date mask, and the user wishes to change the day part of the date, they will generally click to the number they would like to change, delete the number with either del or backspace, then type in the correction.  However, when hitting del or backspace, the character to delete will delete as expected, the remaining text will move to the left as expected, however, when the user types in the new number, the text is overwritten instead of inserted.  Ok, that was a pretty long sentence.  The modified version I have currently adds a new property to allow the developer to put in insert mode.  If insert mode is activated, then when the user types in a character, the text will move to the right as you would expect, instead of overwriting.  I am currently working on a feature to have it automatically select text when you click in the box.  For instance, on a date mask, if you click in the month area, it will select the first 2 characters, or if you click on the year portion, it will select the last 4 allowing you to change the text quickly. 

The code below has one solution with 2 projects.  The web project is really just a default.aspx page with the extender in so you can play around with.  The other project obviously has the code for the custom masked edit extender.  The way to tell the difference between this and the original is when you have the masked box filled in, and cursor over and delete or backspace, you will see this custom handler will move text to the right like most textboxes, compared to the original which overwrites text.  Feel free to take a look and upload and changes and let me know any comments.

customMaskedEditExtender.zip (1.03 mb)

Currently rated 1.0 by 1 people

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