title: How to get the area of the contours?
body: <p>I have a picture like this:<br>
  <a href="https://i.stack.imgur.com/CZPYN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CZPYN.jpg" alt="origin picture"></a></p>
  
  <p>And then I transform it into binary image and use canny to detect edge of the picture:  </p>
  
  <pre><code>gray = cv.cvtColor(image, cv.COLOR_RGB2GRAY)
  edge = Image.fromarray(edges)
  </code></pre>
  
  <p>And then I get the result as:<br>
  <a href="https://i.stack.imgur.com/YMMEE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YMMEE.jpg" alt="edge pic"></a><br>
  I want to get the area of 2 like this:<br>
  <a href="https://i.stack.imgur.com/K7RBZ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/K7RBZ.jpg" alt="enter image description here"></a></p>
  
  <hr>
  
  <p>My solution is to use HoughLines to find lines in the picture and calculate the area of triangle formed by lines. However, this way is not precise because the closed area is not a standard triangle. How to get the area of region 2?</p>