Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Matlab 从视频信号中寻找头部偏航运动的持续时间_Matlab_Signal Processing - Fatal编程技术网

Matlab 从视频信号中寻找头部偏航运动的持续时间

Matlab 从视频信号中寻找头部偏航运动的持续时间,matlab,signal-processing,Matlab,Signal Processing,我需要找到头部偏航运动的持续时间。头部跟踪是 从跟踪每帧头部运动的视频文件中获取。 例如,下面绘制的信号有三个头部偏航运动。 有没有办法找出矩形中信号变化的持续时间 偏航信号: 我使用了SG过滤器并找到了峰值,但它给出了许多不相关的峰值,如图所示: order =4 ; framelen =11; x=yaw_deg; lx = 20; sgf = sgolayfilt(x,order,framelen); plot(sgf); grid on; hold on; sgf=-sgf;

我需要找到头部偏航运动的持续时间。头部跟踪是 从跟踪每帧头部运动的视频文件中获取。 例如,下面绘制的信号有三个头部偏航运动。 有没有办法找出矩形中信号变化的持续时间

偏航信号:

我使用了SG过滤器并找到了峰值,但它给出了许多不相关的峰值,如图所示:

order =4 ;
framelen =11;
x=yaw_deg;
lx = 20;


sgf = sgolayfilt(x,order,framelen);


plot(sgf);
grid on;

hold on;
sgf=-sgf;
[pks_smoothed,locs_smoothed,widths_smoothed,proms_smoothed] = findpeaks(sgf ,'MinPeakProminence',0.009);
pks_smoothed = -pks_smoothed;
plot(locs_smoothed,pks_smoothed,'g*');
text(locs_smoothed+.02,pks_smoothed,num2str((1:numel(pks_smoothed))'));

如果您正在寻找快速解决方案,并且拥有信号处理工具箱,则可以使用该函数。使用各种参数可以识别峰值

inv_signal = -signal;
[pks,locs,w] = findpeaks(inv_signal,'MinPeakWidth',...,'MinPeakProminence',...);