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: 

LabVIEW 2014 Overlay on a Continuous Feed

Hi all,

 

I am brand new to LabVIEW and I am having some issues. The issue I am currently having is this:

We have an intensity graph that is generated by a camera feed. Currently, I have an overlay of two circles - one that doesn't move that represents the border of our detector, and one that moves with a cursor. For each circle, we have a button that turns it on and off. Currently, the issue is that these circles are inside a "timeout" event handler, and linked to the intensity graph. This creates an issue that the circles flicker, which I want to stop.

 

Is there an efficient way that I can basically stop these circles from flickering? I had an idea of basically creating a transparent dummy plot of the same dimensions as the intensity graph, placing this on top of the graph, and having the overlay displayed on this, but this feels very inelegant. Is there a better way I can do this?

Thanks in advance for any help/ ideas.

0 Kudos
Message 1 of 8
(2,347 Views)

Without seeing actual code it's hard to know for sure what might be the cause.  Can you post your VI (preferred), or screenshots (better than nothing) or both (best!)?  

 

Without seeing it, the best I can do is speculate.  Could you:

  • Move the overlays into a loop dedicated just to them?
  • Change the event that handles them to one triggered by a new frame from the camera feed?
  • Change the event that handles them from a "timeout" to a user event, that you trigger on a regular basis?

 

Message 2 of 8
(2,339 Views)

Thanks for getting back to me so quickly, here is a screenshot of the part that I'm trying to fix right now:

 

VI.pngVI2.png
The first event case is our timeout, where we are trying to draw a fixed circle, centred around a static cursor, to represent the detector, and also a smaller blue circle that changes position with the a second cursor.

The second event case works well, but I thought I'd post it for completeness. The issue with the VI is that it was created a long time ago by lots of different people adding different functions that they thought might be useful, resulting in something of a convoluted mess that is tricky to navigate, so this may be a case where the screenshots are more useful.

In essence, it seems like the issue is that every time our camera feed updates, our circles also update - causing them to blink. I will try your suggestions and see how that works out 🙂

0 Kudos
Message 3 of 8
(2,295 Views)

So we've been working at this and I think we've figured out what is responsible for the issue. When the graph updates, it redraws the image data on top of our overlay. So we have solved the flickering issue, but our overlay cannot be seen as it is beneath the image. In this case, does anybody know how to control the z-height of the plots so as to ensure that the image data is always redrawn underneath the circles?

0 Kudos
Message 4 of 8
(2,285 Views)

You could look into using "Defer panel updates".

 

Basically, redo your code so it's like this:

 

1. Event trigger for new frame

2. Set "defer panel updates" to True

3. Do processing of image data (2nd half of screenshot)

4. Add your circles (1st half of screenshot)

5. Set "defer panel updates" to False

 

Remember to use error wires or sequence structures or something like that to ensure the "defer updates" node runs at the very beginning and very end of everything.  Right now your code has 2 or 3 things happening at once;  you can't just add the node floating in space in the event structures as-is.

 

EDIT: Wrote the above before your reply came in.  Whoops.

0 Kudos
Message 5 of 8
(2,282 Views)

Is this an example code you found on LV Examples? or own created VI?

If it's an example, can you refer to it?

0 Kudos
Message 6 of 8
(2,255 Views)

Hi TBasel,

This is our VI. I've unfortunately not been able to find an example of what we are trying to do. I'm reasonably sure that it's just a matter of ensuring each plot maintains it's own "Z-order", but we haven't been able to come up with a solution that fixes it yet.

0 Kudos
Message 7 of 8
(2,250 Views)
0 Kudos
Message 8 of 8
(2,243 Views)