Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

subpixel matching in IMAQ

I am working with the pattern matching in the machine vision package.  When I enable subpixel matching, I get

x-y locations to 2 decimal places (and not just 1/4 or 1/2 pixel offsets).  I'm trying to understand what the subpixel

resolution is in the matching.  In other words, can the matching algorithm measure displacements to 1/100 of a pixel?

TIA

Eric Schell

0 Kudos
Message 1 of 7
(4,754 Views)

This is a yes and no answer.

 

When you use sub-pixel analysis in pattern matching, the original pattern is compared to the located pattern.  I suspect they used convolution or some similar comparison.  If the edges change slightly between the patterns, you can measure sub-pixel changes.  These changes are calculated using interpolation to find the best position.  Interpolation is a type of estimate, so the number isn't going to be perfect, but it is better than rounding to the nearest pixel.

 

As an example, let's assume you are looking at the image of a bright white vertical bar.  The bar is aligned so the edge pixels transition exactly from black to white with no gray pixels.  Now let's shift the bar 1/4 pixel to the right.  The edge pixels will be different shades of gray.  Using these differences, it is possible to estimate the shift of the bar using interpolation.  Pattern matching does the same thing.

 

So here is the answer:  Yes, the sub-pixel algorithm estimates position changes down to 1/100 of a pixel, but these values may not be accurate down to that level.  I would estimate accuracy to about 1/10 of a pixel in ideal cases, and 1/2 to 1/4 in most cases.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 7
(4,739 Views)

Thanks Bruce!

 

The one thing that I'll add is that the Vision Concepts Manual (found in <Program Files>\National Instruments\Vision\Documentation\Concepts_Manual.pdf) discusses subpixel accuracy on page 11-9.  An estimate of the accuracy can be found on page 11-11:

 

With the imaging system components and software tools currently available, you can reliably estimate 1/25 subpixel accuracy.

Message Edited by CXB on 09-17-2008 10:48 AM
Chris Bolin
LabVIEW Partner Program, CLA
0 Kudos
Message 3 of 7
(4,723 Views)

I would still say 1/25 subpixel accuracy is an optimistic estimate.  Perhaps using really good lighting, really good lens, really good camera, etc. and having very crisp, distinct edges in your image you could achieve that sort of accuracy.

 

In any case, it is way better than the nearest pixel accuracy!!

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 7
(4,716 Views)

Thanks.  Next question: do I have to use the edge detection functions to get this kind of accuracy, or does this

description (in the manual) apply to the pattern matching functions as well.  I am using IMAQ Match Pattern 2

block in LV 8.5.1.

0 Kudos
Message 5 of 7
(4,698 Views)

Pattern matching will do it automatically.  Just put a true constant on the sub-pixel input.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 6 of 7
(4,687 Views)

Thanks!

 

Eric

0 Kudos
Message 7 of 7
(4,675 Views)