function  [Y, SigmaArr]  =  Im2Patch( E_Img, par )
TotalPatNum = (size(E_Img,1)-par.inner_patsize+1)*(size(E_Img,2)-par.inner_patsize+1);                  %Total Patch Number in the image
Y           =   zeros(par.inner_patsize*par.inner_patsize, TotalPatNum, 'single');                      %Current Patches
k           =   0;

for i  = 1:par.inner_patsize
    for j  = 1:par.inner_patsize
              k     =  k+1;
        E_patch     =  E_Img(i:end-par.inner_patsize+i,j:end-par.inner_patsize+j);
        Y(k,:)      =  E_patch(:)';        
    end
end

[Noise_level, ~] = NoiseLevel(E_Img);
if par.nSig<20
    SigmaArr  =  repmat(1.5+Noise_level,1,TotalPatNum);
else
    SigmaArr  =  repmat(2.5+Noise_level,1,TotalPatNum);
end
 