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 ExchangeModify 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