Webcam Simulator
Use this page to control the simulated webcam. If the camera moves unexpectedly, someone else may also be controlling it. You may need to hit one of the arrows to see an image or refresh on your browser after the move.
| |
|
Code
If you want to build your own web cam simulator and use Perl CGI scripts, here is all the code for you to get started. These scripts are very basic and only just provide the functionality that you need to get started. I hope that you will find some of the image manipulation processes useful for this and other applications.
- The image splitting script.
- The CGI script.
- The configuration file.
Instructions
The steps required to set this up are listed below:
- Place the image splitting script into a new directory and make it executable (chmod +x camify.pl).
- Copy a high resolution image (3-5Mpixels) into the same directory.
- Create the split images using "./camify.pl src.jpg 320 240 cam" where src.jpg is the source image, 320x240 is the target webcam image size and cam is the file name prefix. This will yeild many overlapping images named cam_01_03.jpg where the numbers are the X, Y coordinates respectively.
- Move the images into a subdirectory of your CGI script directory and set their group and permissions correctly so that the web server can access them.
- Copy both the CGI script and the configuration file into your CGI script directory and set the group and permissions.
- Edit the configuration file (note that only the first line is read) and adjust the space delimited settings to:
- The relative path to the image directory containing the cam_01_03.jpg files.
- The filename prefix of the images (i.e. cam).
- The number of horizontal images.
- The number of vertical images.
- Copy this page source HTML into a webcam page and adjust it as you see fit. The core of the page is really the buttons and the following code
<img src="/cgi/camify.cgi?action=getimage"> <a href="/cgi/camify.cgi?move=fullup">Move Up</a>
- Test it.
Click here to check out the list of other projects.
You may also like to click here to check out the list of Artificial Intelligence projects.
If you would like to get any further information on this or any of the other projects shown on this web site, please send an email to Acacia Lateral Technologies. or place a comment in our Guest Book
You might also like to submit your idea to our Free Ideas page for the benefit of other like-minded soles.







