Hello, reading the files one by one fast is imposible, because my pictures are mostly saved in special binary file. I thought it would be possible to load these picture into the main memory once and than just use them. Thats why I tried to use global varriable, but it makes another copy of itself every time I want to use it and there is not enough memory in main memory to make another copy and it slows down very much by swapping. So the only way you are suggesting is to siply read one by one.
Hello Tomas. A customised "functional global variable" should be a good solution. My idea is: (1) Keep the array of images in the shift register of the functional global variable (e.g. as a 3D-NumericArray or as an Array of Cluster of Image). (2) Allow for reading and writing of one element of the array by the functional global variable. (= Do not pass the contents of the shift register to the input or output terminals of this VI. The array of images should only "live" in the shift register.)
This solution should be memory friendly and come with a good access time to each image. Hope this helps, Guenter
Hello Guenter, I don't understand very well what to do. Your idea seems very good but I have no idea how to do it. I don't know how to keep the array of images in the shift register. Do you mean to load all the pictures once and then keep them somehow in the 3d array in the shift register and read out only image that I actually need? If this is the case, I did try it (if I understand it) First I load pictures into the Global variable, then pass this global variable into the different VI (the whole 3D arry od pictures) and input of this VI is number of picture and output is one picture. But when I use this VI more often, for different tasks it seams to load the whole 3D array into the memory again and it slows down a lot.
Hi Tomas, this VI could look like the example I attached. It uses uninitialized shift registers, which is a very common way to store data at high performance. Please search the LV Help for uninitialized shift registers for a better understanding. This VI is a raw sketch, better would be to store it in an Array of clusters with arrays containing, this reduces memory size and don't have to be slowlier (there is an ongoing thread between Ben & Shoneil about this topic). Greets, Dave
Hello, I have tried uninitialized shift register and there is a problem with memory, I have 1GB main memory and after 80MB of loaded pictures LabVIEW crashes with memory problem, is there any way how to make this VI to use disk swap? Or some other way to load more data (maximum would be 200MB)