here the process i used:
- get each frames pixel and normalize to 255
- Convert it to gray scale
- subtract pixels from previous pixels (previous post subtracted images)
- show each image in a sequence
heres the code:
clear all
close all
clc;
disp('Testing Purposes Only....');
fin = 'smallVersion.avi';
avi = aviread(fin);
% Convert to RGB to GRAY SCALE image.
avi = aviread(fin);
pixels = double(cat(4,avi(1:2:end).cdata))/255; %get all pixels (normalize)
nFrames = size(pixels,4); %get number of frames
for f = 1:nFrames
pixel(:,:,f) = (rgb2gray(pixels(:,:,:,f))); %convert images to gray scale
end
nrames=f;
for l = 2:nrames
%d(:,:,l)=(abs(pixel(:,:,l)-pixel(:,:,1))); %subtract current pixel from background
z(:,:,l)=(abs(pixel(:,:,l)-pixel(:,:,l-1))); %subtract current pixel from previous pixel
%imshow(d(:,:,l));
imshow(z(:,:,l));
hold on
drawnow;
hold off
end
Results:
Image 1: Frame subtracted from Background or first frame (overlaps)
Image 2: Frame subtracted from previous Frame
nice write up. Convert image to Blurry Background using GIMP.
ReplyDeletehi, I would like to discuss my project with you if you are available.
ReplyDelete