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: 

Please help - I can not create large arrays of images (no more than 108 elements)

Hello,

 

I am working in an application where i acquire 300 high resolution images (3Mp) and then i process each of those frames.

 

When i try to put alll those frames in one array of images, the system does not let me more than 108 elements. There is no such message like out of memory or memory error. It is just that when i visualize the array of images, there are good frames the first 108 elements, and then white frames the rest of the elements.

 

Ideallically i would prefer to process frames as i am acquiring them, but i am concerned about the remaining processing time for the rest of the tasks.

 

Then, as an alternative, I have tried to store frames in two shorter arrays, and i ended up observing that when the first array (say 50 elements) is full and the second array starts (another 50 elements for example), labview needs a certain time in the the middle (like three seconds between closing first array and starting acquiring on the second array). If i dont wait that time between arrays, both arrays contain the same information. I know, this is weird, and i know about the fact of passing information by reference on imaq images. 

 

The most interesting thing is that when i reduce considerably the resolution of the image (say that now, instead 3Mp they are 2Mp), the maximum number of elements on the arrays are exactly the same: 108, so this makes me wonder if it is a memory constrain. And the code is fairly simple, there is no way that i am cutting the acquisition at the number 108.

 

So my question is, How can i put 300 frames in one just one array? or How can eliminate the time i have to wait between arrays?

 

I have heard about memory allocation and so, but i am not sure how to proceed. I have windows 7.

 

Thanks in advance,

 

Roberto

0 Kudos
Message 1 of 4
(2,535 Views)

It's hard to visualize.  Please post the code - or at least a shell representing your code - so we can see what is happening.  Are you sure you are getting 108 contiguous pictures, or are some aquisitions being skipped?  Is the first picture in the array the first aqcuisition?  Is the last picture the last acquisition?

 

I really don't think it is about memory allocation.  I think it could be about your method of acquiring and processing said acquisitions.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 4
(2,520 Views)

Yes depending on how the data is being accessed you could be having multiple unneeded copies of the images which would compound the issue.  Seeing code would help with this.  Even without seeing the code I'd suggest some kind of paging to disk anyway.

0 Kudos
Message 3 of 4
(2,503 Views)

Thanks a lot for your help guys.

 

You both are right. It was a silly mistake. I was initializing the array at the beginning, and then changing the the size of the buffer from the front pannel while the application was being executing... A mess. The solution was to simply initialize an array with more elements that needed,  to let me play with it without strange behaviours.

 

I appreciate your quick response!

 

Roberto

0 Kudos
Message 4 of 4
(2,497 Views)