LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Insert 2D arrays into 3D array

My camera is capturing images (2D array of numbers ranging 0 - 255), now how i can Insert some (say 20) 2D arrays into 3D array in different pages ?

I mean 1st 2d array (image)  ----> page 0 of 3D array,

2nd 2D array ----> page 1 of 3D,

3rd 2D array ----> page 2 of 3D and so on......

0 Kudos
Message 1 of 9
(6,330 Views)

Build Array

 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

Message 2 of 9
(6,327 Views)

You also should learn the basics of "autoindexing"...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 9
(6,320 Views)

You can keep your code inside a For Loop (While Loop will also do) and use 'Auto-index Enabled' and thats it....

At the output of Loop, LabVIEW will create a 3D data exactly as your requirement.

 

Code.png


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 4 of 9
(6,319 Views)

Thank you, but i cant keep my camera VI in for loop to generate 3D array.

Output array is 2D array.

0 Kudos
Message 5 of 9
(6,278 Views)

@megastar wrote:

Thank you, but i cant keep my camera VI in for loop to generate 3D array.

Output array is 2D array.


To get multiple images, you must run your 'Image acquisition' code multiple times and definitely in a loop. In your existing code also you're using a loop (I'm talking about the 'While Loop', inside the 'Case Structure' which is immediately nested within a 'Giant Flat Sequence Structure').

Now if you dont like the idea to keep a while loop, you may also use a 'Functional Global Variable' (so 'Action Engine', whatever you like to call it).


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


Message 6 of 9
(6,264 Views)

Do you know from the beginning how may images there will be? Are all images the same size?

 

It will be most memory efficient to allocate the full size 3D array once and keep it in a shift register or DVR, for example. Then simply replace slices with new image data using replace array subset with the index based on the sequence number of the image.

0 Kudos
Message 7 of 9
(6,247 Views)

@altenbach wrote:

Do you know from the beginning how may images there will be? Are all images the same size?

 

It will be most memory efficient to allocate the full size 3D array once and keep it in a shift register or DVR, for example. Then simply replace slices with new image data using replace array subset with the index based on the sequence number of the image.


BTW what is DVR...

sounds like 'Digital Video Recorder'......!! but dosen't go well with the discussion...!!


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 8 of 9
(6,244 Views)

data value reference (see e.g. here)

Message 9 of 9
(6,237 Views)