How to write matlab code for The 2-D correlation (correlation coefficient) between the current frame and a previous frame for 300 frames?

How to write matlab code for The 2-D correlation (correlation coefficient) between the current frame and a previous frame for 300 frames?

답변 (1개)

Adam Danz
Adam Danz 2019년 3월 7일
편집: Adam Danz 2019년 3월 28일
Assuming the frames are represented by a series of equally sized matricies, you can just loop through your frames, starting with the 2nd frame, and calculate the correlation coefficient between that frame and the previous one. Here's an example.
frames = rand(9,9,300); %fake data
nFrames = size(frames,3); %number of frames (300 for this example)
cc = zeros(1,nFrames); %allocate storage variable
for i = 2:nFrames
r = corrcoef(frames(:,:,i), frames(:,:,i-1)); % r will be a [2x2] matrix
cc(i) = r(2,1); % store the coef.
end

카테고리

도움말 센터File Exchange에서 Modify Image Colors에 대해 자세히 알아보기

질문:

2019년 3월 7일

편집:

2019년 3월 28일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by