根据给定的侧脸图片重建对应的人正脸图matlab仿真

Posted fpga和matlab

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了根据给定的侧脸图片重建对应的人正脸图matlab仿真相关的知识,希望对你有一定的参考价值。

目录

一、理论基础

二、核心程序

三、测试结果


一、理论基础

这里,我们参考文献《[1] Gupta S ,  Kapoor S ,  Gupta P . Synthesis of a face image at a desired pose from a given pose[J]. Pattern Recognition Letters, 2012, 33(14):1942-1950.》

       This paper proposes an efficient method to synthesize pose of an image. Pose synthesis is used to predict the face image with minimal error at a desired pose from a given pose. It is frequently required in many applications like production of animated movies, in forensic science and generation of 3D face geometry, etc. It uses principal component analysis (PCA) in conjunction with linear object classes (LOC) method (Vetter and Poggio, 1997). The face image of a pose is modelled as shape and texture vectors and the LOC method is applied on these two vectors of training set separately. The principal components of shape vector give a smaller number of significant dimensions along which the best linear approximation using LOC for the shape vector is calculated. Even though the given vector is approximated using only these dimensions, the error in approximation is significantly less compared to approximating pose image using all dimensions of shape vector. The proposed method is tested on CMU PIE face database and it is found to be significant improvement over the well known linear object classes method.

 

二、核心程序

People = 2;
%%
%读取图片
Filea       =     ['Images\\people',num2str(People),'\\c\\'];
Filea_list  = dir(['Images\\people',num2str(People),'\\c\\*.jpg']);
Fileb       =     ['Images\\people',num2str(People),'\\b\\'];
Fileb_list  = dir(['Images\\people',num2str(People),'\\b\\*.jpg']);
Bgimga = ['Images\\people',num2str(People),'\\c.jpg'];
Bgimgb = ['Images\\people',num2str(People),'\\b.jpg'];
[Ia,Bga] = func_face_read(Filea,Filea_list,Bgimga);
[Ib,Bgb] = func_face_read(Fileb,Fileb_list,Bgimgb);
%检测人脸
facea = func_detect_face(Ia,Bga);
faceb = func_detect_face(Ib,Bgb);

%%
%人脸特征提取,通过LOC和PCA算法提取不同角度的人脸特征参数
[Frontal_Face,Frontal_FaceMean] = func_LOC_PCA_feature(facea);
[Profile_Face,Profile_FaceMean] = func_LOC_PCA_feature(faceb);

%使用训练后的模型进行其余侧脸的正脸合成
%读取一个侧面脸
Image_FF1 = rgb2gray(imread(['Images\\people',num2str(People),'\\c\\27_00.jpg'])); 
Image_FF2 = func_detect_face2(Image_FF1,Bga);


Image_PF1 = rgb2gray(imread(['Images\\people',num2str(People),'\\b\\22_01.jpg'])); 
Image_PF2 = func_detect_face2(Image_PF1,Bgb);

%合成正脸
Image_PF2 = imresize(Image_PF2,[100,100]);
b = reshape(Image_PF2,1,100*100); 
b = double(b);
c = b*Frontal_Face; 

t = 3;
d = Frontal_Face(:,1:t) * c(1:t)'+Frontal_FaceMean'; 
d = mat2gray(reshape(d,[100,100]));
d = imadjust(d,[0.01 0.9],[0 1]);  

三、测试结果

 

A10-20 

以上是关于根据给定的侧脸图片重建对应的人正脸图matlab仿真的主要内容,如果未能解决你的问题,请参考以下文章

人脸人脸特征点检测

使用matlab根据液体扩散图片分析其对应的等浓度线

仿qq的侧拉菜单效果

仅需2张图,AI便可生成完整运动过程

仅需2张图,AI便可生成完整运动过程

LeetCode406:根据身高重建队列