LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Resize a picture

Highlighted
hi
I am using web cam acquiring image using lab view. i want to reduce the size of the picture before saving it .currently the size of the iamge is 300*200. i want to save it in smaller size becaz iwill be displaying this image on mobile and that require small pictures.any idea how to do it in labview.
0 Kudos
Message 1 of 17
(19,153 Views)

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 to take over the world!
Message 2 of 17
(19,152 Views)

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.

 

http://labview.epfl.ch/QT/QTVis.html

0 Kudos
Message 3 of 17
(19,134 Views)
Here's an addition - a VI which loads a directory of JPGs, resizes them and displays them in a 2D array.

___________________
Try to take over the world!
Message 4 of 17
(19,126 Views)

VERY nice vi. 10 stars ..at least

Thanks tst...

0 Kudos
Message 5 of 17
(18,313 Views)
Thank you very much for these most useful vi's
They resize the jpeg's quickly, and present them in a handy 2D array.
Thanks again for sharing your work.
John
0 Kudos
Message 6 of 17
(18,215 Views)

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. 

 

Steven

Message 7 of 17
(17,356 Views)

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.


___________________
Try to take over the world!
0 Kudos
Message 8 of 17
(17,332 Views)

First, i know its an old thread 🙂

 

2nd: how can you take RalcoBe resize function and also adjust the image MASK. I want to resize a png and keep the transparency.

- A minute saved is a Minute earned!
0 Kudos
Message 9 of 17
(13,205 Views)

Hi profit,

 

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...

Best regards,
GerdW
CLAD expired, using LV2011SP1 + LV2017 (+LV2019 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 10 of 17
(13,203 Views)