title: Understanding region of interest in openCV 2.4
body: <p>I know that in OpenCV 2.1 we had a function to set ROI: cvSetImageROI(), but such a function does not exist in 2.4 (or at least I cant find it in its manuals and help section.)</p>
  
  <p>however here is the only helpful code I could find which uses opencv 2.4 for mage ROI, but I am having trouble understanding it:</p>
  
  <pre><code>// define image ROI
  cv::Mat imageROI;
  imageROI= image(cv::Rect(385,270,logo.cols,logo.rows));
  // add logo to image 
  cv::addWeighted(imageROI,1.0,logo,0.3,0.,imageROI);
  </code></pre>
  
  <p>Here they want to add a very small log to a big image at the bottom right of the original image.</p>
  
  <p>So what I understand from here is that another matrix is created to hold the ROI. Its dimensions given using the rect function, and size is given equal to that of the small logo they want to add. </p>
  
  <p>Then thsi is what confuses me: <code>cv::addWeighted(imageROI,1.0,logo,0.3,0.,imageROI);</code> here the source 1 of addWeighted is the ROI dimensions set, source 2 is the logo and the destination is also the ROI dimensions set. Is this correct? or am I missing something?</p>
  
  <p>After this the result is shown with the logo added to the big image. Where in these commands was the big image included.</p>
  
  <p>Also before asking here I wanted to try the code myself to maybe help clarify the situation. but I get this error, as the image() is not recognized: <code>'image': identifier not found</code></p>
  
  <pre><code>int _tmain(int argc, _TCHAR* argv[])
  {
  Mat src1, imageROI, logo;
  
  logo = imread("c:\\car1.jpg", -1);
  
  imageROI= image(Rect(385,270,logo.cols,logo.rows));
  
  addWeighted(imageROI,1.0,logo,0.3,0.,imageROI);
  
  
  namedWindow("meh", CV_WINDOW_AUTOSIZE);
  imshow("meh", imageROI);
  waitKey(0);
  
  
  return 0;
  </code></pre>
  
  <p>}</p>