The code is for video processing in MATLAB and I have a problem in the first loop. I do not know what the problem is but the error that MATLAB gives is :
Assignment has more non-singleton rhs dimensions than non-singleton subscripts
Error in fi
(line 34)
data(:,:,f) = I;
Here is my code:
clc;
close all;
clear all;
It1c = imread( '\icnas1.cc.ic.ac.ukfi15DesktopframesFrames_V1151.png' );
It600c = imread( '\icnas1.cc.ic.ac.ukfi15DesktopframesFrames_V1109.png' );
resf = 0.27e-6;
fr_r = 12000; %frame rate = 12000 fps
figure();
imagesc(It1c);
figure();
imagesc(It600c);
listing = dir('\icnas1.cc.ic.ac.ukfi15DesktopframesFrames_V11*.png');
N = 51;
data = zeros(624,1024,N);
for f = 1:N,
f
I = imread(['Frames_V11',fullfile(listing(f).name)] );
data(:,:,f) = I;
end
figure; %see frames
for i = 1:N,
imagesc(data(:,:,i));
colorbar;
pause(0.1);
end
figure; %see frames
for i = 1:N,
imagesc(data(:,:,i)-data(:,:,1));
colorbar;
pause(0.1);
end
for i = 1:N,
i
data2(:,:,i) = data(:,:,i)-data(i);
end
figure; %see frames
for i = 1:N,
imagesc(data2(:,:,i));
colorbar;
pause(0.1);
end
figure;
imagesc(squeeze( mean(data2(230:270,:,:),1) ));
figure;
plot(squeeze(mean(mean(data5(210:235,395:425,:),1),2)));
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…