LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Vision Overlay Flickering

Hello,

 

i'm developing an application where a rectangle is tracked in a 1080p camera image. The rectangle is overlayed on the image in the image aquisation loop for each frame. Depending on how much i do else in the same loop, the overlay begin to flicker. If i do nothing else it is updated smoothly with the live image. When to much is going on in the loop it flickers.

 

How can i ensure the overlay 'stays' on the image and is only redrawn if necessary?

0 Kudos
Message 1 of 9
(4,522 Views)

Hi Marvin,

 

it's hard to know what is going wrong if you don't post your code. I suppose you overwrite the picture with another picture, which removes the rectangle at some point. Highlight on execution and breakpoints will help you find out exactly where this is happening. It can have to do with the setting of your image display as well, but again it's hard to say anything concrete without seeing code.



Remember Cunningham's Law
0 Kudos
Message 2 of 9
(4,506 Views)

Hi,

 

the attached VI doesn't exactly match my code but it shows the general issue. 

When running the overlay is flickering while the image isn't.

 

0 Kudos
Message 3 of 9
(4,489 Views)

If I set the wait to 20ms or less, I see the flicker also, but if I set it to 25ms, it no longer flickers.

0 Kudos
Message 4 of 9
(4,457 Views)

Perhaps it has something to do with monitor refresh rate or sync?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 9
(4,419 Views)

I doubt that the main reason is in the monitor refresh rate, the graphics card or anything computer related. I could reproduce the behavior on several other machines.

While testing I was able to stop it from flickering:

I copied the live image into another image (IMAQ copy) and overlayed my information on that new image. Why does this work? And is this the only possible solution so far?

0 Kudos
Message 6 of 9
(4,385 Views)

I think I see it now:

 

If you increase the Wait until next ms multiple time to, say, 100 then the flickering stops. This is because of the "weird" behaviour of the picture indicator, which behaves more like a reference than like a normal indicator. So, when you set the time to 10 ms, which is, I suppose close to the maximum executing speed (btw, you should get rid of that file access in the loop...), you sometimes see the update occur between the two VIs and sometimes at the end of one loop iteration.

 

TLDR: right click on picture >> snapshot, solved the problem for me. This makes it behave more like a "normal" indicator.



Remember Cunningham's Law
0 Kudos
Message 7 of 9
(4,299 Views)

Hi!

 

If you try with the silver version you will see no flickering (has the snapshot flag set to true by default)

 

 

Marco

Message 8 of 9
(4,256 Views)

Good find Marco! It works for me too

0 Kudos
Message 9 of 9
(4,251 Views)