function saveimage(D,fn)
% saveimage(D,filename)
%
% saves the image in the column vector D as filename (in .bmp format)

h = 376;
w = 271;
% change to the following if you use the renoir dataset
%h = 321;
%w = 341;
D = D-min(D);
D = D/max(D);
D = reshape(D,h,w,3);
imwrite(D,fn,'BMP');
