【3DFR Matlab】从深度图像中提取三维人脸数据

论文:Led3D: An lightweight and efficent deep approach to recognizing low-quality 3d faces
代码:Led3D
软件:Matlab R2017a
在这里插入图片描述
主函数代码(其余参考git仓库URL):


addpath('util');
landmark_path='simple/label/infrared/001_Kinect_FE_1INFRARED.txt';
color_path='simple/data/color/001_Kinect_FE_1COLOR/01.jpg';
depth_path='simple/data/depth/001_Kinect_FE_1DEPTH/01.png';
color_face = imread(color_path);    figure(2),imshow(color_face);  
depth_face = imread(depth_path);    figure(3),imshow(depth_face,[500,800]);    

landmark = readLandmark(landmark_path);
nose_tip = calcNTP(landmark);

imgSize = [180, 180];
roi=depth_face(nose_tip(2)-imgSize(1)/2 +1:nose_tip(2)+imgSize(1)/2 ,nose_tip(1)-imgSize(2)/2 +1:nose_tip(1)+imgSize(2)/2);
figure(4),imshow(roi,[500,800]);

reSize=360;
roi_face = imresize(roi,[reSize,reSize]);

pc_template=zeros(3,reSize*reSize);
pc_template(1,:) = floor((0:(reSize*reSize-1)) /reSize)+1;
pc_template(2,:) = mod(0:(reSize*reSize-1),reSize)+1;
pc_template(3,:) = roi_face(:);
figure(5),pcshow(pointCloud(pc_template'));

r=100;
xo=double(reSize/2); yo=double(reSize/2);  
zo=double(median(median(roi_face(xo-10:xo+10,yo-10:yo+10))));
pc_template(3,((xo-pc_template(2,:)).*(xo-pc_template(2,:))+(yo-pc_template(1,:)).*(yo-pc_template(1,:))+(zo-pc_template(3,:)).*(zo-pc_template(3,:)))>r*r)=0;
pc_face=pc_template(:,pc_template(3,:)>0);
figure(6),pcshow(pointCloud(pc_face'));

[depth,mask] = calcDepthAndNormal(pc_face,1,1);
figure(7),imshow(uint8(normalizeSize(normalizeValue(depth))));
normal = calcNormal(uint8(normalizeSize(depth)));
figure(8),imshow(normal);
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

穆友航

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值