Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Test for Existence of Overlay in Image

When given an image with unknown overlay properties, is there a quick and dirty way to test to see if there exists an overlay on that image?
0 Kudos
Message 1 of 16
(4,699 Views)

Candice -

 

I believe you can call Is Vision Info Present 2 and pass in "Overlay" - the output should tell you whether there is an overlay or not.

 

Greg Stoll

Vision R&D

National Instruments

Greg Stoll
LabVIEW R&D
0 Kudos
Message 2 of 16
(4,688 Views)
Ok,thank you.
0 Kudos
Message 3 of 16
(4,681 Views)

To follow up on this, if I have established 3 different overlay groups (A, B, C), is there a way to read the Vision info and get which one(s) may be present?

 

I ask this because I might want to clear two of the three groups, rather than all of them.

 

Don

0 Kudos
Message 4 of 16
(4,108 Views)

To give you somewhat more background, I am having substantial difficulty clearing individual overlays using IMAQ Clear Overlay (again, say wanting to clear overlay A out of overlays A, B, C).  I will get the error 'overlay group not found' (-1074395148) even after just creating overlay A and using 'A' as the input [with build array inserted] for 'group' in IMAQ Clear Overlay .  I can't see anywhere where it is cleared prior to my action to clear it.   Anyone with any examples related to this that they can share, I would be much obliged.

 

0 Kudos
Message 5 of 16
(4,106 Views)

I have shown in the attached simple example a successful process for erasing individual overlays. 

 

 

I will thus have to figure out the problem in my original code.

 

Sincerely,

 

Don

0 Kudos
Message 6 of 16
(4,093 Views)

I still need a way to find out if an individual overlay (eg. determine if overlay A is present when there might be three overlays A, B, C) can be determined to be present so I can just erase that one.  NI - any thoughts on this?   For now, I will have to figure out a workaround in my original program if this cannot be done.

 

Don

0 Kudos
Message 7 of 16
(4,092 Views)

A workaround for you is just to place a Clear Errors after your IMAQ Clear Overlays. That is, after all, a pretty harmless error. Your example program works as expected with those Clear Errors in place. Here is a snippet of where I put them;

 

DonRoth.png

 

As for the larger question, it is not possible to code explicit checks for A, B, and C, but you could code implicit checks. For example, set a boolean value for each overlay to true when the overlays are created, then set them false when they are cleared. Use those booleans to control case structures for clearing the overlays or not. Hope that helps!

John B.
Embedded Networks R&D
National Instruments
Certified LabVIEW Developer
Message 8 of 16
(4,075 Views)

Hi John -

 

Thanks for your reply.

 

Approach #1 in the snippet is pretty much how I am handling things now and approach#2 is what I have been thinking of in case one could not test for individual overlays.  I wanted to make sure that before I began to add the shift registers for the boolean approach that I wasn't missing something obvious in Vision that would let me test for individual overlays.  I do believe this is an oversight in Vision and should probably be added in a future version.  I will mention this at the Idea Exchange.

 

Sincerely,

 

Don

0 Kudos
Message 9 of 16
(4,069 Views)

Definitely. Post a link to your idea exchange entry so I can add my Kudo.

John B.
Embedded Networks R&D
National Instruments
Certified LabVIEW Developer
0 Kudos
Message 10 of 16
(4,063 Views)