title: How to color a region of an image in C++?
body: <p>I would like to set all the pixels in a region of an image to the same color. I couldn't find how to do that in C++ using Opencv, if anyone can please help. I found this code in Python but it doesn't work for C++:
  It starts from the x,y coords of the region(bottom right of the image segment) up until the given x+width and y+height.</p>
  <pre><code> img[child.getX():child.getX()+child.getW(), child.getY():child.getY()+child.getH(),0]=val.B; 
   img[child.getX():child.getX()+child.getW(), child.getY():child.getY()+child.getH(),1]=val.G; 
   img[child.getX():child.getX()+child.getW(), child.getY():child.getY()+child.getH(),2]=val.R
  </code></pre>
  <p>;</p>