matlab报警软件,基于matlab的视频监控(出现物体就报警)

视频监控,如果有东西经过监控区域就语音报警(somethingisintruding)

视频监控:

一般就是摄像头不动,如果有东西经过就进行报警。

一般有两种方法:

1、事先采集好没有东西的背景图像,然后实时监测时利用做差的原理,这样的准确率很高,可以很好的定位,但是需要事先搞到一个标准图像

2、就是本程序使用的方法:利用帧之间做差的方法:

条件:你的计算机含有摄像头……

纯m文件进行编程……

具体如下所示:如果有东西经过摄像头就进行语音报警:somethingisintruding并且人机界面变为红色,并将经过者拍摄下来保存,没有的话灰色正常显示……直接运行里面的intruderdetecting.m函数即可。

其中子程序:getCameraInfo用于得到你的摄像头信息,子程序:tts用于语音播放:somethingisintruding

需要注意的地方:经过者速度不能太快……需要进一步改正……

可以进行的进一步研究:可以讲声音加入,如果有声音波动的话,也可以进行报警期待大家多提意见啊……

可以搞成语音监测的,如果有人发出声音,也可以进行报警……

a4c26d1e5885305701be709a3d33442f.png

a4c26d1e5885305701be709a3d33442f.png

a4c26d1e5885305701be709a3d33442f.png

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
菜鸟提问基于MATLAB的防盗报警系统的有关问题-voice.m 话不多说,之前有人做出视频防盗系统,详见此贴。 原来的一个版本:视频监控,有东西经过监控区域就报警: 贴子如下: https://www.ilovematlab.cn/thread-133835-1-1.html 后来又有人加上了声音报警系统。声音过大就会报警。 详见此贴 声音监控,有东西发出声音就进行报警 https://www.ilovematlab.cn/thread-133881-1-1.html 。。 然后就是我们有个大作业,我想到的是将两者结合在一起,在视频监控的同时,如果声音过大就进行报警,然后拍照(要是能把照片发到邮箱就好了)。 以下是我的修改,但是一直报错。希望有人能帮忙修改下实现上面的功能。 代码贴出: function intruderdetecting2 % 运动参数阈值 motionThreshold = 200;         %  0 ~ 255 secondsToRecord = 10; % 声音参数阈值 soundThreshold = 0.1;         % 0.0 ~ 1.0 %声音麦克风 ai = analoginput; addchannel; set; set; set; samplesToRecord = ceil; set; set; set; set; %启动摄像头 a = imaqhwinfo; [camera_name, camera_id, format] = getCameraInfo; vid = videoinput; set; set; triggerconfig; start; trigger; try     wait; catch     stop; end %启动函数,时间函数 set; set; set; %创建figure fig = figure('DoubleBuffer','on', ...     'Name', 'Intruder Detection', ...     'NumberTitle', 'off', ...     'WindowStyle', 'docked', ...     'Toolbar', 'none', ...     'MenuBar', 'none', ...     'Color',[.1 .1 .1], ...     'CloseRequestFcn', @figureCloseFcn, ...     'DeleteFcn', @figureDeleteFcn); %对界面初始化 timePrevious = []; start; imagePrevious = []; start; %视频的启动函数     function videoStartFcn             imagePrevious = getsnapshot;     end %声音启动函数     function soundStartFcn             timePrevious = now;     end %视频时间函数         function videoTimerFcn         try             imageCurrent = getsnapshot;             timeCurrent = now;         catch             % getsnapshot can fail if object is deleted while we are waiting.             return;         end samplesRequested = ceil * *... ai.SampleRate); warning; try sound = peekdata; catch sound = zeros); end warning; sound = sound - mean); % Center about the mean. soundMax = max)); % Calculate max deviation from mean. timePrevious = timeCurrent; % Make our figure current. figOld = get; %if fig ~= figOld %set; %end %plot;         imageDifference = abs;         imageMax = max);         imagePrevious = imageCurrent;         figOld = get;         if fig ~= figOld             set;         end         image;         label = datestr;         xlabel;         set;         if imageMax > motionThreshold             motion = true;         else             motion = false;         end         if ~islogging             % 如果有东西闯入,进行响应             if motion                 % 将figure变红                 set;                 % 将闯入者的视频发送到你的邮箱                 str=['SB.jpg'];                 imwrite; %保存拍下来的图像                 customIntruderAction();             else                 set;             end;         end     if ~islogging    % if noise       customIntruderAction();%有人闯入时发进行报警         if fig ~= figOld             set;         end    % end     end    %function customIntruderAction()      % [y,fs]=wavread;      % sound; end     function figureCloseFcn         %关闭视频和声音         try             stop;             stop;         catch         end         closereq;     end     function figureDeleteFcn         delete;         delete;     end end 纯M文件编程。
菜鸟提问基于MATLAB的防盗报警系统的有关问题-sounddetection.m 话不多说,之前有人做出视频防盗系统,详见此贴。 原来的一个版本:视频监控,有东西经过监控区域就报警: 贴子如下: https://www.ilovematlab.cn/thread-133835-1-1.html 后来又有人加上了声音报警系统。声音过大就会报警。 详见此贴 声音监控,有东西发出声音就进行报警 https://www.ilovematlab.cn/thread-133881-1-1.html 。。 然后就是我们有个大作业,我想到的是将两者结合在一起,在视频监控的同时,如果声音过大就进行报警,然后拍照(要是能把照片发到邮箱就好了)。 以下是我的修改,但是一直报错。希望有人能帮忙修改下实现上面的功能。 代码贴出: function intruderdetecting2 % 运动参数阈值 motionThreshold = 200;         %  0 ~ 255 secondsToRecord = 10; % 声音参数阈值 soundThreshold = 0.1;         % 0.0 ~ 1.0 %声音麦克风 ai = analoginput; addchannel; set; set; set; samplesToRecord = ceil; set; set; set; set; %启动摄像头 a = imaqhwinfo; [camera_name, camera_id, format] = getCameraInfo; vid = videoinput; set; set; triggerconfig; start; trigger; try     wait; catch     stop; end %启动函数,时间函数 set; set; set; %创建figure fig = figure('DoubleBuffer','on', ...     'Name', 'Intruder Detection', ...     'NumberTitle', 'off', ...     'WindowStyle', 'docked', ...     'Toolbar', 'none', ...     'MenuBar', 'none', ...     'Color',[.1 .1 .1], ...     'CloseRequestFcn', @figureCloseFcn, ...     'DeleteFcn', @figureDeleteFcn); %对界面初始化 timePrevious = []; start; imagePrevious = []; start; %视频的启动函数     function videoStartFcn             imagePrevious = getsnapshot;     end %声音启动函数     function soundStartFcn             timePrevious = now;     end %视频时间函数         function videoTimerFcn         try             imageCurrent = getsnapshot;             timeCurrent = now;         catch             % getsnapshot can fail if object is deleted while we are waiting.             return;         end samplesRequested = ceil * *... ai.SampleRate); warning; try sound = peekdata; catch sound = zeros); end warning; sound = sound - mean); % Center about the mean. soundMax = max)); % Calculate max deviation from mean. timePrevious = timeCurrent; % Make our figure current. figOld = get; %if fig ~= figOld %set; %end %plot;         imageDifference = abs;         imageMax = max);         imagePrevious = imageCurrent;         figOld = get;         if fig ~= figOld             set;         end         image;         label = datestr;         xlabel;         set;         if imageMax > motionThreshold             motion = true;         else             motion = false;         end         if ~islogging             % 如果有东西闯入,进行响应             if motion                 % 将figure变红                 set;                 % 将闯入者的视频发送到你的邮箱                 str=['SB.jpg'];                 imwrite; %保存拍下来的图像                 customIntruderAction();             else                 set;             end;         end     if ~islogging    % if noise       customIntruderAction();%有人闯入时发进行报警         if fig ~= figOld             set;         end    % end     end    %function customIntruderAction()      % [y,fs]=wavread;      % sound; end     function figureCloseFcn         %关闭视频和声音         try             stop;             stop;         catch         end         closereq;     end     function figureDeleteFcn         delete;         delete;     end end 纯M文件编程。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值