一、获取代码方式

获取代码方式1:
通过订阅紫极神光博客付费专栏,凭支付凭证,私信博主,可获得此代码。

获取代码方式2:
通过紫极神光博客主页开通CSDN会员,凭支付凭证,私信博主,可获得此代码。

获取代码方式3:
完整代码已上传我的资源:【跌倒检测】基于matlab中值滤波+二值化跌倒检测【含Matlab源码 344期】

备注:开通CSDN会员,仅只能免费获得1份代码(有效期为开通日起,三天内有效);
订阅紫极神光博客付费专栏,可免费获得1份代码(有效期为订阅日起,三天内有效);

二、简介

中值滤波是基于排序统计理论的一种能有效抑制噪声的非线性信号处理技术,中值滤波的基本原理是把数字图像或数字序列中一点的值用该点的一个邻域中各点值的中值代替,让周围的像素值接近的真实值,从而消除孤立的噪声点。方法是用某种结构的二维滑动模板,将板内像素按照像素值的大小进行排序,生成单调上升(或下降)的为二维数据序列。二维中值滤波输出为g(x,y)=med{f(x-k,y-l),(k,l∈W)} ,其中,f(x,y),g(x,y)分别为原始图像和处理后图像。W为二维模板,通常为33,55区域。经中值滤波后图像如图1所示。

三、部分源代码

