MATLAB - Filling an empty area of ​​an ellipse / skull shape?

I am trying to fill a binary image in Matlab, so I am left with all this oval image like this.

-> VISUALIZATION OF MY ISSUE <-

However, I ran into a problem, actually having the ability to identify the red region. I tried the following:

  • Using the function bwconvhullto precisely fill the shape, but then I don’t know how to get rid of the inner shape in order to isolate only the red area.
  • I also tried tracing the boundary of the binary region, but to no avail. I'm not quite sure what to do after tracking the border. I tried to trace only the inner border, but the function bwtraceboundarysimply follows the completeness of the borders (inside and outside the skull).

- bwconvhull, ? () , () "" , . :

(a) -

hole=imread('Copy CT.jpg');
BW=im2bw(hole,.9); 
dim=size(BW);
col=round(dim(2)/2);        
row=min(find(BW(:,col)));
boundary = bwtraceboundary(BW,[row,col],'S');
x=boundary(:,2);
y=boundary(:,1);

(b) -

hole=imread('Copy CT.jpg');
BW=im2bw(hole,.9);   
CH=bwconvhull(BW);
KH=CH-BW;
KH2=bwareaopen(KH,200);

- , , , ? !

+4

Source: https://habr.com/ru/post/1693552/


All Articles