how to do the sum of pixels with Python and OpenCV
np.sum(img[y1:y2, x1:x2, c1:c2]) Where c1 and c2 are the channels.
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?