title: Find bounding box with C# using OpenCVSharp?
body: <p>I use the <a href="https://github.com/shimat/opencvsharp" rel="nofollow noreferrer">https://github.com/shimat/opencvsharp</a> wrapper to use opencv with C#. </p>
  
  <p>Actually i would like to get the maximum bounding box of my countours. 
  Tilt is irrelevant. I would like to get a perfect straight box. </p>
  
  <p>My actual result after find contours looks like this: </p>
  
  <p><a href="https://i.stack.imgur.com/pBSqH.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pBSqH.jpg" alt="enter image description here"></a></p>
  
  <p>This is my code: </p>
  
  <pre><code>  Mat src = new Mat("index.jpg", ImreadModes.GrayScale);
    // Mat src = Cv2.ImRead("lenna.png", ImreadModes.GrayScale);
    Mat dst = new Mat();
    Mat dst2 = new Mat();
  
    Cv2.Canny(src, dst, hScrollBar1.Value, hScrollBar2.Value);
    //using (new Window("src image", src)) ;
    //using (new Window("dst image", dst)) ;
  
    // Find contours
    OpenCvSharp.Point[][] contours; //vector&lt;vector&lt;Point&gt;&gt; contours;
    HierarchyIndex[] hierarchyIndexes; //vector&lt;Vec4i&gt; hierarchy;
  
    Cv2.FindContours(dst, out contours, out hierarchyIndexes, RetrievalModes.External, ContourApproximationModes.ApproxSimple);
    using (new Window("dst image", dst)) ;
  </code></pre>
  
  <p>I saw that there is a function BoundingRect</p>
  
  <pre><code> Cv2.BoundingRect()
  </code></pre>
  
  <p>Sound correct for me. But this function requires a InputArray named curve. 
  Im a little bit confuesd. </p>
  
  <p>Would be great if someone could give me a hint. </p>
  
  <p>Thanks</p>