Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fill empty parts of a projected image?

When i projected a 3D model on a 2D plan (Perspective projection) the result of the projection appeared as the following image.

Resulted Projection

and i need to fill empty points in this image to look like this one

i wonder that i can find a good way to fill this points with a professional way using any image processing algorithms using matlab

Silhouette image

like image 329
Amr Ramadan Avatar asked Feb 04 '26 14:02

Amr Ramadan


2 Answers

Code in Mathematica. Matlab surely has the equivalent image transformations.

enter image description here

Let's see how both images fit:

enter image description here

As you can see, the neck is a bit Hulkish ... otherwise the result is quite good

like image 122
Dr. belisarius Avatar answered Feb 06 '26 05:02

Dr. belisarius


Here is a MATLAB version somewhat equivalent to @belisarius answer:

I = double(imread('https://i.sstatic.net/sedZH.png'));
BW = im2bw(I,graythresh(I));
BW = imerode(BW,strel('square',2*3+1));
BW = imfilter(BW, fspecial('average',10));
BW = imdilate(BW,strel('square',2*3+1));
BW = imcomplement(BW);
imshow(BW)

enter image description here

like image 34
Amro Avatar answered Feb 06 '26 06:02

Amro