Wednesday, October 3, 2012

Robot Life, Vol 2

Robots ahoy! Some new image processing tests and opencv tests! Since the last post, I did some more manual testing and moved to opencv to experiment with more image filters for vision processing.

After performing basic image processing with Sobel and Bilateral filters, we have a good image to process with a Hough Transform. This allows us to extract lines from an image which we can then reconstruct into geometrical shapes. Here we have a sample picture (ref) showing what the algorithm produces, and an application of it to a low-res Random Internet Photo.

sample hough transform

hough transform test

The Hough Transform is really quite cool. It maps lines in cartesian space to lines expressed as polar coordinates by writing out sinusoids in Hough Space. Where many of these sinusoids overlap you have a strong candidate polar coordinate for a line in your image. Super rad. Here are some of the better papers I found describing it: 123456.

However, the results of the Hough Transform require careful coefficient tuning and so is not as robust as we would hope. Some OpenCV testing lets us chain much more variety and find a better set of image transforms to extract the desired polygonized shapes.

After experimenting with a lot of combinations I settled on a Bilateral + Canny filter to get shape outlines and then performed polygonization on this image. Having a larger number of iterations on the Bilateral filter was more beneficial than an additional Sobel filter or Box/Gaussian blur. The polygonization step with a low/high angle threshold is also shown here.

opencv tests

Looks like a good start to the sort of data we want. Here it is running real-time, on a low-res image feed. The colors indicate unique polygons, but it is randomized each frame so it changes color erratically!

Testing with OpenCV gave a much faster turnaround time, though manual implementation is fun and educational. There were a lot of combinations of filters and settings that gave poor results before reaching this. It is vital to have real-time parameter tuning so you can find the right set of filters+tunings for your needs.

Things are busy so I'm currently on a tangent doing some smaller audio processing experiments for some fun applications with Nao. Till next time!


  1. I enjoy, result in I found exactly what I used to be looking for. You’ve ended my 4 day long hunt! God Bless you man.
    Have a nice day. Bye

    Regards from Young Entrepreneur
    Pakar SEO @ Mengapa SEO Penting @ Master Pakar SEO @ Pakar SEO Indonesia

  2. Thanks a lot for sharing us about this update. Hope you will not get tired on making posts as informative as this.
    filter papers

  3. Great post. I came here while searching for Generate Press reviews & impressed with the features you explained here. It looks promising and going to buy this. syringe filters

  4. It is very nice article this is important in my work. Keep it up in that same way Thanks a lot.
    bed bugs control Delhi
    best pest control in Noida

  5. Very interesting, good job and thanks for sharing such a good blog. Your article is so convincing that I never stop myself to say something about it.
    express visa Canada
    canada federal skilled worker program

  6. Your work is very good and I appreciate you and hopping for some more informative posts.
    RNA extraction kit
    centrifuge tubes