Filling holes in a binary image

조회 수: 8 (최근 30일)
Ryan Tigera
Ryan Tigera 2020년 11월 19일
댓글: Ryan Tigera 2020년 11월 28일
Hi,
I have attached A PDF of code and two images in binary. They are from the same image that is the first attachment however the conversion to binary has created two very different binary images. The first image is from cluster 2 of the LaB segmented command and then I use the imfill command of this image.The second binary image had it's holes filled with the imfill command after a conversion to grayscale. I have over fifty of these images and some of the images require the first method while others do the second method. There are a few photos that work for both methods but when I compare the regionprops calculations for area, axislength, etc the results are very different. It is important to be consistent as I am looking for the difference in two different scenarios.
I would appreciate any guidance to fill the image so you can no longer see the barb and the yellow plume is converted to a continuous, binary image for further analysis.
I can also provide any additional information if that would help.
Thanks for the help.
Ryan

채택된 답변

Nagasai Bharat
Nagasai Bharat 2020년 11월 25일
Hi,
From my understanding you are trying fill in the middle blob and make a continous binary image. As you already used the imfill function I would like to bring to your notice of the Morphological operations you could perform on your binary image to get the result you expect with more flexibility. MATLAB provides various functions to perform these operations and a few examples to understand them.
Do have look at the below links for your assistance.
  댓글 수: 1
Ryan Tigera
Ryan Tigera 2020년 11월 28일
Thank you for your help and sending me those links.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2020년 11월 25일
Segmentation of the gray scale image is like doing segmentation on the L channel only. Segmentation of the full LAB color image is a true color segmentation using all 3 color channels, so of course they will look different. They will not neccesarily be consistent since you're using different information to segment them in two different ways.
  댓글 수: 1
Ryan Tigera
Ryan Tigera 2020년 11월 28일
Thanks for the explanation. Now that I have a better understanding of the different methods, I was able to use both to effectivelye explain my analysis. Thanks again.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by