title: Edit/finetune shapes drawn by Opencv
body: <p>My requirement is to draw a rectangle on an image using program and allow the user to fine tune the length/width position with the mouse. And, get back the modified details into the program. I am using OpenCV, Linux.</p>
  
  <p>Currently I am using library function to draw the basic shape on the image</p>
  
  <p>polylines(image, &amp;p, &amp;n, 1, true, Scalar(0,0,255), 2, LINE_AA);</p>
  
  <p>I understand the shape drawn here is part of the image and not treated as a layer above the image. Harder way to achieve what I want is</p>
  
  <ul>
  <li>Highlight the shape by placing small filled circles at the corners and filling the shape by translucent color, upon mouse click</li>
  <li>track the mouse drag and move the corners accordingly to re-size the shape, if first clicked on the corner circles</li>
  <li>if clicked within, move the shape itself</li>
  </ul>
  
  <p>The program has to continuously check for mouse clicks, track their movement and keep drawing shapes at new position to give user the feedback.</p>
  
  <p>Is there any single function to achieve the same or any easier method?</p>
  
  <p>Thank you.</p>