I have a rectangular region in an image and have to calculate the average value.
One way I can do is parsing through each pixel value to calculate the average, but that is not an efficient way. Is there any better approach to do in openCV, preferably JAVA.