title: How to detect polygon in binary image
body: <p>I want to detect existence of continuous or closed polygon in binary image. The image may contain polygon of variable number of edges and also there may be no polygon at all.</p>
  
  <p><strong>Here is the positive case:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/ieRki.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ieRki.png" alt="enter image description here"></a></p>
  
  <p>And, </p>
  
  <p><strong>this one is negative case:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/9DaoT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9DaoT.png" alt="enter image description here"></a></p>
  
  <p>Is there any method in image processing or some algorithm to detect continuous polygon ?</p>
  
  <p>Any kind of help is appreciated.</p>