title: OpenCv: How to save Mat::Rect into file?
body: <p>I capture camera image into image. I select the object from image and i track the object. But I want to save the selection into file because I dont want select the object every time.
  This is my selection part;</p>
  
  <pre><code>Mat image;
  Rect selection;
  
  selection.x = MIN(x, origin.x);
  selection.y = MIN(y, origin.y);
  selection.width = abs(x - origin.x);
  selection.height = abs(y - origin.y);
  selection &amp;= Rect(0, 0, image.cols, image.rows);
  </code></pre>
  
  <p>How can I save selection or How can I select the object for the first time?
  Thank you</p>