LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Storing 2D images in RAM

Hi everyone. I am currently trying to write a program to activate a camera and take multple frames per second for an experiment. Currently, by writing these 8 bit  2D images directly to the hardrive, i can only achieve 6 or 7 frames per second which unfortunately will not be enough. I therefore am trying to save them in RAM and write them after the loop is finished. To do this im trying to build a 1D array of 2D arrays ( the images). I.e. A three dimensional array.  so far i have tried using the "insert in to array icon" and combining a 3D array with my 2D images. However i am having trouble building the 3D array to start with. I then send it to an Index array and finally the flatten pixmap image icon. Is this a correct method for storing these images in RAM and if so how can i get over this stumbling block. Any help would be most apprerciated

Will
0 Kudos
Message 1 of 6
(3,109 Views)
Hi Will,
how do you get your image? Do you use Vision? How long do you want to grab images? How big are this images? For example you can use a 1D array of cluster of 2D array.
 
Hope it helps.
Mike
0 Kudos
Message 2 of 6
(3,092 Views)
Thanks for replying Mike. Unfortunately i don´t have Vision so i am using a program supplied with the camera that gives an image as an 8 bit 2D array (0 -255). I would like to grab images for up to 1.5 secs and hopefully get at least 15 frames per second. (The camera can work at 39 Hz). When i save the images as BMP they are only about 800 KB so i should have enough RAM. If you could give an example of constructing a 1D array of cluster of 2D arrays, it would be most helpful.

Will
0 Kudos
Message 3 of 6
(3,082 Views)
Will,

One thing which may help speed up the process is to preallocate memory for the array and then use Replace Array Subset to insert the data into the array. Any process which tries to build arrays on the fly will inevitably slow down (or fail) due to memory allocation issues.

Use Initialize Array (expanded to 3-D) outside a loop. Make that array as large or larger than needed for that greatest number of images you want to save. Wire the initialized array to a shift register. Inside the loop index to the page you want and replace a 2-D subset of the array at that page. When you are finished with the image acquisition, save all the replaced parts of the array to disk.

Search for a white paper document on the Forums about handling large amounts of data in LV for details and other suggestions.

Lynn
0 Kudos
Message 4 of 6
(3,077 Views)
Hi Will,
you can use something like this.
 
Hope it helps.
Mike
0 Kudos
Message 5 of 6
(3,076 Views)
Cheers guys, seems to work pretty well, and by cropping the images of quite a few pixels have increased the images per second. Many thanks
Will
0 Kudos
Message 6 of 6
(3,050 Views)