Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Detect interruption in contour?

Hi guys,

 

is it possible with Vision Development Module to detect a contour and further to detect if it is interrupted or closed?

 

A colleague of mine explained to me a method using a lasso tool. If a shape, for example a square with side length "a" is complete, the lasso envelops it completely from outside. The resulting lasso length would be slightly larger than 4*a.

But if the square is interrupted in one or more locations, the resulting contour would be enveloped from the inside as well, giving a lasso length much larger than 4*a. Thus it should be possible to detect the interruption.

 

I have attached an image to illustrate.

Thanks!

 

 

 

0 Kudos
Message 1 of 5
(4,253 Views)

Hi there,

 

How are you currently doing the lasso? Could you sent us an example code? 

Certified LabVIEW Architect (CLA)
0 Kudos
Message 2 of 5
(4,222 Views)

I do not have that many info, but with what I have (everytime a square, with only one interruption) you could try to use the Clamp as minimum and if the distance is lower than a certain value, you will know that the square is not full.

See the attached image.

 

Hope that is helping you. 

 

 

Certified LabVIEW Architect (CLA)
0 Kudos
Message 3 of 5
(4,205 Views)

Yes, here it is attached.

 

screenshot vi.PNG

0 Kudos
Message 4 of 5
(4,175 Views)

Need a second post for the fourth attachment, only three allowed.

Here is the code itself.

 

It basically works, but depending on the settings the algorithm seemingly cannot determine a "correct" contour if the case is not exactly clear. That is if the right border of the outer frame is still there but is dark and barely recognizable.

0 Kudos
Message 5 of 5
(4,174 Views)