Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

binary image segamentation

Solved!
Go to solution

Hi All,

 

I got an image after threholding and particle filtering, which leaves an oval and a rectangular. The oval area contains the information for further processing. However, I need to segament it from the base, which is close to a rectangular shape. 

 

The attache image is only for a demonstration, which is not a perfect oval or rectangular in reality. Can you adivse on the segamentation between these two objects?

 

Thank you for your help in advance. 

0 Kudos
Message 1 of 6
(2,605 Views)
Solution
Accepted by topic author jujian9

Hello Jujian

 

You can fit a line(rectangle can be inclined anyways) and determine where exactly the rectangle lies (top or bottom of the circle - use centre of mass), then you can mask and extract whatever you want. Like this

Line Edge.PNG

Always try to attach the actual data rather than the sample. Hope this helps !

 

-Rahul

Hit KUDOS for Thanks

 

0 Kudos
Message 2 of 6
(2,574 Views)

Hi Rahul,

 

Thank you for your reply and I do agree your solution can solve my problem. 

 

Two images were attached with this thread for your reference, which is the image to process. The circles are the objects to analysis. In such a case, do you have a better idea to segament it from the base? 

Download All
0 Kudos
Message 3 of 6
(2,539 Views)

Hello Jujian

 

What do you mean by "segment from the base" ?

 

-Rahul

Hit KUDOS for Thanks

0 Kudos
Message 4 of 6
(2,487 Views)
pls see the attached two image files in my last post. the base refers to the solid region other than the circles.
0 Kudos
Message 5 of 6
(2,474 Views)

I slightly modified the Morphological Segmentation example and got it to remove the bar that the circles rest against, below are screenshots of the segmentation.

 

particles00.PNG

 

particles01.PNG

 

The only changes to the example are:

 - Changed the initial threshold to search for dark objects instead of bright

 - Added a Particle Filter after the IMAQ AND, to remove particles that aren't circular

 

Attached is the modified VI, saved for LV2018.

0 Kudos
Message 6 of 6
(2,451 Views)