function [h,ind,population,m]=initiate_de(I,k,np)
ima=double(I);
copy=ima;         % make a copy
ima=ima(:);       % vectorize ima
mi=min(ima);      % deal with negative 
ima=ima-mi+1;     % and zero values
s=length(ima);

% create image histogram

m=max(ima)+1;
h=zeros(1,m);
hc=zeros(1,m);

for i=1:s
  if(ima(i)>0) h(ima(i))=h(ima(i))+1;end;
end
ind=find(h);
hl=length(ind);

% initiate centroids

%mu=(1:k)*m/(k+1);
population=zeros(np,k);
%population(:,1:k)=rand(np,k);
for i=1:np
    for cc=1:k
        population(i,cc)=mi+rand(1)*(m-mi);
    end
end