In MATLAB, why does delaunayTriangulation give different number of triangles for images with 68-landmarks?

77 Views Asked by At

I am trying to implement pose normalization for face images using piece-wise affine warping. I am using delaunayTriangulation to construct face mesh based on detected 68 landmarks for two images: one with frontal face and the other with non-frontal face. The resulted meshes do not have the same number of triangles and also have triangles that are different in direction and location.

Could anyone help please? Thanks.

% Construct mesh for frontal face image
filename1 = '0409';
img1 = imread([filename1 '.bmp']);
if(size(img1,3)==3)
   img1 = rgb2gray(img1);
end
figure, imshow(img1); hold on;
pts1 = load([filename1 '.mat']);    % Load 68-landmarks
DT1 = delaunayTriangulation(pts1.pts);
triplot(DT1,'cyan');

% Construct mesh for non-frontal face image 
filename2 = '0411';
img2 = imread([filename2 '.bmp']);
if(size(img2,3)==3)
   img2 = rgb2gray(img2);
end
figure, imshow(img2); hold on;
pts2 = load([filename2 '.mat']);     % Load 68-landmarks
DT2 = delaunayTriangulation(pts2.pts);
triplot(DT2,'cyan');
0

There are 0 best solutions below