Gointerface接口声明实现及作用详解
276
2022-09-04
【行为识别】基于差影法实现三维人体姿态行为识别附matlab代码
1 简介
2 部分代码
function pointsVisualize(vals,skel,varargin)%function pointsVisualize(vals,skel)[color,type,person,connect,missing,gt,texton,textsize,linewidth,showlines,marker]=process_options(varargin,'color','r','type',1,'person',1,'connect',[],'missing', [],'gt',0,'texton',1,'textsize',10,'linewidth',5,'showlines',1,'marker','o');for i =1:size(vals,1) strs{i}=num2str(i);endif isempty(connect) connect = skelConnectionMatrix(skel);endindices = find(connect);[I, J] = ind2sub(size(connect), indices);%handle(1)=figure;inds = ones(size(vals,1),1);inds(missing) = 0;inds = logical(inds);handle(1) = plot3(vals(inds, 1), vals(inds, 3), vals(inds, 2), marker, 'LineWidth', linewidth, 'MarkerSize', 5);hold on;if(texton) for i = 1: length(vals) h1 = text( vals(i, 1), vals(i, 3), vals(i, 2),strs{i},'FontSize',textsize,'FontWeight','bold'); endendaxis ij % make sure the left is on the left.grid oncolors=prism(6);if(type==2) M=[ colors(4:6,:); ... colors(4:6,:); ... colors(6,:); colors(6,:); colors(6,:); colors(5,:); colors(6,:); ... colors(1,:); colors(2,:); colors(1,:); ... colors(1,:); colors(2,:); colors(1,:); ... ];elseif(type==1) if person ==1 colors=prism(6); M= [colors(4:6,:); colors(1,:); ... colors(4:6,:); colors(1,:); ... colors(6,:); colors(6,:); colors(6,:); colors(5,:); colors(6,:); colors(5,:);... colors(1,:); colors(2,:); colors(1,:); colors(4,:); ... colors(1,:); colors(2,:); colors(1,:); colors(4,:);... ]; elseif person ==2 colors =jet(6); M= [colors(4:6,:); colors(1,:); ... colors(4:6,:); colors(1,:); ... colors(6,:); colors(6,:); colors(6,:); colors(5,:); colors(6,:); colors(5,:);... colors(1,:); colors(2,:); colors(1,:); colors(4,:); ... colors(1,:); colors(2,:); colors(1,:); colors(4,:);... ]; endelseif(type==3) M=[ colors(4:6,:); ... colors(4:6,:); ... colors(6,:); colors(6,:); colors(6,:); ... colors(1,:); colors(2,:); colors(1,:); ... colors(1,:); colors(2,:); colors(1,:); ... ];else M = repmat(colors(2,:),length(indices),1);endif(showlines) if(type<4) for i = 1:length(indices) handle(i+1) = line([vals(I(i), 1) vals(J(i), 1)], ... [vals(I(i), 3) vals(J(i), 3)], ... [vals(I(i), 2) vals(J(i), 2)]); missI = logical(length(find(missing == I(i)))); missJ = logical(length(find(missing == J(i)))); if(missI || missJ) set(handle(i+1), 'linewidth', linewidth,'Color',M(i,:), 'LineStyle', '--'); elseif(gt) set(handle(i+1), 'linewidth', linewidth,'Color','k', 'LineStyle', '--'); else set(handle(i+1), 'linewidth', linewidth,'Color',M(i,:)); end end axis equal else for i = 1:length(indices) handle(i+1) = line([vals(I(i), 1) vals(J(i), 1)],... [vals(I(i), 2) vals(J(i), 2)], ... [vals(I(i), 3) vals(J(i), 3)]); set(handle(i+1), 'linewidth', 5,'Color',M(i,:)); end axis equal endend% xlabel('x','Interpreter','latex','fontsize',10);% ylabel('z','Interpreter','latex','fontsize',10);% zlabel('y','Interpreter','latex','fontsize',10);hold off
3 仿真结果
4 参考文献
[1] Ramakrishna V , Kanade T , Sheikh Y . Reconstructing 3D human pose from 2D image landmarks.[C]// Springer Berlin Heidelberg. Springer Berlin Heidelberg, 2012.
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。
部分理论引用网络文献,若有侵权联系博主删除。
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~