Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Advanced IMAQ Convex Hull (or IMAQ Morphology/Close)?

I have a challenge in that I want to use a tool like IMAQ Convex Hull or IMAQ Morphology (with Close), however I only want to close cavities in my 2D image that meet certain criteria.

 

In this basic example I want to close the cavity with the green line, but I do not want to clsoe the 'corner' marked by the red line:

 

Convex_hull_challenge_1.png

 

 

In their native form the IMAQ functions do not appear to support this sort of ability to discriminate different types of cavity, and would fill both of the exampels above.

 

Here's an example image from my project:

 

Convex_hull_challenge_2.png

 

I really need to be able to close out the cavities in the core of the blob without really changing the general shape of the outer perimeter of the object.

 

It looks like I may have to develop a custom algorithm, which I am prepared to do, but I do like to avoid re-inventing the wheel in the event a standard solution already exists.

0 Kudos
Message 1 of 2
(3,723 Views)

You will have to make a custom algorithm. Some of these previous threads might be helpful for you:

http://forums.ni.com/t5/Machine-Vision/Watershed-filtering/td-p/10942/page/3?view=by_date_ascending

http://forums.ni.com/t5/Machine-Vision/How-Can-I-estimate-the-true-width-of-a-particle/m-p/3090240#M...

http://forums.ni.com/t5/Machine-Vision/How-to-get-boundary-contour-points/m-p/578177

 

 

My first ideas about what might work:

  1. Extract contour points.
  2. Calculate curvatures.
  3. Find points with high curvature.
  4. If two points with high curvature are far apart in the array or contour points, but close together in space, they are probably close together, so draw a line connecting them.
  5. Call the Fill Holes function

 

This looks like a fun one. Good luck!

Kevin C.

0 Kudos
Message 2 of 2
(3,697 Views)