Hi, my image result for mhi is bcome white and can't get any info from it. Could someone tell me what wrong is it? Thank you.
clear allv = VideoReader('C:\Users\User\Desktop\FYP\MyMovie.avi');ii = 1;while hasFrame(v) video = readFrame(v);endfor i=1:134% keyboard
data(:,:,i)=mean(readFrame(Video));end% data = uint8(255 * data);
MHI = data; % Define MHI parameter T
T = size(data,3)+20; % # of frames being considered; maximal value of MHI
% Load the first frame
frame1 = data(:,:,1); % Compute H(x,y,1,T) (the first MHI)
fst = MHI(:,:,1); fst(fst>0) = T; MHI(:,:,1) = fst; % start global loop for each frame
for frameIndex = 2 : size(data,3) %fprintf('Loading frame Index %d\n',frameIndex);
% Load current frame from image array
frame = data(:,:,frameIndex); frame_pre = MHI(:,:,frameIndex-1); %%ORIGINAL CODE
% Begin looping through each point
%{ for y = 1 : y_max for x = 1 : x_max if (frame(y,x) > 0) MHI(y,x,frameIndex) = T; else if(MHI(y,x,frameIndex-1)>1) MHI(y,x,frameIndex) = MHI(y,x,frameIndex-1) - 1; else MHI(y,x,frameIndex) = 0; end end end end %} %%END OF ORIGNAL CODE
MHI(:,:,frameIndex) = frame_pre - 1; % Set of all non-zero value to T
frame(frame > 0) = T; [y,x] = find(frame > 1); for i = 1 : size(y,1) MHI(y(i,:), x(i,:), frameIndex) = frame(y(i,:), x(i,:)); end end figure, imshow(MHI(:,:,134),[])
Best Answer