1. An image processing device comprising: an image acquiring unit configured to acquire an image; a storage unit configured to store information on a cumulative value of a value associated with a predetermined pixel for each sub-region, which is obtained by dividing an image region into a plurality of sub-regions, in the image acquired by the image acquiring unit; and an image processing unit configured to acquire a cumulative value of a value associated with a pixel of the image acquired by the image acquiring unit in a rectangular range set in the image region based on the information stored in the storage unit, wherein the image region is divided into a plurality of sub-regions in the vertical direction, and wherein when the rectangular range set in the image region extends over two or more sub-regions, the image processing unit acquires the cumulative value at a pixel position in the lowermost sub-region of the two or more sub-regions by adding the cumulative values in the upper sub-regions at the pixel position in the same column of a lowermost row in the upper sub-regions, over which the rectangular range extends, to the cumulative value in the lowermost sub-region at the pixel position in the lowermost sub-region.