function vec=img2vec(img)
  [h,w]=size(img); m=h*w;
  vec=zeros(m,1);
  vec=double(reshape(img,m,1))/255.;
endfunction;