LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

rotate image



@willem wrote:
I have a narrow but very long image (2047 x 16,000) which I wish to rotate by 90 deg so I make better use of the display screen. Using 'IMAQ rotate' this takes on average 2.5 sec. I then tried 'image_to_array, transpose_array, array_to_image, but this took even longer 3.2 sec. As this is only a transpose operation and and no re-calculation of pixels is required why does it take this long ?

This is certainly a big image. Is this paletted or 24 bit? You should make very sure that you don't create too many additional copies in memory.
Transposing a 2D array requires rearranging virtually all of the data in memory. This is expensive for huge arrays.
Message 11 of 17
(3,102 Views)


@TiTou wrote:
Yep Ben, this is certainly correct... I used it as a source of inspiration a couple of month ago and couldn't remember the thread it was coming from ; so many thanks to Christian.

I hope nobody minds if I use it... 'cause I like it ! Smiley Tongue

Btw: My wife made that vase a couple of years ago. Since it is now becoming famous, maybe we can get top dollar for it at ebay! 😉 😄
 
Most of my more recent example that I post here contain a link to the corresponding discussion thread as a front panel text. This seems like a good idea in general. It makes it much easier for me to keep track of things. 🙂
0 Kudos
Message 12 of 17
(3,141 Views)

Does this image exist on disk, or is it only available inside labview memory?? If it is on disk, maybe a command line utility to rotate it before opening in labview would be better.

http://www.imagemagick.org/script/command-line-processing.php

0 Kudos
Message 13 of 17
(3,078 Views)

Hi

 

I wrote this little VI for you I think that it is the quickest way you will be able to rotate an image in LabVIEW although you will need Vision module to run it. I have also attached a nice big image. Just out of interest, what is your image of and how are you acquiring it. Another thing what is the depth of you’re your image? Haw much ram have you got? I suggest you don’t bother trying this with any less than 1G of RAM.

 

Hope this helps

 

Tim

 

NI UK AE

Download All
0 Kudos
Message 14 of 17
(3,043 Views)

This is slightly more memory efficient

 
Tim
 
NI UK AE
0 Kudos
Message 15 of 17
(3,031 Views)

Tim

The image is obtained using a line scan camera (grey scale). As you say my main problem is lack of memory. I will try it again when I have some more

Thanks

 

Willem

0 Kudos
Message 16 of 17
(3,010 Views)

Hi TiTou,

 

 When I try to rotate the picture attached, I found the corners are still black. Is there anyway I can mask or change the background color of the square picture ?

Is there a way to make a round picture so I do not have to worry about this ?

 

Thanks !

0 Kudos
Message 17 of 17
(2,281 Views)