Attached is a VI which resizes a 2D array (7.0) . It was designed to resize pictures and for pictures of your size it should be fast enough. I don't think webcams use 24 bit color, so you may have to make some modifications. Also, it doesn't do any "clever" stuff like averaging color values. It just takes some of the elements from the original, which seems to be good enough.
From what I saw, this VI gets slow when handling large arrays (I saw about a second for a 2800x1500). Does anyone have any optimizations ideas? I know that when windows creates thumbnails it also takes time, so I'm not too optimistic.
Message Edited by tst on 07-27-2005 12:14 PM
Try this link for the quicktime library. It has an imagetransformation vi in it. You can scale the X and Y independent of each other. You need quicktime installed.
For the ones who came here by search, here is an example that resizes very fast and easy.
Some applications don't need more than this.
The VI also converts it to excel, after col & row resize the picture appears.
Maybe by choozing better characters results become even better.
That's nice - faster and considerably simpler than my version.
A few points for improvement:
1. The resizing is the same both ways. You could just change it to a be ratio of the current size.
2. You can easily set a different ratio for X and Y.
3. You probably want to convert the value to an integer as early as possible to avoid having repeated coercions inside the loop.
replace the JPGFileLoad by PNGFileLoad. Then rescale the picture data the same way - but do the same for the mask data delivered by PNGFileLoad. Then recombine both scaled arrays into a new image data cluster...