LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CPU-Memory consumption NI-IMAQ overlay bitmap

Hello to everyone.


I have two problems. Expert advice and assistance is required in this regard.
I have a camera application. I am manipulating a variable image on the image using "IMAQ Overley Bitmap".
I want to ask 2 questions on this subject.
1-I connect a sequence of images to the bitmap and if the application waits without the camera selected, it starts eating Memory space. How can I stop this? This application may consume a lot of CPU and Memory. Does anyone know a way to stop this?

 

2- I want to add a button to stop and rerun the while loop. How can I do that. CPU and memory without too much load.

 

Application example is below.

Thanks for the information and help.

 

0 Kudos
Message 1 of 5
(1,093 Views)

The images are pointers.

 

The images are not by value, so each iteration of the loop reuses the pointer.

 

The overlay is added to the previous overlay. If you don't clear the overlay, it keeps growing.

 

I'd add a clear overlay here and there...

0 Kudos
Message 2 of 5
(1,074 Views)

@constructionworker wrote:

2- I want to add a button to stop and rerun the while loop. How can I do that. CPU and memory without too much load.


Put a loop around everything you got...

 

Or rather, start using sub VIs.

0 Kudos
Message 3 of 5
(1,073 Views)

Let's make a fix like this.CPU and memory usage; If I try to capture images from the camera without overlaying the image, the CPU uses 8 and 180mb memory. The application I overlayed uses 19% CPU and 180mb memory when the camera is turned on.

If you select the camera comport and the camera is turned on, it uses a certain amount of memory without eating the memory and works fine, but if the program runs without selecting the comport after running the application, the memory usage increases and I get the error message "Not enough memory to complete this operation".

 

I do not fully understand the relation of this issue to the Coating, but still thank you for your advice.

  Do you have a more detailed solution for this?

 

 

0 Kudos
Message 4 of 5
(1,059 Views)

I can't run (or even property load) your code. So it's mostly somewhat educated guessing.

 

If the camera grabs an image, you might get a cleared image every frame. So the image overlay is be cleared every iteration.

 

If there's no camera, the input image Grab and Reconfigure is reused, and the overlay is continuously added to the previous overlay, without ever being cleared.

 

Another explanation could be that if the camera is running, you get a different framerate, and different data. So what you add and how fast you add it will change.

0 Kudos
Message 5 of 5
(1,032 Views)