07-20-2013 09:41 AM
Hello!
I've been looking around the forum for image resizing functions that don't suck, i.e. shrinking that uses proper anti-aliasing and expanding that uses bicubic interpolation. I couldn't find anything and have now written my own functions (vanilla LabVIEW only) that do this.
Now I wonder how interesting this is to the rest of you, and whether I've missed some smart solution somewhere.
07-21-2013 06:19 PM
As long as you have a decent filter generator, these wouldn't be too difficult. Reduction would require a smoothing filter followed by the IMAQ Extract. Expansion would require IMAQ Expand followed by a smoothing filter. The size of the filter would depend on the ratio of the before and after sizes. It might be more efficient to use a 1xN filter followed by a Nx1 filter.
If you have put these all together, it think it would be worthwhile posting them.
Bruce
07-22-2013 10:51 AM
Now I've downloaded the Vision evaluation. The IMAQ Resample function is quite interesting. But how does the image control work? It's just a control, not an xcontrol, so how can it be responsive like an xcontrol? Obviously, there's LabVIEW functionality that I've missed, and a pointer to info would be much appreciated.
I've included my own function for shrinking an image. It's much slower of course, mainly because of the matrix multiplications. But the result is better than the IMAQ resample function, and much better for zooms below 0.5 (I've never understood why one would use interpolation for shrinking an image).
07-22-2013 11:04 AM - edited 07-22-2013 11:09 AM
Here's the expand function. It's very slow, but I don't think you can beat the simplicity (included functions notwithstanding). It also seems to be doing a very slightly better work than the IMAQ resample function.