title: Recognize open and closed shapes opencv
body: <p>how to detect open and closed shapes in opencv.</p>
  
  <p><img src="https://i.stack.imgur.com/jGgkv.png" alt="enter image description here"></p>
  
  <p>These are simple sample shapes I want to detect. I have detected rectangle using <code>findContours</code> and <code>approxPolyDP</code> and than checking for angle between vectors. </p>
  
  <p>Now I want to detect the open shape, <code>approxPolyDP</code> function has bool for closed shape set to true, and also there is a check for <code>isCounterConvex</code> on the points returned, plus <code>contourArea</code> limitation.</p>
  
  <p>Any ideas how should I go on detecting images of these kind.</p>