function movie = ps0movie(img1,img2,bkimg,fv1,fv2,frames)
frame = 1;
sequence = [];
bkimgp = picpermute(bkimg);
for alpha=0:(1.0/frames):1,
    img = morph(img1,img2,fv1,fv2,alpha);
    
    nans = isnan(img);
    img(nans) = 0;
    
    bkpix = img1([1:350],[1:241],:);
    bkpixp = picpermute(bkpix);
    bkmean = mean(bkpixp);
    bkcov=cov(bkpixp);
   
    smp = picpermute(img);
    bkidx = find(mahanoboulis(smp,bkmean,bkcov)<200);
    smp(bkidx,:,:) = bkimgp(bkidx,:,:); 
    img = unpicpermute(smp,img);    
   
    %max(img)
    %max(max(img))
    %maximgg = max(max(max(img)))
    %minimgg = min(min(min(img)))
    %size(img)
    %im2frame(img,colormap)
    sequence(:,:,:,frame) = img; % /(max(max(max(img))));
    
   % figure(frame);
   % imagesc(img);
    frame = frame + 1;
    
end;

movie = images2movie(sequence);