title: how does copyTo in opencv c++ works?
body: <p>I have gone through the below snippet and was wondering how <code>copyTo() in opencv</code> function work.</p>
  
  <pre><code> // Make a copy
   Mat faceWithGlassesNaive1 = faceImage.clone();
   // Take the eye region from the image
   Mat roiFace =  faceWithGlassesNaive1(Range(150,250),Range(140,440));
   // Replace the eye region with the sunglass image
   glassBGR.copyTo(roiFace);
  </code></pre>
  
  <p>Does <code>copyTo()</code> work on <code>copyByreference</code>, so that any modifications done to <code>roiface</code> gets reflected in <code>faceWithGlassesNaive1</code>? Or Am i missing something ?. Need help .</p>
  
  <ol>
  <li>Below is the faceimage</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/H6O6W.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/H6O6W.jpg" alt="faceimage"></a></p>
  
  <ol start="2">
  <li><p>Below is the glassBGR Image 
  <a href="https://i.stack.imgur.com/8hMVL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8hMVL.png" alt="enter image description here"></a></p></li>
  <li><p>Below is the output of <code>glassBGR.copyTo(roiFace)</code> from the above snippet
  <a href="https://i.stack.imgur.com/QJrdT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QJrdT.png" alt="enter image description here"></a></p></li>
  </ol>