08-15-2013 04:17 AM
I find the Help on this function to be very little. It doesn't say much about typical usage, best practise or examples.
I'm looking for a function where I can pass in an image and a set of coordinates (sub-pixel coordinates) and it would return the interpolated pixel value. I thought this vi would perform this function, but I see it only takes in integer coordinates, so where does the 'sub-pixel' claims come from? If the coordinates are not in a straight line, how does it do the interpolation in 2D? Does the interpolation method specified refer to the path interpolated between the coordinates or the method for interpolating the grey level of the pixel?
Any help would be appreciated.
PS my comment about the Help not being very helpful applies to many other vi's too. We definately need more meat in the help (use Matlab's help as an example).
08-16-2013 04:26 PM
Hello,
The pixel interpolation function will compute the approximte value of the midpoint pixel of each pair of coordinates you pass to the function. The interpolation type specifies how this pixel value is calculated. There is a little more information on interpolation types used by this function in the LabWindows Vision Concepts manual :
IMAQ_BILINEAR | 1 | The function uses an interpolation method that interpolates new pixel values using a bidirectional average of the neighboring pixels. |
IMAQ_QUADRATIC | 2 | The function uses an interpolation method that interpolates new pixel values using a quadratic approximating polynomial. |
IMAQ_CUBIC_SPLINE | 3 | The function uses an interpolation method that interpolates new pixel values by fitting them to a cubic spline curve, where the curve is based on known pixel values from the image. |
|
The subpixel accuracy determines how many subpixels to divide the original pixel value into.
When you say the interpolated value between two pixels, do you mean between two adjacent pixels?
Andy C.
National Instruments
Applications Engineering
08-16-2013 05:11 PM
Say I have a 100x100 image of U8. I want to transform this image (stretch it or whatever) by resampling it. I might want to know the pixel greylevel at coordinates [3.45, 5.67] and [12.34 67.89] in the original image. So it is a 2D interpolation. I could use the interpolate 2D function I suppose (image to array, then interpolate 2D, then array to image again).
The imaq vi looked interesting but I couldn't figure out from the documentation what it does.
Another example of an undocumented vi that I use to do median filtering is IVA Grayfilters - Nth order.vi. It works, but who knows what these range of undocumented 'IVA' vi's actually do?
08-20-2013 07:59 AM
So you are trying to obtain the pixel values of the original image from the new, resampled image?
I'm having a little trouble finding the IVA example you're referring to. Can you tell me which package/version of our vision software you're using?
Cheers,
Andy C.
Applications Engineer
National Instruments
08-20-2013 11:09 AM
No I am trying to create a new image by resampling the original image with an arbitrary non-regular set of non-integer coordinates.
The IVA vi I was talking about is located in \National Instruments\LabVIEW 2012\vi.lib\vision\Vision Assistant Utils.llb\IVA GrayFilters - NthOrder.vi
08-21-2013 11:22 PM
I suspect you may have better luck interpolating the image as an array like you mentioned as the 1D Interpolate VI is not really set up to perform this.
The IVA GrayFilters VI you mentoined looks like it's a utility VI used by the Vision Assistant and isn't really meant to be used outside of that context.
Cheers,
Andy C.
Applications Engineer
National Instruments
09-02-2013 06:57 AM
OK thanks Andy.
I'm going to start another thread asking specifically about the IVA functions - when I create a LabVIEW vi from the image assistant I would like to know what all these functions do as I am adding it to my code.