【模式识别】基于差影法之三维人体姿态行为识别matlab源码

一、简介

该课题为基于MATLAB差影法的人体姿态识别。带有一个GUI可视化界面。需要准备对应的模板图片作为背景图,然后测试图和背景图进行作差,结合形态学知识,提取出人体轮廓,接上最外接矩形,得出矩形长宽,计算长宽比例,从而判断人体姿态。优点是通俗易懂,缺点是局限性大,因为对背景图片要求比较高。另外可改造成不需要模板图片的纯形态学或者利用帧差法识别的基于视频的人体行为检测。
在这里插入图片描述

二、源代码

% [X, R, t] = function recon3DPose(xy,im,varargin)
%
% Inputs:   xy - [2 x 14] matrix of 2D joint locations
%           im - Input image
%           
%
%
% Outputs:  X  - [3 x 14] matrix of 3D joint locations.
%           R  - [3 x 3]  Relative Camera Rotation.
%           t  - [3 x 1]  Relative Camera translation.
%
% Wrapper for reconstruction of the 3D Pose of a human figure given the 
% locations of the 2D anatomical landmarks.
% Copyright (C) 2012  Varun Ramakrishna.
% 
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
% 
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
% 
% You should have received a copy of the GNU General Public License
% along with this program.  If not, see .

function [X, R, t] = recon3DPose(im,xy,varargin)
% [X, R, t] = recon3DPose(xy,im,varargin)

% Parse parameters.
[pose.skel, pose.BOMP, pose.mu, pose.lambda1,...
 pose.lamda2, pose.K, pose.numIter,...
 pose.numIters2, pose.tol1, pose.tol2, pose.ks,...
 pose.optType, pose.viz, pose.annoids,pose.numPoints] = process_options(varargin,...
                                'skel','',... 
                                'BOMP','',...
                                'mu'  ,'',...
                                'lambda2',0.01,...
                                'lambda1',0.01,...
                                'K', setK(size(im,2),size(im,1),2),...
                                'numIter', 20,...
                                'numIters2',30,...
                                'tol1', 500, ...
                                'tol2', 1, ...
                                'ks', 15, ...
                                'optType', 1, ...
                                'viz', 0,...
                                'annoids',1:15,...
                                'numPoints',15);
pose.im = im;
pose.xy = [xy; ones(1,size(xy,2))];

% Load default basis and skeleton
if(isempty(pose.BOMP)||isempty(pose.mu)||isempty(pose.skel))
    basis = load('mocapReducedModel.mat');
    pose.BOMP = basis.B;
    pose.mu   = basis.mu;
    pose.skel = basis.skel;
    pose.numPoints = length(pose.skel.tree);
    pose.annoids    = [1:length(pose.skel.tree)]; 
end

% Reconstruct camera and pose.
[camera, pose] = cameraAndPose(pose);

% Assign outputs
X = pose.XnewR;
R = camera.R;
t = camera.t;

% Show aligned output
if(pose.viz)
    load frontCam;
    Xnew1 = alignToCamera(pose.XnewR,camera.R,camera.t,R,t);
    figure(9);clf;
    visualizeGaussianModel(Xnew1,pose.skel);
    drawCam(R,t);
end

三、运行结果

在这里插入图片描述
在这里插入图片描述

四、备注

完整代码或者代写添加QQ1575304183

往期回顾>>>>>>

【图像识别】国外车牌识别matlab源码

【图像识别】基于cnn卷积神经网络之验证码识别matlab源码

【图像识别】基于svm植物叶子疾病检测和分类matlab源码​​​​​​​

【图像识别】路面裂缝识别含GUI源码matlab源码​​​​​​​

【图像识别】基于RGB和BP神经网络的人民币识别系统含GUI界面matlab源码​​​​​​​

【图像识别】条形码识别系统matlab源码​​​​​​​

【图像识别】基于不变矩的数字验证码识别含GUI界面matlab源码​​​​​​​

【图像识别】基于模板匹配之手写数字识别系统GUI界面matlab源码​​​​​​​

【图像识别】基于贝叶斯分类器之目标识别matlab源码

【图像识别】身份证号码识别matlab源码

【图像识别】条形码识别系统matlab源码​​​​​​​

【图像分类】基于极限学习分类器对遥感图像分类matlab源码​​​​​​​

【图像识别】基于BP神经网络之字母识别matlab源码

【图像特征处理】指纹图像细节特征提取matlab源码

【图像识别】基于反馈神经Hopfield的数字识别matlab源码

【图像识别】基于二值膨胀差分和椒盐滤波之教室内人数识别系统matlab源码

你可能感兴趣的:(matlab,图像处理)