title: efficient way of counting pixels in a contour
body: <p>Given a contour, what is the efficient way of counting the pixels that belong inside the contour?  </p>
  
  <p>I tried using <strong>opencv</strong> function<br>
      cv::pointPolygonTest()  </p>
  
  <p>but the function is highly inefficient and takes a lot of time for bigger contours.<br>
  Please advice </p>