title: Create a 1bpp (bit per pixel) image in OpenCV with C++
body: <p>I am trying to create a 1bpp image (1 bit per pixel) mask in C++ for a project, however I am stuck on how I can do this with OpenCV?</p>
  
  <p>The code I am trying with is: </p>
  
  <pre><code>int WIDTH=640; int HEIGHT=480;
  Mat mask = Mat::zeros( cv::Size( WIDTH, HEIGHT ), CV_8UC1 );
  mask( Rect( 50,50,100,100 ) ) = 1;
  </code></pre>
  
  <p>I am not sure if this is the right way to create a 1 bpp mask though. Does anyone know if this is possible using OpenCV or in C++ at all?</p>