Archive for the ‘Computer Vision’ Category

Photo Stitching

Tuesday, May 27th, 2008

As the owner of a brand spanking new Canon SD1000, I unpackaged the included software and found a nifty tool called PhotoStitch.  The camera itself only provides a special function which assists you in providing overlap between successive images of a panorama. The magic of the stitchery is in the desktop software.

PhotoStitch does a descent job, given its design parameters: it is intended to do the stitching largely unaided.  Hugin, an open source tool for creating panoramas, requires that you specify the alignment control points.  Although seemingly daunting, the task is actually extremely easy.  

As one majoring in computer vision, I should understand the algorithms a little better – to be able to compare the two on an algorithmic level.  What is clear, subjectively, is that Hugin is just more powerful. If it makes a mistake, i can go back and add a couple more control points and out pops a better alignment.  Here below is a sample of output from PhotoStitch (software from Canon) and Hugin (open source software).

PhotoStitch


Hugin


Vision Basics

Friday, September 28th, 2007

“How do you pick out an object from a scene?” If this has been a burning question for you, as it has for me, I have a few answers. The basic question I had is “what identifies the object”? Well, it seems so obvious. If its a log, then look for something “log-like” – longer than it is wide at least. And pick the biggest one in the image.

Everything is easy until you try to do it. So, sitting down writing a program to pick out a log is much harder than just saying “do it!” Do you look for a brown thing? What happens when lighting changes – even by a small amount? What if there are other brown things. And anywise, even if you find brown, what does that mean – one brown pixel is not enough. You must connect them.

Turns out, in some cases, it can be as simple as follows:

  1. Background subtraction – just take a picture before and after the object is in view. This is “fair” in many cases, as in when the camera is fixed and the object in view is not.
  2. Thresholding – whether you have an image or not, you can use an auto-thresholding algorithm to separate the background from the foreground. Now you can say what “is” and “is not” the object.
  3. Connected-component labeling – actually, you may have thresholded several potential objects. Labeling each one separately, we can now perform calcuations on things such as elongation, center of mass, etc.

This is all very basic, and as my teacher would warn “there is no one way to do computer vision.” These ideas are just a starting point. For an example of what I have described, here is my writeup of an assignment. Writeup