Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Overlay convex hull outline

Hello there,

 

I'm quite new to LabView.

I'd like to overlay the outline of a particle's convex hull to the original image to see both, the convex hull AND the original image.

Can anybody help me out with this?

0 Kudos
Message 1 of 4
(3,688 Views)

Here's a way to do it.  There may be easier ways, but this should work.

 

Start with your original binary image.  Call this ORIGINAL.

 

Perform the convex hull operation with a new destination image to preserve the original image.  Call this HULL.

 

Perform a binary dilate command on the new image with a new destination image.  Call this DILATE.

 

Subtract HULL from DILATE to get the outline of the hull.  You could also use XOR.  Call this OUTLINE.

 

Multiply OUTLINE by 2 to make it a different binary value.

 

Use OR to combine OUTLINE and ORIGINAL.  This will look pretty good using the binary palette to display it.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 4
(3,675 Views)

Thanks for your reply!
I'm going to try it. But I've got one more question:

I already found a similar solution for my problem yesterday, where the outline was somehow written to a ROI and then overlayed. But I'm trying to overlay the snapped picture of the camera with the convex hull outline, but somehow it didn't work this way.

 

0 Kudos
Message 3 of 4
(3,668 Views)

You could probably use overlay bitmap instead of OR on the last step.  In this case, you would need to multiply by 255 instead of 2 so that the binary image is visible.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 4
(3,649 Views)