how to do the sum of pixels with Python and OpenCV
sumElems function in OpenCV will help you to find out the sum of the pixels of the whole of the image in python. If you want to find only the sum of a particular portion of an image, you will have to select the ROI of the image on the sum is to be calculated.
As a side note, if you had found out the integral image, the very last pixel represents the sum of all the pixels of the image.
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?