前言
本文介绍BFM模型,从中提取68个关键特征点对应的立体信息以及可视化。
code
BFMpath = '01_MorphableModel.mat';
BFM = load(BFMpath);
landmarkpath = 'Landmarks68_BFM.anl';
%landmarkpath = 'Landmarks21_BFM.anl';
idx = readLandmarks(landmarkpath);
vertices = double(reshape(BFM.shapeMU,3,length(BFM.shapeMU)/3)');
faces = BFM.tl;
showLandmarks(vertices,faces,idx);
%
shapeMU = BFM.shapeMU;
shape = reshape(shapeMU, 3, 53490);
shape = shape.';
x = shape(:, 1);
y = shape(:, 2);
z = shape(:, 3);
figure
scatter3(x, y, z, 1, 'filled');
hold on
landmarks3d = zeros(68, 3);
for i =1 : 68
scatter3(x(idx(i), y(idx(i)), z(idx(i)), 10, 'r');
text(double(x(idx(i))), double(y(idx(i))), double(z(idx(i))), int2str(i));
landmarks3d(i, :) = [x(idx(i), y(idx(i), z(idx(i))];
end
save landmarks3d landmarks3d
ld3d = landmarks3d/100.0;
在matlab中通过三维旋转可以查看三维图像各个角度的立体信息。
参考
完