From: willem on
Hi
 
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 ?
 
Is there some other way to speed it up.
 
Willem
 
PS (Using LabView 7.1 and Vision 7.1)
From: Ben on
Hi TiTou,
This looks a lot like an example posted by Christian in the "Picture Control" thread.
<a href="http://forums.ni.com/ni/board/message?board.id=BreakPoint&amp;message.id=14&amp;jump=true" target="_blank">http://forums.ni.com/ni/board/message?board.id=BreakPoint&amp;message.id=14&amp;jump=true</a>
Does this look familiar?
<img src="http://forums.ni.com/attachments/ni/BreakPoint/748/1/RotateVase.PNG">
&nbsp;
Ben
From: willem on
TiTou/Ben
&nbsp;
Never mind the stars, you seem to rather have missed the point of this question. I have a very large image (2047 X16,000), which I want to rotate by 90 deg. When I try to make the image larger in your vi, it just grinds to a halt well before it reaches the size I want to rotate.
&nbsp;
Any other ideas?
&nbsp;
Thanks
&nbsp;
Willem
&nbsp;
&nbsp;
&nbsp;
&nbsp;
From: Ben on
Hi willem,
&nbsp;
If you use that example "out of the box" for an image that large, it looks like you will need as much as a Gig or more to handle an image that is 16K X 16K.
&nbsp;
Even if you have that much memory to play with LV may have trouble allocating contiguous buffers that large.
&nbsp;
You will probably have to "divide and conquer" to win this battle.
&nbsp;
I suspect if you grab 2047 X 2047 sections sections, and then rotate each setion (using the method Christian illustrated) you should be able to put the image back together again.
&nbsp;
Does that help?
&nbsp;
Ben
&nbsp;
BTW: The reference to stars is part of a running joke that the "Gold bars" (non-NI) contributors work for stars (not penuts).
From: altenbach on
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.