function prior = eMakePrior(hei, wid);

%Input the prior size
%Output an image prior, energy

N = sqrt(hei*wid);
chei = floor(hei/2); cwid = floor(wid/2);

% strImg = 'images\1.jpg';
% f0 = im2double(imread(strImg));
% f0 = f0(1:hei, 1:wid);

F02 = 0;
count = 0;
for kk = 1:7
    strImg = ['images\', num2str(kk), '.jpg'];
    f0 = im2double(imread(strImg));
    f0 = [f0, f0; f0, f0];
%     f0 = f0(1:hei, 1:wid);
    for ii = 1:hei:401
        for jj = 1:wid:401
            t = f0(ii:ii+hei-1, jj:jj+wid-1);
            F0 = fft2(t);
            F02 = F02+F0.*conj(F0);
            count = count+1;
        end;
    end;
end;
prior = F02/count;
