title: Extracting the cordinates of rectangles
body: <p>I have written a code to locate rectangle from an image (where I can draw the rectangular shapes on the image itself). What I want to do right now is to get the cordinates of the rectangular shaped objects on the image. I am using the Rectangle class to get the rectangle information. Is there a way I could do this?</p>
  
  <p>this is the code im using</p>
  
  <pre><code>private void ProcessBW(Bitmap bitmap)
  {
  BlobCounter blobCounter = new BlobCounter();
  
  blobCounter.FilterBlobs = true;
  //blobCounter.MinHeight = 6;
  //blobCounter.MinWidth = 6;
  
  blobCounter.ProcessImage(bitmap);
  
  // create Image Object using rear image byte[]
  System.Drawing.Image imageR = (System.Drawing.Image)bitmap;
  
  // Derive BitMap object using Image instance, so that you can avoid the issue
  //"a graphics object cannot be created from an image that has an indexed pixel format"
  Bitmap img = new Bitmap(new Bitmap(imageR));
  
  Rectangle[] rects = blobCounter.GetObjectsRectangles();
  //Graphics object to draw
  Pen pen = new Pen(Color.Red, 2);
  Graphics g = Graphics.FromImage(img);                  
  
  foreach (Rectangle rect in rects)
  {
      g.DrawRectangle(pen, rect);
  }
  pictureBox1.Image = img;
  pen.Dispose();
  g.Dispose();
  }
  </code></pre>
  
  <p>Thank you</p>