title: how to do the sum of pixels with Python and OpenCV
body: <p>I have an image and want to find the sum of a part of it and then compared to a threshold.
  I have a rectangle drawn on the image and this is the area I need to apply the sum.
  I know the cv2.integral function,  but this gives me a matrix as a result. Do you have any suggestion?</p>