Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

why do 100 patterns occupy 400MB of my RAM?

I am making heavy use of IMAQ pattern matching, getting the software to automatically generate patterns.
The pattern files are typically around 10K, but when I load less than a hundred my machine (Win NT4, 256MB RAM,Labview 5.1) grinds to a halt. On a second machine with "only" 128 MB RAM, it tells me it can't complete the operation! Is it a reverse zip effect or what?
Is there a limit to the number of patterns I can load in memory?
0 Kudos
Message 1 of 6
(3,857 Views)
You should have no problem loading that many patterns into LabVIEW. The limitation depends on how much RAM is in your computer, not the software. I would recommend using the Task Manager to see if you have a memory leak somewhere in your program. If you do, look for places where you continually assign memory and never dispose of it. If you can narrow down the part of your program with the problem, attach it and I'll look at it.

Jack Arnold
Application Engineer
National Instruments
0 Kudos
Message 2 of 6
(3,857 Views)
here is the evidence... (we tried it on three different computers all running WIN NT4, SP5 or 6)
Download All
0 Kudos
Message 3 of 6
(3,857 Views)
Each template that is loaded into memory will expand from it's file size. This is due to the pattern mathcing template algorithm info saved with each image. This means that each of your templates will occupy between 2.5 to 3 MB of memory in windows. If you must have each of these loaded all at the same time, you need to have enough memory to handle this. Also, closing all other programs on your PC will free up other resources as well. The best option is to load only the images you need, when you need them and use the IMAQ Dispose.vi to free the memory whenever you are done with the template. The template sizes have became much smaller in the latest version of Vision, which is Vision 6.1.

Jack Arnold
Application Engineer
National Instruments
0 Kudos
Message 4 of 6
(3,857 Views)
OK, this explains a lot of things.I think loading images from disk might make the inspection very slow. I must inspect 48 positions for at least 10 different objects (test tube caps or empty places).
Is Vision 6.1 available? How much do templates occupy with the new version?
0 Kudos
Message 5 of 6
(3,857 Views)
In Vision 6.1, the pattern matching templates take up about 1 MB of space, so you should be able to load 3x as many templates than with Vision 6. Yes, Vision 6.1 is currently available.

Jack Arnold
Application Engineer
National Instruments
0 Kudos
Message 6 of 6
(3,857 Views)