01-06-2016 07:29 AM
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!
01-07-2016 04:56 AM
Hi there,
How are you currently doing the lasso? Could you sent us an example code?
01-07-2016 06:31 AM
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.
01-08-2016 03:24 AM
Yes, here it is attached.
01-08-2016 03:27 AM
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.