From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Merge overlay vi seems slow

Hello everyone.

 

I am currently developping an application using a color IP camera on which I overlay some text. After putting the text on the image, I'd like to save it in a AVI file. To do so I need to merge the image and the overlay together, otherwise only the image (without the overlay text) is put in the AVI.

 

The specifications of the application requires the acquisition to run at 30fps, with a fairly big image (1600x1200). For now I only have a 1200x600 picture coming from the camera and I am already running into one particular issue: the time required to merge the overlay and the image is too long. Some solutions would be to discuss with the client whether to run at a lower framerate and/or with a smaller resolution, but I'd like to discuss with you guys about the merge function first. There is also the amount of text I add that is to be taken into account. Just a few line is fine, but when I add more, then at some point it slows the "merge" step down. Let's first concider the case in which I need to add "a lot" (like 40 lines of text for example).

 

I'm sending to you a simple VI that aquires pictures from a camera (mine was a Manta G125C, for which I am also sending the config file), and then adds some text as an overlay, merges the overlay and the image, and writes the AVI. It is not the global application. It is just a smaller vi that focuses on image acquisition and merge.

 

Here is a few comments about the diagram.

I use producer/customer architecture. The producer acquires the images and adds the overlay, and the customer merges image and overlay. I know the overlay step should ideally be in the customer loop, but since the merge vi is slowing things down, I decided to put it elsewhere.

I also tried to tell Labview to focus on the merge by putting only the merge in the customer loop. Then the result is sent to another loop that will save it in the AVI file. My idea was to avoid loosing time by putting the Write AVI vi in the merge loop. So there are in fact two producer/customer loops: camera => merge, and merge => save AVI.

 

When you run the vi, you can see that the acquisition loop takes about 33ms to complete, but the merge loop takes about 40ms to complete. It even gets worse in the global application, where the merge loop take 45 to 50ms, although only 45 per cent of my CPU is used (and I got enough memory to cover the image buffers and everything).

 

I am running out of ideas to try. It seems that the problem is the merge function in itself. Well... I might have missed something elsewhere in the global application, but what I mean is that if I can save some time on the merge, that would be great.

I know reducing framerate, resolution, or text length would be solutions. But I'd rather not concider these if I can find another way.

 

Does anyone encountered this problem before and found a solution ?

Do you guys have any suggestions of things I could try?

 

Thank you very much.

Have a great day.

Luc

0 Kudos
Message 1 of 2
(2,640 Views)

Hello,

 

I have the same case and struggling with exactly the same problem. I will share if I find a solution. I have tried approximately the same solutions, no success so far.

 

Regards

 

Adrien

0 Kudos
Message 2 of 2
(2,444 Views)