From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I stack one dimentional arrays

I have a function, IMAQGetRowCol, which extracts a row of pixels from an image and outputs it as a 1D array.  I have the function in a loop, so that it extracts a row from each image frame.  I want to stack row 50 from each frame on top of each other in a 2D array.  For example, if row 50 of frame 1 is {43 42 56 56 75}, and row 50 of frame 2 is {55 32 42 45 67}, then I want my final output to be
 
{43 42 56 56 75
 55 32 42 45 67}
 
This assumes I only have 2 frames.  3 frames would result in 3 rows in the final output, 4 in 4, etc.
 
How can I accomplish this?
 
Image of code and VI are attached.
0 Kudos
Message 1 of 5
(3,531 Views)
Have you looked at the Build Array function?

Message Edited by smercurio_fc on 06-01-2007 09:33 AM

0 Kudos
Message 2 of 5
(3,520 Views)
Hello,

if I understand correctly, You only have to connect the row output to the loop border and make sure that the auto-index option it's enabled.
Software developer
www.mcm-electronics.com





PORTUGAL
Download All
0 Kudos
Message 3 of 5
(3,513 Views)
I tried smercurio's method and, after the loop finished, I got the very last line of pixels in a 1D array only as my output.  I need a 2D array with one line from all frames included.
 
Jorge's method worked perfectly, however I wonder if I can accomplish the same thing inside the loop, without having to wait for it to end?

Also, I'm using LabVIEW 8.0, so please save as that version if you include an example VI.

Thanks.

Message Edited by curt_dvonch on 06-01-2007 11:46 AM

0 Kudos
Message 4 of 5
(3,501 Views)
Hello,

see that example in attach
Software developer
www.mcm-electronics.com





PORTUGAL
0 Kudos
Message 5 of 5
(3,488 Views)