function [img, featurelist] = mark_features_with_prob(imname, datname)
% [img, size]: image matrix and size vector(width,height, max_gray)
img = readp5(imname);
cla;
image(img);
colormap(gray(256));
axis('image');
grid on;
featurelist = read_motion_dat(datname);
featurelist(:,1:2) = featurelist(:,1:2) +1;
hold on;
for i=1:size(featurelist,1);
  if size(featurelist,2) >2 ,
     ind = floor((featurelist(i,3))*5);
     switch(ind)
     case {4,5},
       style = 'g+';
     case 3,
       style = 'r+';
     case 2,
       style = 'b+';
     case 1,
       style = 'c+';
     case 0,
       style = 'y+';
     otherwise,
       if ind < 0,
         style = 'y+';
       else
          style = 'g+';
       end
     end
  else
    style = 'r+';
  end
  plot(featurelist(i,2), featurelist(i,1),style);
end;
title('y: 0-19 c: 20-39 b: 40 - 59 r: 60-79 g: 80-');
zoom on;
return
