title: How to detect white blobs using OpenCV
body: <p>I paint a picture to test:
  <img src="https://i.stack.imgur.com/ogfzm.jpg" alt="enter image description here"></p>
  
  <p>And I want to know how much blobs I have in the black circle and what is the size of each blobs (all blobs are ~white).</p>
  
  <p>For example, in this case I have 12 spots:
  <img src="https://i.stack.imgur.com/4oqF9.jpg" alt="enter image description here"></p>
  
  <p>I know how to found white pixels and it easy to verify sequence from left:</p>
  
  <pre><code>int whitePixels = 0;
  for (int i = 0; i &lt; height; ++i)
  {
      uchar * pixel = image.ptr&lt;uchar&gt;(i);
      for (int j = 0; j &lt; width; ++j)
      {
          if (j&gt;0 &amp;&amp; pixel[j-1]==0)   // to group pixels for one spot
              whitePixels++;
      }
  }
  </code></pre>
  
  <p>but it's clear that this code is not good enough (blobs can be diagonally, etc.).</p>
  
  <p>So, the bottom line, I need help: how can I define the blobs?</p>
  
  <p>Thank you</p>