In my project, I want to fill holes which are 2 pixel thin.

To fill 2-pixel thin hollows, we use a process in two steps.

During the first step, the filling template(attached) is centered on each pixel p with value i = 0 in DM. The central pixel of the template is 0, while the eight pixels on the four arms of the cross are 1, and all other pixels are don’t care elements.

Any pixel p with value i = 0in DM and having at least a pixel with value i = 0 in both two opposite horizontal or vertical arms of the cross is marked in parallel as candidate to be moved from the background to the foreground.

I attached the mask.

Can anyone tell me how to do this process using matlab.

Similar questions and discussions