【行为识别】差影法三维人体姿态行为识别【含Matlab源码 277期】
创始人
2024-03-13 20:17:32
0

⛄一、简介

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

⛄二、部分源代码

% [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 © 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 http://www.gnu.org/licenses/.

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


## ⛄三、运行结果
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210209213447613.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1RJUUNtYXRsYWI=,size_16,color_FFFFFF,t_70#pic_center)
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210209213447607.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1RJUUNtYXRsYWI=,size_16,color_FFFFFF,t_70#pic_center)## ⛄四、matlab版本及参考文献
**1 matlab版本**
2014a**2 参考文献**
[1] 蔡利梅.MATLAB图像处理——理论、算法与实例分析[M].清华大学出版社,2020.
[2]杨丹,赵海滨,龙哲.MATLAB图像处理实例详解[M].清华大学出版社,2013.
[3]周品.MATLAB图像处理与图形用户界面设计[M].清华大学出版社,2013.
[4]刘成龙.精通MATLAB图像处理[M].清华大学出版社,2015.**3 备注**
简介此部分摘自互联网,仅供参考,若侵权,联系删除

相关内容

热门资讯

保存时出现了1个错误,导致这篇... 当保存文章时出现错误时,可以通过以下步骤解决问题:查看错误信息:查看错误提示信息可以帮助我们了解具体...
汇川伺服电机位置控制模式参数配... 1. 基本控制参数设置 1)设置位置控制模式   2)绝对值位置线性模...
不能访问光猫的的管理页面 光猫是现代家庭宽带网络的重要组成部分,它可以提供高速稳定的网络连接。但是,有时候我们会遇到不能访问光...
表格中数据未显示 当表格中的数据未显示时,可能是由于以下几个原因导致的:HTML代码问题:检查表格的HTML代码是否正...
本地主机上的图像未显示 问题描述:在本地主机上显示图像时,图像未能正常显示。解决方法:以下是一些可能的解决方法,具体取决于问...
表格列调整大小出现问题 问题描述:表格列调整大小出现问题,无法正常调整列宽。解决方法:检查表格的布局方式是否正确。确保表格使...
不一致的条件格式 要解决不一致的条件格式问题,可以按照以下步骤进行:确定条件格式的规则:首先,需要明确条件格式的规则是...
Android|无法访问或保存... 这个问题可能是由于权限设置不正确导致的。您需要在应用程序清单文件中添加以下代码来请求适当的权限:此外...
【NI Multisim 14...   目录 序言 一、工具栏 🍊1.“标准”工具栏 🍊 2.视图工具...
银河麒麟V10SP1高级服务器... 银河麒麟高级服务器操作系统简介: 银河麒麟高级服务器操作系统V10是针对企业级关键业务...