title: Is there any function in OpenCV to find the intersection, union and complements of two cv::Rect
body: <p>Is there any function in OpenCV to find the intersection, union and complements of two <code>cv::Rect</code>?</p>
  <p>I can write them by myself, but I hope there are some fast function in OpenCV to do this.</p>
  <p>Searching documentation, did not any function.</p>
  <h1>Edit 1</h1>
  <p>As some explained, there is no union and complements for rects, so I looked at the avaliable functions and I found that in my case, I can use</p>
  <pre><code>rect = rect1 | rect2 (minimum area rectangle containing rect1 and rect2 )
  </code></pre>
  <p>instead of union. For complement, I need a similar function that defines as:</p>
  <pre><code> rect=rect1 || rect2 (maximum area rectangle containing rect1 but not rect2 )
  </code></pre>
  <p>this is shown in the following images:</p>
  <p><img src="https://i.stack.imgur.com/s5EZj.png" alt="enter image description here" />
  <img src="https://i.stack.imgur.com/gGmu3.png" alt="enter image description here" /></p>
  <p><code>rect1</code> is yellow, <code>rect2</code> is red and result is blue.</p>
  <p>What is the fastest way to write this function?</p>