ST. Norbert College
CS 460: Senior Capstone Experience in Computer Science
Spring 2005
Project Presentation
Motoring a Web Camera over the Internet
Kevin Papreck
http:\\compsci.snc.edu\cs460\paprks
Part 1: Project Description
Definition and Requirements: "This is what I started with"
When I went in to Dr. Pankratz's office for the first time, I was given a sheet that had the project description which said that I have to develop a two-axis web cam that can be controlled over the internet.
Along with this were some general requirements. These included:
The camera can be moved horizontally and vertically from a standard client web browser.
Pictures are updated at the browser on demand
Pictures update in real-time with the time stamp of the latest picture displayed on the client's screen.
The system deals with any racing conditions caused by multiple users
The system deals with user permissions and maintains a log of usage
The system can center an object
He also gave me a web camera gadget board, stepper motors, and the web camera from someone that tried this project in one of the previous years.
Solution(s): "Here is what I did"
Streaming video using TrackerCam and Dorgem and a JavaScript refresh. This made it so the pictures are updated at real time.
With Dorgem I made it so that it shows the date and time stamp of the latest picture displayed on the client's screen.
Designed a pan/tilt using servo motors and a Logitech webcam.
Designed a Visual Basic.NET ASP.NET Web Application to move the motors remotely from anywhere on the internet
Dealt with user permissions having a login page which is required for anyone to move the motors
Dealt with racing conditions, only allowing one user at a time and forcing a signout after 30 seconds of no activity
Made a xml database to store log of usage storing user names and the time and date that they logged into the system.
Exceptions: "This is what I didn't solve."
I solved every thing I was asked. The only thing I could not figure out was a zoom function besides the one from the TrackerCam program.
Methodology: "These are the methods, techniques, designs, experiments that I used."
One major challenge to my project was using Visual Studio.NET. I was given this program by another CS major a couple years ago, but I never tried it out. I decided that instead of using Perl or Visual Studio 6.0, I wanted to learn Visual Studio.NET for my project. It took a lot of experimenting and adapting to learn everything from .NET remoting to .NET web services to even .NET web applications. It was also a challenge because although easy to adapt to, I have not used Visual Basic since I was a senior in High School. Also, I had never used ASP before, so that brought another challenge to my project.
Steps to completion...
To start with, I did a lot of research on streaming video over the internet. When I was presented with the motors and everything, it was kind of too much for me at the time so I just put them to the side. At this point I was already trying tutorials online to figure out .NET remoting and .NET web services to try to get the capture to go online. (I also use this come back to these tutorials when trying to get my pan and tilt program up and running remotely). Working on the streaming video was a huge task, and I could not figure out any of the .NET server-side programming. I also ran into the problem that Logitech's SDK does not work for the particular web camera that I was using. When I ran into open source programs on the internet I decided that that would be the best route to go. I decided to use both Dorgem and TrackerCam software.
After this was up and running I had to move on to the motors. For the motors, after some research I decided that servo
Once the motors came in, I had my father help me do the motor design. This came out to be quite a complicated adventure. It ended up taking numerous tries and designs before we came with the final design.
After this was done, it was on with trying to get the motors online. It was easy to get them to work locally, but I could not figure anything out in bringing them onto the internet. Phidgets offered free code that would move the motors in c++, visual basic 6.0, and visual basic script. The problem was their script only worked locally, and they said they had no clue how to get it to be remotely controlled. I was really stumped here, but one day I decided to try to make an Visual Basic ASP.NET web application. I converted all of the code from the simplest servo motor program and had to design a new web form. I tried it and it worked locally. Then I went online, and had my brother try it from Georgia, and when he loaded the page it would move my motors! I was very happy and ran to tell Dr. Pankratz what I did. My talking at 110 mph left him clueless about what I was talking about so I figured when I got the real design down I would come back in. When I got home I worked all day and the next to convert the other program over. I ran into huge problems in that I wanted a slider on the form. But ASP.NET does not allow sliders. I tried many things before Dr. Pankratz's asked me why I wanted a slider. I realized that I really did not need one at all, and started a new web program from scratch. I made the web form with some controls on it and took some of the Phidgets code to help me figure out how to move the motors. I thought of this step as my biggest accomplishment, and once done I explained it to Dr. Pankratz in a much more detailed slowwwweeeerrr manner.
Next was a login page and add user pages. After doing some research on databases I decided to make a xml database to store usernames and passwords. I found a tutorial online to help me get through this step. The database stores the username and an encrypted password in the users.xml file.
The last part of my project was dealing with racing conditions caused by multiple users. This was a huge challenge to me. The problem is that the shortest session timeout is one minute, and a session timeout time resets every time the user presses any button. Another problem is that there is no way to tell if someone just closes the window without signing out. Another problem was with server side timers. They just did not work right at all. I ended up solving the problem by first having a Microsoft Access Database to store if there is a user online or not. Next, I wrote a JavaScript refresh so that after 30 seconds it will redirect the user to another page. This page will then take the database counter from the previous page, decrement it by a value (denoting there are no users online), signs the user out, and has a button to close the page. If a user tries to log in when another user is online a page shows up saying that the system is busy and to try again later.
After everything was good and done I decided that the usage log made by the Dorgem program was just not up to par. I decided that I should make my own. I made a xml document so that every time someone logs into the system it stores there user name and a timestamp of their login into the log.xml database.
Part 2: Demonstration
Here is my solution and experiments that show how it works.
http://compsci.snc.edu/cs460/paprks
Part 3: Learning and Development Process
Strategies: My best learning techniques. Where and how I found my answers.
My best learning techniques was to keep on testing and trying new things. Using Visual Studio.NET brought on a huge challenge to me, and to figure it out I went through numerous tutorials online to try anything from just talking to a client computer saying hi (which we did already did in c) to doing a simple Hello World web service. These tutorials helped me learn the ins and outs of Visual Studio.NET and helped me figure out how to bring my program up and running.
Knowledge: These CS concepts pBroved most helpful for this project
Client/Server - This seemed to be the CS concept that applied the most to my project. This concept comes from numerous courses throughout the CS curriculum, especially my networking class.
Event Programming - Even though I was only in this class for the first half of the semester it really helped me out in working with Web Forms and all the controls related to it.
Programming Languages - This class provided me with the necessary steps to create my project by using my knowledge in Perl and JavaScript in GBay to adapt and use these concepts in the Visual Studio.NET environment
Extensions: The senior who will take over my project next year should consider these enhancements and extensions as further research
I personally feel that there is not too much more that needs to be done with my project. Rather, I feel that the best thing to do with my project is to bring it together with other senior's projects. If we could take Kevin's multi-cam surveillance system and have it so that when it hears a sound or sees something move, the motors will move to center the object that the surveillance is catching.
Advice: My advice for next year's seniors
My biggest advise is to start early and end early. You can't put too much time into it in the beginning (even though I kind of did). Have a goal set so that you are done by spring break. If you can make that goal, than it is only little changes and little extensions that are needed to be done for the remaining part of the semester when the sun comes out and you don't want to be stuck inside.
Also, go in and ask for help when you need it. They is almost always someone there that can help you get through your problems.
Part 4: Questions and Answers