title: find fingertips and valley point of hand in MATLAB
body: <p>I am working on palm print identification by palm texture and geometry. 
  During the preprocessing step I want to detect fingertips and valley points of the hands. First we must find reference point for the trace bounding integer, after that find valley and fingertips point.</p>
  
  <p>I was wondering if someone is able to help me.</p>
  
  <p>This is my code:</p>
  
  <pre><code>I=imread(palm.jpg);
  I=I(:,:,1);
  h = fspecial('disk',30);
  s = imfilter(I,h,'symmetric');
  I1=s(:,:,1)&gt;79;
  I4=edge(I1,'canny');
   %% find refrense point
   s=size(I4);
   r=[0,0];
    for row=s(1):-1:1
          for col=1:s(2)
              if I4(row,col)==1
                  r=[row,col];
                  break
              end
  
          end
          if I4(row,col)==1
              r=[row,col];
              break
          end
      end
   b = bwtraceboundary(I4,[row col],'NW',8);
  </code></pre>