09-30-2005 02:37 PM
10-04-2005 06:19 AM
10-04-2005 08:46 AM
You could do a sub-pixel shift with a phase shifting FIR filter, but I can't see why you would want to. It wouldn't improve the quality of the image, and you wouldn't really gain anything.
Bruce
10-04-2005 08:57 AM
I image the same field of view onto each of the four quadrants of a CCD simultaneously and wish to match them up, i.e. perform image registration, with subpixel accuracy before, for example, subtracting one image quadrant from another.
The process of interpolating to give new pixel values is clearly possible within Labview since it is used for IMAQ Rotate and IMAQ Resample, but unfortunately not in IMAQ Shift.
10-04-2005 09:35 AM
Okay, I have attached a vi that will generate a filter for a +/- 1 fractional pixel shift. You will have to generate a separate filter for your x and y shifts. It will be faster if you apply them one at a time using IMAQ convolution.
You can combine this with IMAQ shift to do what you want.
11-16-2011 11:19 AM - edited 11-16-2011 11:22 AM
Hi Bruce and others -
I want to revisit this topic. In other discussion forum topics, subpixel pattern matching and the use of the centroid function for subpixel accuracy have been discussed. The lack of floating point input for IMAQ Shift function has also been discussed.
Since the centroid function outputs shifts with 2-decimal point accuracy, I also want to use the outputs of the centroid function applied to two images (one being a reference image) to shift one of the images so that it aligns with the reference image. Using whole pixel values as required by the IMAQ Shift function results in problems. I know I need the subpixel accuracy.
Is there a way to effectively accomplish this using Vision given that the IMAQ Shift function only has integer shift inputs?
For now, I am using NINT fx to get me as close as I can.
Sincerely,
Don
11-16-2011 11:26 AM
Don,
Same answer as before. Use the subpixel shift filter program I posted earlier - that will take care of the decimal portion of the shift. Then use IMAQ Shift to do the integer part. (or reverse the order - doesn't really matter).
Bruce
11-16-2011 11:29 AM
The block diagram was locked (at least when I tried to open in LabVIEW 2010).
Can you share the code?
Sincerely,
Don
11-16-2011 12:11 PM
Bruce - also, it is not clear to me what to do with the filter output which is a 1-d array.
IMAQ Convolute expects a 2-d array for the Kernel.
Can you clarify further?
Sincerely,
Don
11-16-2011 02:51 PM
Don,
It took a bit of engineering to come up with the contents of the filter generator, so I don't intend to share it at this time. For now, just use it and enjoy it.
The output of the filter vi is a 1D array. Make it a 2D array using Build Array. If it is the vertical shift, use Transpose Array. Use IMAQ Convolute to shift the image. Repeat for the other axis.
You could do it in one step by generating the X and Y shift arrays, then using cross product to generate a 2D array. It might take a little experimenting to get the right 2D array. The convolution might be a little slower, too.
Experiment with different values and compare the before and after. You should be able to figure out what direction it moves for a given sign.
Bruce