problem with imfill an specific hole

I have a problem, I have a mask with holes and I want to fill only one of them. ¿Is it possible to do that?
Well I need to fill the hole or know the value of the masc involving the hole. Both are ok for me because what I need is to know the value of the masc inolving an sepecific hole.
Please It would be nice to get some help Thank you silvia

답변 (1개)

Image Analyst
Image Analyst 2014년 1월 21일
편집: Image Analyst 2014년 1월 21일

0 개 추천

Somehow you need to identify that hole, like you have an x,y coordinate in it. Then you can use imreconstruct().
  1. fill the image
  2. subtract original to get "holes only" image.
  3. make new binary image with a single dot at the location of the hole to keep.
  4. call imreconstruct to get only that one hole
  5. add to your original binary image.
If you can't figure out the exact code, attach your image. Also, please define "masc" - I don't know what that is.

댓글 수: 3

Silvia
Silvia 2014년 1월 22일
Here is my image, it is an example. All the external area marked with a red cross has a value of 3.1 and the area marked with a blue cross has a value of 3. The black area in the center of the image is the hole. What I need is fill the hole with the value of the envolving mask, I mean,I need to convert the values of the hole (0) to the values envolving the hole (3 in this case, but it can be any value).
Please I need help. It is important Thank you
Silvia
Silvia 2014년 1월 22일
I don't know why but If I use imfill the values of the hole are 3.1 not 3 that is the envolving mask.
Image Analyst
Image Analyst 2014년 1월 22일
Try roifill() instead. See if that works. Let me know.

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

질문:

2014년 1월 21일

댓글:

2014년 1월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by