From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ Overlay Oval not appearing

Solved!
Go to solution

Hi all,

 

I have a LabVIEW app that I wrote a year ago, and the client wants modified.

 

In the original app I capture images from a camera and display them to the user.

Due to processing time, I save the images to a binary file, then when data capture is complete, I read them back and do the pattern matching, ROI calculation, edge detection, etc.

During this second phase, once I have the edges defined I use 'IMAQ Overlay Oval VI' to paint little green ovals on the grey scale images to show the edges.

All that works well.

 

Due to the saving, and post processing, the user can't see how effective the pattern match/edge detection is working until after the data collection is complete.

I added a preliminary routine, before the fast data capture, to capture the grayscale image, do the pattern matching, edge detection, and overlay.

This runs slower than the data collection routine above, but that's okay in the preliminary mode.

I copied the code that I use in the second section above (find pattern, define ROI, find edges, draw overlay), to use in the preliminary routine.

It all seems to work, but the IMAQ Overlay Oval VI does not draw the ovals onto the grayscale image.

 

I am actually calling the same subVI to Clear the Overlay, and then to draw an number of ovals (passed in in an array), that I am using in the second 'data presentation' routine in the old code.

That old code, continues to work fine, drawing the little circles, etc.

 

Any ideas on what I should look at to see why the overlays are not being displayed?

 

Thanks,

Jeff

 

0 Kudos
Message 1 of 10
(6,506 Views)

Hi all,

 

Additional info...

 

While this preliminary routine is running, getting images, finding patterns, calculating ROI, finding edges, calling the IMAQ Overlay Oval VI, no ovals show up.

However, while this loop is running, if I click the LabVIEW stop icon (stop sign in the application toolbar) the overlay ovals show up on the last image, as the application stops.

 

I added a variable msec delay after the 'write overlay ovals' call, but no matter where I set that value (from 100 mSec to 500 mSec) the ovals were not displayed.

When I forced LabVIEW to quit, the ovals were displayed.

 

FYI,

Jeff

 

0 Kudos
Message 2 of 10
(6,502 Views)

Have you tried calling the Refresh Image method on your image display control?

Example_VI_BD.png

0 Kudos
Message 3 of 10
(6,498 Views)

Hi Greg,

 

Thank you for the suggestion.

I have now added that invoke node (method) to my loop, with no change.

 

All along I do see the image change with every read, as the target of the camera changes, so I know the indicator is being updated (refreshed).

I just don't see the overlay ovals.

 

I also created temporary debugging indicators to display the edge count, and the array of edges (that is the number of overlays and the location of each overlay); and those show reasonable data.

I did a trace, and the reasonable list of overlay locations is being passed into the 'IMAQ Overlay Oval VI' one at a time, but the image is not showing the overlays.

 

Thanks,

Jeff

 

0 Kudos
Message 4 of 10
(6,495 Views)

Maybe turn on snapshot on your image display.  Are you reusing the same image over and over again?  If you acquire a new image immediately after drawing the ovals, they will disappear when the new image is acquired.  Another option would be to use multiple images for acquisition and analysis.  Snapshot usually solves the problem, though.

 

Can you post an image of your code where it overlays the ovals and displays the image?  That would help.  If you could simplify it down to the bare essentials, that might also help you figure out the problem.  Make a copy of your code, and take out everything but acquisition, overlay ovals, display, etc.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 5 of 10
(6,491 Views)

Hi Bruce,

 

Thank you for the suggestion.

 

As for the 'new' image overwriting the newly overlayed 'old' image, I thought of that.

I added a delay immediately following the subVI that writes the overlay (with a control to enter the delay mSec).

Even bumping the delay up to 1 second, I didn't see the overlays.

 

Also, if I understand the documentation correctly, the Overlays stay on the image until you explicitly call the delete overlay function, even if the image below changes.

Even if that isn't true, with the delay, the overlays were not visible.

 

As for the image indicator (display), it is the same indicator I use later (during the post processing) and it shows the overlays just fine then, so it must be capable.

 

I tried turning on 'snapshot', no change.

 

While waiting for other feedback, I did strip this VI down.

It still has the same issue, and the solution did not jump out at me.

I have attached the zip file.

 

Thank you for your input,

Jeff

 

 

0 Kudos
Message 6 of 10
(6,488 Views)

Hi all,

 

I forgot to mention...

 

LabVIEW 2013, Vision 2013.

PCIe-1433 Frame Grabber.

With I/O Extension board.

Windows 7 Professional.

 

FYI,

Jeff

0 Kudos
Message 7 of 10
(6,486 Views)
Solution
Accepted by DMJeff

Simple mistakes:

 

First, wire the image through the acquisition step, not around.  You want to make sure it finishes acquiring before you start processing.

 

Second, move the connection to Image Out to after the drawing of the ovals.  Currently, you never update the display after drawing the ovals.  The program can't read your mind.  The current sequence is acquire image, display image, draw ovals.  For best results, you will want snapshot on.

 

Overlays are erased when you acquire a new image.  They do stay when you process the image.

 

Bruce

Bruce Ammons
Ammons Engineering
Message 8 of 10
(6,478 Views)

Hi Bruce,

 

Thank you for the suggestions, it seems to be working now.

 

What does the 'snapshot' setting do?

I looked through the LabVIEW help docs, but didn't find it mentioned.

 

Thanks,

Jeff

 

0 Kudos
Message 9 of 10
(6,461 Views)

Snapshot makes a copy of the image when it displays it.  That way, if you change the image later on (more processing or acquire new image) you still have the same image displayed.  If you don't use snapshot, sometimes you will get an updated display of the image when you don't want it.  Mousing over the image or zooming can cause an unwanted update.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 10 of 10
(6,457 Views)