07-20-2013 05:41 AM
Hello!
I've been looking around the forum 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-20-2013 09:29 AM
@O.P. wrote:
Hello!
I've been looking around the forum 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.
You might also want to post your query at Machine Vision board.
07-20-2013 02:34 PM
Having posted some of those VIs who do suck, I can say that there is some interest, but it doesn't seem to be that popular. The resizing I had was good enough for my purposes at the time and I suppose that others just use other options.
07-22-2013 11:08 AM
I have continued posting in this thread: http://forums.ni.com/t5/Machine-Vision/Resizing-images/td-p/2497838
07-22-2013 01:56 PM - edited 07-22-2013 01:57 PM
I had the same issue. The vision stuff is not free, but if you're on windows you can use GDIPlus which is pretty good. See the attached.
OP, do you mind posting your solution in G? I'd be pretty interested in seeing how you did it. I tried doing it in G but it was unbearably slow. GDIPlus resizes extremely quickly, and I ended up using this VI to dynamically resize an image as the user resized the window.
07-22-2013 03:26 PM
Have a look in the other thread I linked to.
07-29-2013 02:36 PM
@pobrepablo1 wrote:
GDIPlus resizes extremely quickly, and I ended up using this VI to dynamically resize an image as the user resized the window.
Oh I have a much nicer solution (still using Windows stuff). I posted this on LAVA not long ago but can't link to it at the moment. Attached is a VI and an image in a zip. It will load the image into a picturebox then set it to fit to the control. Then the control is set to fit to the pane. Now when the pane gets resized the image does too. It works quite smoothly and I have even scaled it up to have a grid of pictures and it all seems to work well.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
07-30-2013 04:44 AM
@Hooovahh wrote:
Oh I have a much nicer solution (still using Windows stuff). I posted this on LAVA not long ago but can't link to it at the moment. Attached is a VI and an image in a zip. It will load the image into a picturebox then set it to fit to the control. Then the control is set to fit to the pane. Now when the pane gets resized the image does too. It works quite smoothly and I have even scaled it up to have a grid of pictures and it all seems to work well.
Neat! Now the only question is, how to keep the aspect ratio?
07-30-2013 07:57 AM
@LarsM wrote:
Neat! Now the only question is, how to keep the aspect ratio?
Change the SizeMode from StretchImage to Zoom and the aspect ratio will be kept. To change the background color, color the pane that the PictureBox is in.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
07-30-2013 11:19 AM
@Hooovahh wrote:
Change the SizeMode from StretchImage to Zoom and the aspect ratio will be kept. To change the background color, color the pane that the PictureBox is in.
Of course. I must have done something wrong the first time I tried it.
It's weird that the image disappears when the vi stops. Is there some way to make the image persistent?