function [ EPat, W ] = PatEstimation( NL_mat, Self_arr, Sigma_arr, CurPat, Par )
        Par.c= sqrt(2);
        EPat = zeros(size(CurPat));
        W    = zeros(size(CurPat));
        for  i      =  1 : length(Self_arr)                                 % For each keypatch group
            Temp    =   CurPat(:, NL_mat(1:Par.inner_patnum,i));                  % Non-local similar patches to the keypatch
            M_Temp  =   repmat(mean( Temp, 2 ),1,Par.inner_patnum);
%             M_Temp  = zeros(size(Temp));
            Temp    =   Temp-M_Temp;
            E_Temp 	=   WNNM( Temp, Par.c, Sigma_arr(Self_arr(i))) + M_Temp; % WNNM Estimation
            EPat(:,NL_mat(1:Par.inner_patnum,i))  = EPat(:,NL_mat(1:Par.inner_patnum,i)) + E_Temp;      
            W(:,NL_mat(1:Par.inner_patnum,i))     = W(:,NL_mat(1:Par.inner_patnum,i))+ones(Par.inner_patsize*Par.inner_patsize,size(NL_mat(1:Par.inner_patnum,i),1));
        end
end

