Hello.
I wanna centering an image (image 1 to image 2)
image 1 image 2
I got the image 1 from this code.
clear allclose all%// read the video:
reader = VideoReader('lena_side.avi');vid = {};while hasFrame(reader) vid{end+1} = im2single(readFrame(reader));end%// simple background estimation using mean:
bg = mean( cat(4, vid{:}), 4);%// estimate foreground as deviation from estimated background:
fIdx = 40; %// do it for frame 43
fg1 = sum( abs( vid{fIdx} - bg ), 3 ) > 0.25;figure;subplot(141); imshow( bg ); subplot(142); imshow( fg1 );
Best Answer