title: OpenCV: how to find pixels within a polygon?
body: <p>Suppose we're working on binary images with black the foreground and white the background.
  Is there any efficient way of finding black pixels with in a polygon, which is specified by a list of vertex coordinates?</p>
  
  <p>Computing a bounding box from a polygon is NOT ideal because there can be many closely displaced polygons whose bounding boxes may overlap. </p>
  
  <p>Of course, the brute force way will be finding black pixels from an entire image first, and then running the polygon test for each black pixel, which is too time-consuming for the task.</p>
  
  <p>Any suggestions are welcome!</p>
  
  <p>Thank you!</p>