forked from mzolfaghari/3D-human-pose-estimation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EstiPose.m
44 lines (30 loc) · 1.5 KB
/
EstiPose.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% 3D Human Pose Estimation using Couple Sparse Coding %
%%%% Written by Mohammadreza Zolfaghari and Amin Jourablo %%%%%%%%%%%%
%%% If you are using this code for your research, -------------------%
%%%%% please cite the following paper: ------------------------------%
%%%%% 3D human pose estimation from image using ---------------------%
%%%%% couple sparse coding, MVA 2014-------------------------------%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [EstiPose,SparseVec]=EstiPose(xTrainSet,xTestSet,yTrainSet,Upose,Lambda,alpha)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FeatureDic=xTrainSet;
PoseDic=yTrainSet;
Ry=yTrainSet;
k=size(FeatureDic,2);
lenM=length(xTestSet(1,:));
lenN=length(yTrainSet(:,1));
EstiPose=zeros(lenN,lenM);
%====================================================================
SparseVec=zeros(lenM,k);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
alfa1=l1ls_featuresign_Couple(FeatureDic, xTestSet, PoseDic, Upose, Lambda, alpha);
for i=1:lenM
alfan=repmat(alfa1(:,i)',lenN,1);
temp1=sum(alfa1(:,i));
alfan=alfan/temp1;
uk=sum((alfan.*PoseDic)');
EstiPose(:,i)=uk;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end