LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ Merge Overlay, Not enough memory for requested operation.

I am using the 'IMAQ Merge Overlay' function and it is returning Error Code '-1074396159' when I try to merge an overlay on a large (130Mb) image. The function works fine with a smaller file (12Mb).

I have plenty of free system RAM (only using 400MB of 1GB available) so this should not be hapenning.

Is there any way to assign more RAM to IMAQ to stop this occuring?
0 Kudos
Message 1 of 9
(4,709 Views)
Hello Mark,

What type of IMAQ board are you using to perform this acquisition? Are you acquiring the 130MB image from the board or are you processing an existing image? If the image is coming from an IMAQ board, then the memory error may be referring to the onboard memory of the card.

What version of NI-IMAQ are you using? What version of IMAQ Vision do you have installed?

There is a free download available for the newest version of the NI-IMAQ drivers. If you are using an older version of these drivers or the VIs that are installed with them, that could cause this type of problem. The download page is located at:

NI-IMAQ Version 3.0 for Windows 2000/NT/XP
http://digital.ni.com/softlib.nsf/websearch/C8FAC1A56DD469CA86256EB6007284B5?opendocument&no
de=132060_US

Regards,
Scott R.
Applications Engineer
National Instruments
Scott Romine
Course Development Engineer
National Instruments
0 Kudos
Message 2 of 9
(4,707 Views)
Hi Scott,

I was just reading the image file from disk (no camera at the moment). Using IMAQ Vision 7.0.0 and NI-IMAQ 2.63.

My program was throwing up the error when it executed the 'IMAQ Merge Overlay' function. It worked fine on small (13MB) images, but did not work on a large (130MB) image. This is despite Task Manager reporting >500MB of free systrem RAM (my machine has 1GB RAM).

I have since solved my problem by saving the file + overlay to a .png file using 'IMAQ Write Image And Vision Info'. The problem is that I want to save it as a tiff. It would be nice to know why 'IMAQ merge overlay' said it ran out of memory.

Thanks,

Mark
0 Kudos
Message 3 of 9
(4,707 Views)
Hello Mark.

Just a thought I am having, if the original image is 130MB and it is an 8-bit mono image, then you could actually be experiencing a memory problem. The IMAQ Merge overlay function creates an RGB image, which could use up to 4 times as much memory per pixel (32bits) as the original. If this was the case, then the image would take 520MB in memory, which could definitely cause issues.

Just a thought.
Regards,
Colin C.
Applications Engineering
Colin Christofferson
Community Web Marketing
Blog
0 Kudos
Message 4 of 9
(4,707 Views)
Thanks Colin,

Yes, the origional image is 8 bit mono so the destination image would be 520MB. My machine does, however, have more than 520MB of free RAM. Is there a size limit?

Can you suggest a method to save the overlay with the image for large files? Unfortunately the 'IMAQ Write Image and Vision Info' did not work either (even to .png format). I am using an embedded pannel - do these functions only work with floating panels?

Mark
0 Kudos
Message 5 of 9
(4,707 Views)
Hello again, Mark.

While your machine may seem to have more than 520MB free of RAM, there are likely some limits put forth as to how much ram you can take up for an operation such as this. My suspicion is that Windows will not let you carve out nearly all of the available RAM for use with this type of operation (image memory is unique in that it is page-locked i.e. it cannot be transferred to virutal memory).

Long story short: Windows is telling Vision that it cannot use that much memory, therefore it will not go through. To fix this, you will have to either get more RAM (something I would suggest in general if you are using the image sizes we are speaking of), or you will need to shrink the image down before you apply th
e overlay.

Regards,
Colin C.
Applications Engineering
Colin Christofferson
Community Web Marketing
Blog
0 Kudos
Message 6 of 9
(4,707 Views)

I need to merge overlay and have a mono 8bits result. I am using this in Real Time. What I am doing is add some text to an image. The only 2 options is IMAQOverlayText+IMAQMergeOverlay or , IMAQ DrawText. But the IMAQ Draw Text cannot be downloaded to the RT engine (gives that particular error).

So how to keep the mono 8bits format after Merge Overlay? What was thinking the programmer to avoid giving the options of the file type in Merge Overlay???

Thanks!

0 Kudos
Message 7 of 9
(4,535 Views)

I'm having the same problems, not enough memory when doing overlay merge. Any solution so far?

Message 8 of 9
(3,600 Views)

Having the same problem here with VDM Runtime 2018 ! Never had this problem with Development, only with Runtime...

My images are RGB with 50Mb at most and my PC has 8Gb of RAM.

Memory consumption of the whole application during execution doesn't exceed 600Mb.

This error only appears with IMAQ Merge Overlay. Isn't there a mean of increasing usable memory for vision ?

0 Kudos
Message 9 of 9
(2,759 Views)