matlab中,实现一段视频中两帧为一组,前后两帧相减的程序该怎么写?
1个回答
展开全部
function [Diff,FrameTeam] = FrameProcess(VedioFrame,FrameNum)
FrameTeam = cell(1,FrameNum-1);
Diff = cell(1,FrameNum-1);
for i = 1:FrameNum-1
FrameTeam{i} = cat(3,VedioFrame(:,:,i),VedioFrame(:,:,i+1)); %两帧为一组
Diff{i} = FrameTeam(:,:,1)-FrameTeam(:,:,2); %前后两帧相减
end
end
FrameTeam = cell(1,FrameNum-1);
Diff = cell(1,FrameNum-1);
for i = 1:FrameNum-1
FrameTeam{i} = cat(3,VedioFrame(:,:,i),VedioFrame(:,:,i+1)); %两帧为一组
Diff{i} = FrameTeam(:,:,1)-FrameTeam(:,:,2); %前后两帧相减
end
end
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询