Drawing filled polygon using mouse events in open cv using python
<p>I am trying to draw a polygon between the coordinates which would be obtained by clicking by mouse events.</p>

<p>The first click should define the starting point of the polygon. Each additional click should sketch a line segment from the previous click. When whole clicked points sketch the polygon, inside of the polygon should be filled.</p>

<p>Can someone please suggest how to draw polygons between the points I click on the image? I am considering <code>cv2.polylines</code> function, however I have no idea how to integrate that with <code>SetMouseCallback</code> function.</p>