Subpixel Accuracy in NI-VisionPrimary Software: Vision Development ModulePrimary Software Version: 1.0 Primary Software Fixed Version: N/A Secondary Software: N/A
Problem: I noticed that many processing VIs in the Vision Development Module can output data with subpixel accuracy. What does this mean and what can I expect from subpixel accuracy? Solution: Many of the image processing VIs use Edge Detection as a basis for performing more complicated calculations, so this document will focus on subpixel accuracy in the context of Edge Detection. With almost any image processing algorithm, numerical methods are applied to image, which can be thought of as large arrays of numerical data. More often than not, the results of these computations comes out to be non-integer. This is the simplest way to think about subpixel accuracy. However, some VIs have inputs which allow the user to specify a Subpixel Accuracy. ![]() Let's take a look at the IMAQ Edge Tool VI. The input parameter of interest is the Subpixel Information. This is a cluster that contains an input called Interpolation Type and Subpixel Accuracy. NI Vision uses interpolation to decide where to locate an edge. The user has two options here for Interpolation Type: Quadratic and Cubic Spline. The first thing to do when searching for an edge is to find the edge strength profile. This is basically the derivative of the pixel values with respect to their location. Quadratic interpolation takes three neighboring values of edge strength and finds a best fit parabola based on their strength values. The location and value of the local maximum or minimum of the parabola is the location and value of the interpolated point on the edge. As a consequence, the result is seldom an integer. Cubic Spline interpolation works in a similar manner, except interpolation is done on four neighboring pixels. The other input in the Subpixel Information cluster is Subpixel Accuracy. The inputs for this are values such as One-Half, One-Third, One-Fourth, etc. Basically, this means that for the purpose of the interpolation algorithm, each pixel will be split into smaller units over which to apply the interpolation algorithm. For example, if you select One-Fourth, you are specifying that each pixel be counted as four pixels (in each direction, vertical and horizontal) for purposes of calculation. So, if you have an image that is 5 pixels by 5 pixels, and you specify One-Fourth for subpixel accuracy, you are simply creating a discretization grid of 16 by 16 over which to interpolate. Please refer to the image below. The red squares are actual pixels, and the black dots are the discretized subpixels. If you were to select None for subpixel accuracy, you are simply saying that you only want to use the pixels themselves as the discretization grid. Thus, with a subpixel accuracy of None, you should still expect non-integer values, because interpolation being applied is still either quadratic or cubic, it is just being applied over a smaller set of points. Really, the subpixel accuracy that NI-Vision is able to deliver is an asset. The values reported are more accurate than integer values of pixels. If you need to report edge detection results as an integer, you can round to the nearest integer. If you would like more information about this, please refer to the NI Vision Concepts Manual. Related Links: Product Manuals: NI Vision Concepts Manual Developer Zone Tutorial: 10 Things to Consider When Choosing Vision Software Developer Zone Tutorial: Using Edge Detection in Machine Vision Gauging Applications Attachments:
Report Date: 05/15/2009 Last Updated: 05/15/2009 Document ID: 4XEHAKGL |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

