前言
本文介绍BFM模型,从中提取68个关键特征点对应的立体信息以及可视化。
code
BFMpath = '01_MorphableModel.mat'; BFM = loadBFMpath); landmarkpath = 'Landmarks68_BFM.anl'; %landmarkpath = 'Landmarks21_BFM.anl'; idx = readLandmarkslandmarkpath); vertices = doublereshapeBFM.shapeMU,3,lengthBFM.shapeMU)/3)'); faces = BFM.tl; showLandmarksvertices,faces,idx); % shapeMU = BFM.shapeMU; shape = reshapeshapeMU, 3, 53490); shape = shape.'; x = shape:, 1); y = shape:, 2); z = shape:, 3); figure scatter3x, y, z, 1, 'filled'); hold on landmarks3d = zeros68, 3); for i =1 : 68 scatter3xidxi), yidxi)), zidxi)), 10, 'r'); textdoublexidxi))), doubleyidxi))), doublezidxi))), int2stri)); landmarks3di, :) = [xidxi), yidxi), zidxi))]; end save landmarks3d landmarks3d ld3d = landmarks3d/100.0;
在matlab中通过三维旋转可以查看三维图像各个角度的立体信息。
参考
完