12-04-2015 01:30 AM
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?
12-04-2015 02:05 AM
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.
12-04-2015 02:52 AM
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.
12-04-2015 09:55 AM
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.
12-05-2015 01:49 PM
Perhaps it has something to do with monitor refresh rate or sync?
12-07-2015 12:07 AM
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?
12-14-2015 02:59 AM
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.
12-15-2015 11:09 AM - edited 12-15-2015 11:13 AM
Hi!
If you try with the silver version you will see no flickering (has the snapshot flag set to true by default)
Marco
12-15-2015 11:12 AM
Good find Marco! It works for me too