how to fill up distorted images with proper pixels?

1 view (last 30 days)
I have a distorted image of an spine and i need to fiil up those portions with black pixels so that i can get a uniform image. But as the boundary portions are also absent in many parts , using imfill(image,'holes') does not fill up those parts. Please suggest me a way to restore the image.
I= imread('test1.jpg');
figure, imshow(I);
I=im2bw(I);
I=~I;
Ifill = imfill(I,'holes');
Iarea = bwareaopen(Ifill,500);
I have used this code so far.

Answers (1)

Image Analyst
Image Analyst on 9 Nov 2014

Community Treasure Hunt

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

Start Hunting!