Erdi İzgi
Erdi İzgi

Reputation: 1322

How to eliminate the errors around edge boundaries after cutting out the Image?

I'm making an image processing project which has a 6-step algorithm and I'm stuck in one of these.

First off all, the platform I using is MATLAB, so if you can supply some samples it would be great. But if you don't want to write code samples, please just give me some hints, techniques or etc.

Let me explain my problem. I've segmented a .jpg image and cut out some areas of it. Then I save the result as .png using a mask. The result is like that (The black part is actually transparent, I made it black to see better the problem);

enter image description here

As you may see in the picture, there is some irrelevant areas. I need to get rid of these irrelevant areas. Because I want the foreground as much as smooth. At the first sight, I applied Gaussian blur to the mask and save the image as .png, again. But the result isn't satisfying as you can imagine. I suppose this situation is needed more solid solution than I have tried.

Edit1: I used spectral matting. But it doesn't help. The best result that I can receive is like that;

enter image description here

As you can see there is some problems on the face and lots of problems on the bottom side of the picture. I guess I need kind of edge fixer or edge smoother for the first image above and it should be faster than matting.

Any MATLAB code samples, technique and approach would be great. If you need further explanation, feel free to ask.

Upvotes: 3

Views: 363

Answers (1)

Shai
Shai

Reputation: 114786

You do not want just to "Gauss-blur" the result, you want soft segmentation a.k.a matting. As a first stop for image matting I would recommend Levine Rav-Acha and Lischinski Spectral Matting. You'll find some Matlab code there (I used it in the past - very impressive results).

Upvotes: 5

Related Questions