clear all clc
global Bili;
A=[];
B=imread('46.jpg');
B=rgb2gray(B);
B=medfilt2(B);        %中值滤波
fileName = '倾斜跌倒1.avi';
obj = VideoReader(fileName);           %读取录制的视频
vidFrames=read(obj);                 %读取所有帧图像
numFrames=get(obj, 'NumberOfFrames');%总帧数
for k = 63:250                   %帧数循环,人为选取33帧作为背景帧
mov(k).cdata=vidFrames(:,:,:,k);
mov(k).cdata=rgb2gray(mov(k).cdata);
mov(k).cdata=medfilt2(mov(k).cdata);
R=imabsdiff(mov(k).cdata,B);
z=im2bw(R,graythresh(R));
z=bwmorph(z,'erode',3);                       % 3次腐蚀处理掉噪点
P = bwmorph(z,'dilate',3);                    %3次膨胀膨胀
P= bwareaopen(P,50);
figure(1),subplot(121);imshow(vidFrames(:,:,:,k));
figure(1);subplot(122);imshow(P);
x=sum(P(:));
s=x/(480*640);
if s>=0.03[m1,n1] = find(P == 1);
%第一级检测,角度top1= min(m1);%纵向bottom1= max(m1);left1= min(n1);%横向right1= max(n1);height1=bottom1-top1+1;%纵向高;width1 = right1-left1+1;%横向宽rectangle('Position',[left1,top1,width1,height1],'EdgeColor','r');line([left1,right1],[top1,bottom1],'color','r','LineWidth',1);%标记对角线line([left1,right1],[bottom1,top1],'color','r','LineWidth',1);tan=(bottom1-top1)/(right1-left1);tan=atan(tan);J=tan*180/pi;
%第二级检测,质心高度比Rz[rectx,recty,area,perimeter] = minboundrect(n1,m1,'p');line(rectx(:),recty(:),'color','w','LineWidth',1);line([rectx(1),rectx(3)],[recty(1),recty(3)],'color','b','LineWidth',1);line([rectx(2),rectx(4)],[recty(2),recty(4)],'color','b','LineWidth',1);line([0,640],[max(bottom1),max(bottom1)],'color','r','LineWidth',2);%水平线line([(rectx(1)+rectx(3))/2,(rectx(1)+rectx(3))/2],[(recty(1)+recty(3))/2,max(bottom1)],'color','b','LineWidth',2);%画高h=max(bottom1)-(recty(1)+recty(3))/2;%高度Rz=h/360;function [rectx,recty,area,perimeter] = minboundrect(x,y,metric)
% minboundrect: Compute the minimal bounding rectangle of points in the plane
% usage: [rectx,recty,area,perimeter] = minboundrect(x,y,metric)
%
% arguments: (input)
%  x,y - vectors of points, describing points in the plane as
%        (x,y) pairs. x and y must be the same lengths.
%
%  metric - (OPTIONAL) - single letter character flag which
%        denotes the use of minimal area or perimeter as the
%        metric to be minimized. metric may be either 'a' or 'p',
%        capitalization is ignored. Any other contraction of 'area'
%        or 'perimeter' is also accepted.
%
%        DEFAULT: 'a'    ('area')
%
% arguments: (output)
%  rectx,recty - 5x1 vectors of points that define the minimal
%        bounding rectangle.
%
%  area - (scalar) area of the minimal rect itself.
%
%  perimeter - (scalar) perimeter of the minimal rect as found
%
%
% Note: For those individuals who would prefer the rect with minimum
% perimeter or area, careful testing convinces me that the minimum area
% rect was generally also the minimum perimeter rect on most problems
% (with one class of exceptions). This same testing appeared to verify my
% assumption that the minimum area rect must always contain at least
% one edge of the convex hull. The exception I refer to above is for
% problems when the convex hull is composed of only a few points,
% most likely exactly 3. Here one may see differences between the
% two metrics. My thanks to Roger Stafford for pointing out this
% class of counter-examples.
%
% Thanks are also due to Roger for pointing out a proof that the
% bounding rect must always contain an edge of the convex hull, in
% both the minimal perimeter and area cases.
%
%
% Example usage:
%  x = rand(50000,1);
%  y = rand(50000,1);
%  tic,[rx,ry,area] = minboundrect(x,y);toc
%
%  Elapsed time is 0.105754 seconds.
%
%  [rx,ry]
%  ans =
%      0.99994  -4.2515e-06
%      0.99998      0.99999
%   2.6441e-05            1
%  -5.1673e-06   2.7356e-05
%      0.99994  -4.2515e-06
%
%  area
%  area =
%      0.99994
%
%
% See also: minboundcircle, minboundtri, minboundsphere
%
%
% Author: John D'Errico
% E-mail: woodchips@rochester.rr.com
% Release: 3.0
% Release date: 3/7/07% default for metric
if (nargin<3) || isempty(metric)metric = 'a';
elseif ~ischar(metric)error 'metric must be a character flag if it is supplied.'
else% check for 'a' or 'p'metric = lower(metric(:)');ind = strmatch(metric,{'area','perimeter'});if isempty(ind)error 'metric does not match either ''area'' or ''perimeter'''end

四、运行结果

五、matlab版本及参考文献

1 matlab版本
2014a

2 参考文献
[1] 蔡利梅.MATLAB图像处理——理论、算法与实例分析[M].清华大学出版社,2020.
[2]杨丹,赵海滨,龙哲.MATLAB图像处理实例详解[M].清华大学出版社,2013.
[3]周品.MATLAB图像处理与图形用户界面设计[M].清华大学出版社,2013.
[4]刘成龙.精通MATLAB图像处理[M].清华大学出版社,2015.

【跌倒检测】基于matlab中值滤波+二值化跌倒检测【含Matlab源码 344期】相关推荐

  1. 【Matlab图像融合】小波变换遥感图像融合【含GUI源码 744期】

    一.代码运行视频(哔哩哔哩) [Matlab图像融合]小波变换遥感图像融合[含GUI源码 744期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1] 包子阳,余 ...

  2. 【Matlab人脸识别】KL变换人脸识别【含GUI源码 859期】

    一.代码运行视频(哔哩哔哩) [Matlab人脸识别]KL变换人脸识别[含GUI源码 859期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1] 蔡利梅.MAT ...

  3. 【Matlab心音信号】EMD心音信号特征提取【含GUI源码 1735期】

    一.代码运行视频(哔哩哔哩) [Matlab心音信号]EMD心音信号特征提取[含GUI源码 1735期] 二.matlab版本及参考文献 1 matlab版本 2014a *2 参考文献 [1] 沈再 ...

  4. 【Matlab语音隐写】DWT音频数字水印【含GUI源码 712期】

    一.代码运行视频(哔哩哔哩) [Matlab语音隐写]DWT音频数字水印[含GUI源码 712期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1]韩纪庆,张磊, ...

  5. 【Matlab通信】DTMF双音多频电话拨号仿真【含GUI源码 805期】

    一.代码运行视频(哔哩哔哩) [Matlab通信]DTMF双音多频电话拨号仿真[含GUI源码 805期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1] 蔡利梅 ...

  6. 【Matlab人脸识别】人脸实时检测与跟踪【含GUI源码 673期】

    一.代码运行视频(哔哩哔哩) [Matlab人脸识别]人脸实时检测与跟踪[含GUI源码 673期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1]孟逸凡,柳益君 ...

  7. 【Matlab水果识别】苹果质量检测及分级系统(带面板)【含GUI源码 1613期】

    一.代码运行视频(哔哩哔哩) [Matlab水果识别]苹果质量检测及分级系统(带面板)[含GUI源码 1613期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1 ...

  8. 【Matlab生物电信号】生物电信号仿真【含GUI源码 684期】

    一.代码运行视频(哔哩哔哩) [Matlab生物电信号]生物电信号仿真[含GUI源码 684期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1]董兵,超于毅,李 ...

  9. 【Matlab语音分析】语音信号分析【含GUI源码 1718期】

    一.代码运行视频(哔哩哔哩) [Matlab语音分析]语音信号分析[含GUI源码 1718期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1]韩纪庆,张磊,郑铁 ...

  10. 【Matlab验证码识别】遗传算法和最大熵优化+大津法(OTSU)+自定义阈值数字验证码识别【含GUI源码 1694期】

    一.代码运行视频(哔哩哔哩) [Matlab验证码识别]遗传算法和最大熵优化+大津法(OTSU)+自定义阈值数字验证码识别[含GUI源码 1694期] 二.matlab版本及参考文献 1 matlab ...

最新文章

  1. struts.xml配置文件结构
  2. 『Linux基础 - 4 』linux常用命令(1)
  3. 深入理解和应用display属性(一)
  4. 一分钟学会在Mac中如何将文件批量重命名
  5. 某合资源网4.5主题 完美无错版 emlog模板
  6. 【转】C# Socket编程笔记
  7. 我公司有个统计学的985应届(硕士)从事数据分析岗位
  8. W,b的初始化和几种激活函数
  9. 格雷码与二进制码的转换
  10. MATLAB软件安装教程
  11. 实事 | 神州十三号升空,点燃了谁的光与梦?
  12. Warbler, A Little Birdie To Introduce Your Rails App To Java
  13. 手把手教你进行Pycharm活动模板配置
  14. 我们真正痛恨的不是996,而是剥削和内卷
  15. 百度网盘限速的2个解决小办法
  16. 把linux当无线路由器用,基于树莓派的无线路由器改造
  17. kali linux2021 安装pip
  18. python嵌入式开发实战_python在嵌入式
  19. 贴片电容的封装尺寸容值解读
  20. mysql数据库多表查询教程

热门文章

  1. 微信小程序之 ----组件
  2. HDU - 2087 剪花布条(kmp)
  3. 手把手教你编写一个简单的PHP模块形态的后门
  4. spring实战笔记6---springMVC的请求过程
  5. python中字典的几个方法介绍
  6. 关联规则挖掘算法之Apriori算法
  7. 初步了解python
  8. 与程序员朋友闲聊 通用权限管理系统有啥用?
  9. 传智播客 回归问题 学习笔记
  10. github下载慢时可采用码云快速下载资源