title: Modifying a cv::Rect inside a cv::Mat in C++
body: <p>I'm pretty new to openCV and would like to ask what seems like a easy question.<br />
  I have an image in the form of a <code>cv::Mat</code> and I would like to change only a small part of the matrix. I've read that using a <code>cv::Rect</code> is the correct way but I can't seem to find a way to only modify that little ROI.</p>
  <p>Here's the code:</p>
  <pre class="lang-cpp prettyprint-override"><code>cv::Mat img = cv::Mat::zeros(msg-&gt;height, msg-&gt;width, CV_64FC1);
  cv::Rect rect(100, 100, 20, 50);
  </code></pre>
  <p>All I want to do is do linear tranformation to the <code>rect</code> and add asign it to the same part of the img.</p>
  <p>Something like:</p>
  <pre class="lang-cpp prettyprint-override"><code>int a=0.1, b=20;
  rect = rect*a + b;
  </code></pre>
  <p>Thanks in advance.</p>