资源简介
MATLAB代码,用笔记本摄像头输入的一段人脸视频进行自动心率估计,主要原理是人类血液对与各种频率的光照都有一定的吸收作用,而心跳会引起皮下的毛细血管血液流量变化,从而使皮肤的颜色在心跳的作用下进行周期性的变化。
代码片段和文件信息
% face videl based pulse rate estimation
% code by Zhongqi Wang
%% open a window to obtain a video
clc; clear all; close all;closepreview;
vid = videoinput(‘winvideo‘ 1 ‘YUY2_640x480‘);
set(vid‘ReturnedColorSpace‘‘rgb‘);
vidRes=get(vid‘VideoResolution‘);
width=vidRes(1);
height=vidRes(2);
nBands=get(vid‘NumberOfBands‘);
figure(‘Name‘ ‘Matlab调用摄像头‘ ‘Numbertitle‘ ‘Off‘ ‘ToolBar‘ ‘None‘ ‘MenuBar‘ ‘None‘);
hImage=image(zeros(vidRes(2)vidRes(1)nBands));
preview(vidhImage);
% %% save the video
% videoname = ‘example1.avi‘;
% nframe = 1000;
% writerObj = VideoWriter( videoname);
% writerObj.frameRate = 30;
% open(writerObj);
%
% figure;
% for ii = 1: nframe
% frame = getsnapshot(vid);
% imshow(frame);
% f.cdata = frame;
% f.colormap =
- 上一篇:3dsmax最佳关键祯烘焙脚本
- 下一篇:lip_lqr.slx.zip
评论
共有 条评论