The CMUcam Vision Sensor   
[ Overview | Gallery | Downloads | Q & A | Publications | People ]


Is there a way to precisely focus the CMOS lens?

    Of course, the best way to proceed with focusing is to take dump frames using the GUI. You may not have a computer handy, or you may be using a BotBall CMUcam, which doesn't have sufficient resolution at its hard-wired 9600 baud for this to work well.

    In that case, there are two alternatives. First, you can try counting threads. The lens is not screwed fully in at peak focus. Rather, there is about a 1 millimeter gap of thread showing. In terms of number of threads, that is about 2 threads showing in the gap between the lens and the lens mount.

    The second alternative relies on the idea that when an image is sharp, the darks are darkest and the brights are brightest. In other words, the contrast is greatest. When the image becomes defocussed, then the extrema fade away to a more uniform distribution of intensities. So, if you fire up streaming mode using Teraterm or Hyperterm, and then call GM (Get Mean), you can focus in real time. Look at the Red deviation. As you focus sharply on a high-contrast object (such as a piece of paper with lots of writing on it) at the desired distance, there will be a noticeable peak in Red deviation when most sharply focused. Note that this approach to focussing requires you to have the camera and the target quite firmly planted as you turn the lens.


  The Robotics Institute at Carnegie Mellon University was established in 1979
to conduct basic and applied research in robotic technologies.  It is part of the School of Computer Science.