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개)
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에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!