title: Hand detection using OpenCV
body: <p>I am using the OpenCV library for an image processing project to detect hands. I initialized the image in <code>iplimage</code>, colored it, and then converted it to HSV with <code>cvCvtColor(imageHand,imageHand,CV_BGR2HSV );</code>
  I don't know the efficient algorithm so that's my problem. Please check my code: </p>
  
  <pre><code>for( int row = 0; row &lt; imageHand-&gt;height; row++ )
  {
      for ( int col = 0; col &lt; imageHand-&gt;width; col++ )
      {
         h =(imageHand-&gt;imageData[imageHand-&gt;widthStep * row + col * 3]) ;
      s = (imageHand-&gt;imageData[imageHand-&gt;widthStep * row + col * 3 + 1]);
      v = (imageHand-&gt;imageData[imageHand-&gt;widthStep * row + col * 3 + 2]);
  
           if(  h&gt;85)
           {
       imageHand-&gt;imageData[imageHand-&gt;widthStep * row + col * 3 ]     = 0 ;
       imageHand-&gt;imageData[imageHand-&gt;widthStep * row + col * 3 + 1 ] =0 ;
       imageHand-&gt;imageData[imageHand-&gt;widthStep * row + col * 3 + 2 ] = 0 ;
           }
           else
           {
           imageHand-&gt;imageData[imageHand-&gt;widthStep * row + col * 3 ]     = 255 ;
       imageHand-&gt;imageData[imageHand-&gt;widthStep * row + col * 3 + 1 ] = 255 ;
           imageHand-&gt;imageData[imageHand-&gt;widthStep * row + col * 3 + 2 ] = 255 ;
  
           }
  
  
       }
  }
  </code></pre>
  
  <p>I think the range of the searched <code>h</code> is <code>&gt; 85</code>!? 
  If you know a better algorithm than please guide me.</p>