title: How to find mean value for a given part of an Image
body: <p>I have "n" number of contour detected images(frame). I wants to find mean value for the rectangle portion of that image. <br> (Instead of finding mean value for a full image, i need to calculate the mean value for the rectangle portion of that image.)<br>
  <img src="https://i.stack.imgur.com/VrON4.png" alt="enter image description here"><br>
  <img src="https://i.stack.imgur.com/oO49l.png" alt="enter image description here"><br>
  I have rectangle's x,y position and width, height values. First Image x,y,w,h is 109,45 ,171,139 and second image x,y,w,h is 107,71,175,110. <br><br>I get the values using the below code. <br><code>cv2.rectangle(frame, (x,y),(x+w,y+h), (0,0,255), 3)</code> <br> I know using "ROI" concept we can do mean calculation. <br>So, I referred some links. <br>Ex. <a href="https://stackoverflow.com/questions/21486202/get-the-roi-of-two-binary-images-and-find-difference-of-the-mean-image-intesitie">Get the ROI of two binary images and find difference of the mean image intesities between 2 ROI in python</a>. <br><br>But, I have confused with the parameter settings. Can anyone help me to resolve my problem ? Thanks in advance...</p>