Showing posts with label interpolation. Show all posts
Showing posts with label interpolation. Show all posts

Thursday, September 22, 2011

Do you believe in sub-pixels?


Measurement is a complicated subject, and nowhere does it seem more complex than in the world of machine vision. Allow me, if I may, to outline the problem.

Imagine you wish to measure a box. You grab a steel rule, only to find that the smallest unit on the scale is an inch. Thus you can say the box measures between 10 and 11 inches along its side, but you cannot give a more accurate number.

Flip the rule over and you find it is graduated in centimeters (I know the centimeter is not an ISO unit, but I’m old-school.) This allows you to say the box measures between 26 and 27 cm. That’s better than before (because centimeters are smaller than inches,) but it’s still not very precise.

Let us first recognize that this might be good enough. If the purpose of the measurement is to cut a piece of wrapping paper that will cover the box, an uncertainty of +/- 0.5 cm is probably enough. No need to measure to three decimal places.

But what if you need a more precise measure? Well by eye you can subdivide the gap between 26 and 27 cm. It’s easy to estimate the midpoint, and you can probably get pretty close on the quarters. What you’re doing is interpolating between 26 and 27, and that’s what sub-pixel interpolation does. It looks at the gray values of a series of pixels and mathematically estimates where an edge would be.

I’m not a fan of this approach because I’ve never seen a vision system produce two identical images. There’s always some variation in pixel values, even if only because of noise in the system, but other machine vision folks, some with far more expertise than me, will argue that sub-pixel interpolation is a valuable tool.

Readers who’ve been with me a long time might recall that I addressed this back in January 2010 under “A case study on sub-pixel interpolation”. At the time I admitted that I’m a skeptic but I did refer you to a paper by Den Dawson of Dalsa. The link I gave then still works, so if you’re curious, take a look.

Monday, January 4, 2010

A case study on sub-pixel interpolation

I’m a skeptic when it comes to making sub-pixel measurements. I like to use several pixels to find an edge and I’m not sure about trusting the math involved in making repeatable measurements to less than one pixel.

But with all that said, Ben Dawson of Dalsa has written an excellent exposé of a high precision gauging system based on sub-pixel measurements. There’s a lot of technical detail in “Measure Precisely with Machine Vision,” (Vision & Sensors Magazine, November 30th, 2009,) so read it carefully, especially the part where he talks about blurring being a good thing.

I’m not 100% convinced – I still say you should throw pixels at the job if you can – but kudos to Ben for providing a very informative article.

Tuesday, October 7, 2008

Hats off to DWFritz

In a recent posting I expressed some skepticism regarding a claim of “better than 2 microns repeatability.” Well the integrator, DWFritz, took the time to post a Comment giving a little more explanation. As I suspected, they are relying on subpixel interpolation tools from Cognex, and these helped them demonstrate the required repeatability to their customer.

This is an impressive result. First, the Cognex subpixel algorithm is clearly no slouch when it comes to locating an edge, but more importantly, it speaks to the expertise of the DWFritz team. Getting consistent subpixel results demands a very stable setup. Clearly, they’ve invested in quality components and integrated them in a highly robust manner. So it’s hats off to DWFritz: check out their
website next time you need to do high precision gauging.