01-31-2017 04:13 AM
Hello,
I am currently working on an application, which is able to automatically find Gold Particles in electron microscopy- images.
To archieve that, I have built an image recognition Algorithm using NI Vision Assistant 2015 SP1 and integrated it into a UI based on LabView 2015.0f2 (x32).
The Algorithm works great for small testimages (ca 10400x6200px). But when it comes to working with the actual images (ca 18900 x 15500 px), the Algorithm quits with an Error.
The Error Occurs in IMAQ Border Size and has the ID -1074396159.
I'm using the german Version of LV, so I'll translate the Error description freely:
"IMAQ Vision: (Hex 0xBFF60401) There is not enough memory available for this task."
I checked it in the Taskmanager and when the error occurs, there are still like 40% of my RAM (8GB in total) free. So I assume the problem here is, that because the RAM is fragmented, there's not enough available RAM in one connected block to store the image array.
Any suggestions on what I can do? Splitting the Image in multiple parts works, but it's not a satisfying solution, as it definitely reduces the usability of my program. Also, slicing the image makes it hard for the Algorithm to find the Gold Particles close to the borders of these sliced images.
Is there a way to assign more Memory to LABView, for example as a Swap file?
I don't have a PC with more than 8GB RAM, but if I had one, do you think it would work then, or is there some kind of upper Limit to the Image size?
Also, as stated above I'm using the x32 Version of LABView, as I'm not sure whether the targeted system will be able to execute x64 applications or not.
I attached a Version of my Image recognition Algorithm to this post.
This is my first post here, so if anything is missing, please let me know it.
With best regards
Seine_Dudeheit
Solved! Go to Solution.
01-31-2017 08:47 AM
Hello,
A simple math will show how much would you need to work with this image.
18900 * 15500 = 292950000 pixels
In LabVIEW , the RGB type is considered to use 32 bits per pixel. Therefore, for your image you will have 18900 * 15500 * 4 (bytes) = 1171800000 bytes = 1.17 GB.
You may suffer to work with those images in a 8 GB RAM computer.
I don't know how your detect points vi is working, but I noticed you have a few double 2d arrays coming out of this VI. Just be aware that for every array a copy of the data is done.
I have never worked with images this big.
01-31-2017 09:13 AM
Those are, indeed, gigantic images, and memory space is likely to be a problem. Here are some suggestions:
Bob Schor
01-31-2017 02:37 PM
Even though these are fairly large images, they're well within the size that 32-bit LV can handle on an 8GB machine, especially as they look to be 8-bit images. However you do need to be careful how you use memory, and probably need to rewrite the code exported from Vision Assistant which tends not to think about using memory efficiently.
The VI you attached doesn't have the image processing subVIs that it uses, so it's not possible to see what you're doing inside those that would require a lot of memory. But the very first action inside the VI you posted is to make a copy of your image. Is that necessary?
02-02-2017 02:59 AM
Hello,
thank you very much for your quick replies!
The problem really was the fact, that I was running my Vi in a 32 Bits environment. After hours of struggling to download and install all the required LabVIEW x64 files, the Vi works perfectly now, even with the biggest image I have available.
I should have really come up with that by myself, shame on me
Also, I am going to consider the other answers and try to optimize my Algorithm. Indeed, the algorithm produces way too much output, filling up my free space that way.
And GregS is right, too. Copying the image at the beginning of the Vi isn't necessary at all and actually it's a pretty dumb thing to do in that case
So thanks again for your help and have a nice day!