USB Camera
2. Usb enabled camera (webcam, handycam or otherwise)
Preferably the camera should be in a fixed stationary position above and directly in line with the business end of your dispenser. However it doesn’t really need to be that way, you can also have the camera in a detached configuration which will make it more difficult to find (and hit it) by the other team. It does make calibration more difficult but your sentry will be up for longer. It’s explained in the “actual fun” part.
If you do go for a fixed position camera make sure it can’t move and is properly aligned. If not deviations in targeting will occur without calibration. Additionally you should make sure the camera doesn’t move when the sentry is actively operating otherwise it will go insane.
Cameras that are infra red or heat based are very suitable as they are not so sensitive to changing amounts of light and can operate in utter darkness. Or for instance if someone would shine a flashlight/laser into the camera it wouldn’t be blinded.
There are lots of tutorials on the internet on how to make a webcam into a infra red camera. The essence is that you remove the infra red filter from behind the lens, a glass/plastic part that is has a green or red shine and doesn’t seem to do anything. Now it lets in infra red and ultra violet light. Then you take away the visible light. Do this by either placing two layers of overexposed (black) 35mm camera film over/behind the lens for infra red capability or you could use the blackest parts of x-ray negatives for ultra violet capability (this is how insects see the world). Besides that if you choose either one of these the laser will not show on the camera, which is nice so it can’t get blinded easily without being noticed. I.e. to blind it you will need a big fat normal flashlight because these have tungsten filaments inside that do show up in infrared. Additionally if you want to make it even better you could construct a box that doesn’t leak light and place the pcb of a webcam on one end and 35mm from the base of the pcb make a hole and insert a 35mm slr lens or other lens type thing. This could greatly improve your picture quality, if the box is not crooked, still no autofocus though.
If you don’t want to do this then you are probably best of taking a sony PS3 eye camera. The internet has drivers for operating these under windows environments. The advantage of these cameras is that they are USB2 and have exceptionally high frame rates. Making it easier to implement target/object tracking as at higher frame rates the target would sooner overlap in sequential frames. Additionally the higher frame rates also make it possible for the software to make more calculations per second, logically making the dispenser more accurate and be able to react faster. Do keep in mind that higher frame rates also make it more sensitive so you will most likely have to adjust the threshold filter. A logiteck pro 9000 webcam will also work just fine.
What you actually want is a camera with a big-ass wide angle so you can see a very large area. The problem here is that the shape of the picture is distorted when put in a square frame. Most likely making the sentry hit stuff that is not the target. Unless you muck around in the code or the servo movement ration of course. So you need to program in some distortion formula, you will find it here, and send us a copy of the code. What is also possible is to go to the pawn shop and get an old 35 mm wide-angle lens and take it apart. It has heaps of little lenses in it, you need to find the wide angle lens out of them and attach it to your webcam, if aligned properly it should work. Otherwise you can always use one of those lenses that are in those peepholes in the door. The whole idea is pretty basic, see underneath. How to: take lens from webcam, attach tube, shove in wide-angle lens, pull rubber sleeve (inner tube bike), screw back in webcam, done But what is probably a better idea is to just add more webcams and combine them to make one large picture.
If you want to go all out you will need a firewire camera as these can dump the images directly into the RAM of your computer. USB has to sent pictures through the CPU so is slower. This also means that any way you cut it a webcam is not realtime, a firewire camera is. But those are also very expensive, luckely there are ways around buying a expensive firewire camera, you can use your old camcorder as a firewire camera, using a program called dvdriver by trackercam. LINK. Or webcamDV by orangeware LINK.
The camera is a stationary one and should not be allowed to move as it would screw up the motion detection and the sentry would go nuts. It should be mounted directly in line with the centerline of the action part of the sentry. So that means it should be directly above or above and behind the action part of the sentry. Alternatively you could place it in front and below the action part of the sentry. Placing it higher is better because you have a better field of view. You can choose to attach it to the basic construction of the sentry (the housing) but if you choose to do this make sure its sturdy enough not to shake the camera when the servos move. The advantage of this is that you will not have to adjust the camera every time you decide to turn your sentry on. So when you build it make sure you can still move it for primary calibration, see last pages. If you choose not to attach the camera to the sentry housing you have a more versatile machine, especially if you are making one for airsoft war of paintball. The general conception is that the camera is attached to the sentry housing. So if you don’t do this and your opponents are shooting the sentry, it won’t help them one bit. The problem is that this setup will need calibration every time you move it. What is also important is that you make sure the proper camera drivers and the program that came with it is installed. This because most camera options like flipping horizontal and whitebalance etc are situated in there. For instance if you flip the image horizontally and the movement is on the left side of the camera viewer the machine will actually aim to the same vertical position but on the right side in the real world, it’s a nice cat toy.