title: Finding coordinates of point closed by rectangle
body: <p>Let say I have this image</p>
  <p><a href="https://i.stack.imgur.com/UNcDW.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UNcDW.jpg" alt="image" /></a></p>
  <p>The datapoint already detected and closed by the rectangle shape, as you can see in the figure. Now, I would like to find the coordinates of these rectangles and label them based on datapoint colours and saved them in CSV file.</p>
  <p>For example, if the 1st image is in blue then I would like output something like this in CSV file</p>
  <pre><code>top, bottom, width, length, colour
     a      b     c        d    Blue
    
  </code></pre>
  <p>I want these values for each data point marked by the rectangle shape so that I can get the location of each data points. U can expect to have may data points for the given image, this just an example.</p>
  <p>Any idea of how to do this? thanks in advance.</p>