title: Count pixels of a black and white image (OpenCV / C++ )
body: <p>I am a beginner to opencv / C ++ and would like your help with a problem that seems simple. As an example, I have this image:</p>
  
  <p><img src="https://i.stack.imgur.com/Pal8w.png" alt="image example"></p>
  
  <p>... And would disregard the background, which will always be white, and the image is always black and white, leaving only the cloud to be able to count three things:</p>
  
  <ol>
  <li>The number of pixels of the figure (cloud only, disregarding the background).</li>
  <li>The number of white pixels. (cloud only)</li>
  <li>The number of black pixels. (cloud only)</li>
  </ol>
  
  <p>I know that to achieve 2, with a subtraction with it the 3rd.</p>
  
  <p>Thanks!</p>