title: OpenCV determine area of intersect/overlap
body: <p>I am creating a stitching program using OpenCV and python and currently am stitching the images well and am now trying to blend them together. The ultimate goal will be to use a graph cut to better stitch them but for now I am just overlapping the images based on their found homography. </p>
  
  <p>Here is a photo of my current result when stitching two images.
  <a href="https://i.stack.imgur.com/snq4h.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/snq4h.jpg" alt="enter image description here"></a></p>
  
  <p>My goal is to determine the area of overlap and put it into a mask that I can apply to the top right image (that is the one on top in terms of layers) so I can blend it based on the distance using any of there blender opencv uses or another algorithm.</p>
  
  <p>Here is a visual of what I am looking for.
  <a href="https://i.stack.imgur.com/4bPPq.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/4bPPq.jpg" alt="enter image description here"></a></p>
  
  <p>Any help is appreciated.</p>