title: OpenCV: Invert a mask?
body: <p>Is there a simple way to invert a mask using OpenCV? For example, if I've got a mask like this:</p>
  
  <pre><code>010
  111
  010
  </code></pre>
  
  <p>I'd like to invert it and get this:</p>
  
  <pre><code>101
  000
  101
  </code></pre>
  
  <p>Note: I'm using OpenCV's Python bindings, so while it would be <em>possible</em> to simply loop over each element in the mask, execution speed could become an issue.</p>