Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Need to allocate 32Gb of memory with NI-Vision module (VisionImage)

Dear Community,

 

My computer is a 64-bit Win7 and has 64Gb of memory. I am writing an application that load an empty RGB image of 32Gb into the memory.

I tried to use allocate that memory using VisionImage.SetSize(width,heigth) where  width*heigth*3 = 32Gb. But it failed!!! and tell me that I do not have enough memory.

 

I dont understand as my computer has 64Gb of memory. I need to stitch a large number of images that need to be stitched together and produce at the end a 32gb image that will further write into png files.

 

Any help or suggestions will be really appreciated.

 

R.

 

 

0 Kudos
Message 1 of 18
(5,628 Views)

R,

 

Firstly, are you using the 64-bit version of LabVIEW 2009? If you are running the 32-bit version then there is no way you can ever allocate more than 4GB. LabVIEW 2009 and Vision Development Module 2009 were the first versions to have 64-bit application support.

 

If you are using the 64-bit version, have you tried smaller images and seen where the cut-off is? Also, what size image in dimensions are you trying to allocate? I believe Vision currently has a limitation of 32-bit values for the width/height, which means that a single line image (height=1 pixel) cannot be larger than ~4 billion pixels wide.

 

Hope this helps,

Eric

0 Kudos
Message 2 of 18
(5,622 Views)

Eric,

 

I am usiung 64-bit version of Vision Development Module 2009. The size I am trying to allocate with the ones that will give you equivalent size of 32Gb image. Let's say for example:

 

VisionImage stitchImage = new VisionImage(ImageType.Rgb32, 0);

stitchImage.SetSize(1360 * 50 , 1024 * 25);

 

And it fails!! I need that memory space and have it on the computer physical memory.

 

Thanks,

 

Rafiou 

 

0 Kudos
Message 3 of 18
(5,619 Views)

Rafiou,

 

Ah, so you are using .NET I see. I believe the Vision Development Module currently only ships a 32-bit (x86) version of their .NET assemblies. I suspect that your application you are coding is compiled as x86 as well instead of MSIL or x64 so your application is running as a 32-bit process. You can confirm this by checking what CPU type your application is targeted as.

 

If you tried to compile your application as MSIL or x64 and run it as a 64-bit process it will likely fail to load as Vision's assembly would not be able to load in a 64-bit process. Unfortunately Vision Development Module's .NET and C APIs are limited to 32-bit only at the moment. Only the LabVIEW interface is currently available for 64-bit applications.

 

Eric

0 Kudos
Message 4 of 18
(5,613 Views)

I already start build the application with .NET. Is there any other ways to do that but staying .NET as I am not that familiar with LabView.

 

Thanks,

 

Rafiou

0 Kudos
Message 5 of 18
(5,608 Views)

Dear Eric,

 

I forget to mention that you were rigth about the fact NI-Vision module 2009 don't compile on a x64 and I knew that. But I am doing some images stitching that need that amount of memory. So again is there any other way to to that?

 

Thanks,

 

Rafiou

0 Kudos
Message 6 of 18
(5,608 Views)

Please help me finding a solution for this situation:

 

I have informed that NI-Vision Dvpt Module 2009 does not support 64-bit .NET application as it is said in the readme file. But since it is support in LabView 64-bit, is it possible to allocate a very large memory using the Vision with 64-bit LabView? What I will be trying to do with labview is the following instructions actually in C# .NET:

VisionImage Image = new VisionImage(ImageType.Rgb32, 0);

stitchImage.SetSize(1360 * 50 , 1024 * 25);  // ==> that is about 7 Gb of memory allocation !!!!!

 

Again, as it is actually impossible with Vision for .NET,  does the 64-bit LabView will allow me to do that with its Vision components?

 

I just want to make sure before purchasing the 64-LabView kit, as we badly need this if it possible.

 

Your help or suggestion will be really, really appreciated.

 

Thanks,

 

Rafiou  

 

 

0 Kudos
Message 7 of 18
(5,516 Views)

Hi Rafiou,

 

My apologies, but after checking into it a bit further, it appears that single images are (currently) limited to 2GB total size (not just in each dimension as I stated above), although you can have any number of these large images. This will likely be changed in a future release, but for now this limitation is imposed and you will get the following error if you try to size an image larger than this total size:

 

IMAQ Vision:  (Hex 0xBFF60768) The operation would have exceeded the capacity of an internal container, which is limited to 2147483648 unique elements. 

 

One alternative, depending on what your processing requirements are, is that you could use a LabVIEW 2D array. LabVIEW arrays on 64-bit LabVIEW are limited to ~2 billion elements per dimension, with no limit I am aware of on total size. You could allocate the array and stitch in pieces of it from individual vision images that have themselves been converted to 2D arrays. Now, this of course will not help if you want to use VDM functions on the resulting image (unfortunately).

 

Hope this helps, 

Eric

0 Kudos
Message 8 of 18
(5,511 Views)

rafiou wrote:

...

 

I just want to make sure before purchasing the 64-LabView kit, as we badly need this if it possible.

 

...

 


Just for your information: "...Every customer that purchases LabVIEW 2009 has a license for the 64-bit version..." (LabVIEW 64-Bit vs. 32-Bit Applications FAQ)

 

Andrey.

0 Kudos
Message 9 of 18
(5,499 Views)

Dear Eric,

 

That means the 64-bit LabView is not a complete 64-bit platform. It is a quite disappointing that we can not enjoy the full capacity of a real 64-bit application with Vision. Even though you have VDM in a LabView 64-bit, NI is still deploying 32bit vision components on it. That completely breaks all the 2^64 memory addressings we benefit from a 64-bit OS. I don't know when this correction will applied to next VDM release but I can't wait too long.

 

But the idea using the LabView arrays can be solution to my problem only if we can really allocate such big size and if labView has array to png image function so I can create image files by dividing the resulting big array for example.

 

Thanks,

 

Rafiou

0 Kudos
Message 10 of 18
(5,489 Views)