InterpolatePoints Method

NI Vision for Visual Basic

InterpolatePoints Method

Syntax

CWIMAQVision.InterpolatePoints SourceImage, Coordinates, InterpolationMethod, SubPixelAccuracy, InterpolatedArray

Return Type

Long

On success, this method returns 0. On failure, this method returns a negative number.

Purpose

Resamples an array of pixels from an image using multiple interpolation functions. Use this method to perform subpixel analysis of pixel profiles in the image.

Remarks

Use this method with U8, I16, and RGB32 images.

You can use the RegionsProfile method to obtain the coordinate points that you need to specify to this method.

Parameters

SourceImage As CWIMAQImage

The image containing the values to interpolate.

Coordinates As CWIMAQPoints

The coordinates of points over which the method performs the interpolation.

InterpolationMethod As CWIMAQInterpolateMethods

The method used to perform the interpolation for subpixel measurements. Three values are valid:

  • cwimaqInterpolateBiLinear--bilinear interpolation

  • cwimaqInterpolateQuadratic--quadratic interpolation

  • cwimaqInterpolateCubic--cubic spline interpolation

SubPixelAccuracy As CWIMAQSubPixelAccuracyValues

The number of samples to obtain from a pixel. For example, a subpixel accuracy of one-fourth specifies that the method splits each pixel into four subpixels.

InterpolatedArray As Variant

On return, the resampled pixel data.

Example

Dim interpolatedArray
Dim profileReport As New CWIMAQProfileReport

' First get the points along the path using RegionsProfile
CWIMAQVision1.RegionsProfile CWIMAQViewer1.Image, _
                             CWIMAQViewer1.Regions, _
                             profileReport

' Resample the pixels in image in Viewer1 using
' a quadratic interpolation with one-fourth subpixel accuracy.
CWIMAQVision1.InterpolatePoints CWIMAQViewer1.Image, _
                                profileReport(1).Coordinates, _
                                cwimaqInterpolateCubic, _
                                cwimaqSubPixelOneFourth, _
                                interpolatedArray

See Also

RegionsProfile