The Deliverator – Wannabee

So open minded, my thoughts fell out…

The $4 Fisheye Lens

Posted by Deliverator on March 6th, 2008

Last week, I used my hacked $30 CVS video cameras in Portland to capture robot’s eye view footage during the FIRST competition. Some of the footage was good and some bad. You can judge for yourself on the new Titan Robotics Youtube Channel. Regardless, I’ve had a lot of fun and the cameras have held up much better than I expected. The robots take quite a beating during the competition, so I’ve never wanted to risk anything more expensive. Still, I would like to get the best possible footage out of the cameras as possible. One issue that is quite evident in the footage is a high degree of shaking, especially from the foward facing of the two cameras. The front camera was mounted (with zip ties no less) to the robot’s flag holder: a glorified piece of thin pvc pipe. For the upcoming Seattle FRC regional, I hope to find a better mounting location/method and reduce the vibration. Another issue that has nagged at me is the narrow field of view. You just don’t see enough of the field to have a good sense of where you are and what is happening during the match. You also don’t often get to see those dramatic moments where a competitors robot is screaming across field and whacks into you. All you see (if anything) is the robot entering into the frame at the last moment and whacking into you, causing a lot of vibration induced distortion. I decided to try and find a way to get a wider view of the field without compromising my no tears if it breaks rule.

One thought I had was to mount multiple cameras on the front of the robot oriented at different angles with overlapping fields of view. I could then take the footage from each of the cameras and digitally combine it to produce a small screen version of the Cinerama effect. I took a stab at this and actually got it to work, but the results weren’t as good as I had hoped and the process of syncing all the footage was somewhat time consuming. I decided to take a different approach and look for a way to get a wider angle out of a single camera. A few minutes searching turned up an article by Hank Dietz from the University of Kentucky that outlined his experiments with inexpensive door peephole viewers for use with inexpensive digital still cameras. His experiments mostly centered around a peephole viewer made by Deltana. I was able to find the exact same viewer (though it was unbranded) at Home Depot for less than $4.

I wasn’t too impressed with the Deltana for this unintended use. The quality of the glass used was very poor and easily acquired scratches. The threading on the two shaft pieces was quite loose and the threading only continues for a short way, making it difficult to adjust the lens in and out to any great extent. The highly polished brass colored metal making up the shaft that the lens elements are mounted within results in lots of internal reflections. All the lens elements are pretty firmly fixed in place, making it difficult to adjust where the image is cast. I was able to influence this somewhat by taking cutting off the end of the tube just short of the first lens element using a dremel with a metal cutting disk attached. The dremel made short work of the tube, but produces a lot of fine metal dust which is difficult to clean off, so I recommend placing some putty or other material inside the tube to keep metal dust from finding its way inside. Dietz in his article used hot glue to afix his lenses to cameras, but robots get hit hard, so I epoxied my modified peephole to the front of one of my CVS cameras and let it dry overnight. The tube size of the Deltana is just right for epoxying to the front of the CVS camera. The Deltana peephole definitely works, but even with the dremel shortened tube, it casts a fairly small image on the imaging sensor. If I were using a higher end digital camera, this wouldn’t be a problem, as even your $100 digicam these days offers 5+ megapixel stills. Unfortunately, the CVS cameras are limited to a max of 640*480. Once cropped down to only the image area, this doesn’t leave a lot of pixels to play with. I decided to go back to the store and see if I could find a better solution.

I ended up finding another peephole for $10. This one had a wider shaft than the Deltana and features much higher quality glass. The rear lens element is held in place against a lip inside the cylinder using a circular clip, which I was easily able to remove. I was also able to remove the front elements. I was able to take some length off the tube using the dremel tool. An enterprising individual with a metal lathe might bore down the inside of the cylinder a bit to produce to allow the rear lens element to be set closer to the front lens elements, producing a still larger image on the image sensor. Because I was able to access the inside of the cylinder with this model, I took some Krylon Ultra Flat Black spray paint and painted the inside of the tube to eliminate reflections. I also decided to ditch the front cap and rear mounting hardware to reduce the size of the total assembly. A couple layers of electrical tape hold everything together quite nicely. This new and improved model produces a much clearer, larger image. Unfortunately, the viewing angle on this one was only 160 vs 200 degrees (claimed, although both look significantly less) on the Deltana. I am going to hold off on epoxying this one to one of my 3 unmodified CVS cameras and see if I can find a wider angle version of the same lens before the next competition.

Here is a picture taken using the $10 modified peephole lens held up to my N95.

Door Viewer Fisheye Lens