0

# Integral Image

Unsolved
###### Computer Vision

Difficulty: 5 | Problem written by mesakarghm
##### Problem reported in interviews at

In an integral image, each pixel represents the cumulative sum of a corresponding input pixel with all pixels above and to the left of the input pixel. While calculating the integral image of an input image, the dimension h and w will be increased by 1.

For a given input image (represented by 2D NumPy array), calculate and return the integral image.

##### Sample Input:
<class 'numpy.ndarray'>
mat: [[17 24 1 8 32] [84 5 19 15 16] [ 4 6 13 20 22] [10 12 19 21 3] [11 18 25 2 9]]

##### Expected Output:
<class 'numpy.ndarray'>
[[ 0 0 0 0 0 0] [ 0 17 41 42 50 82] [ 0 101 130 150 173 221] [ 0 105 140 173 216 286] [ 0 115 162 214 278 351] [ 0 126 191 268 334 416]]

MLPro Premium also allows you to access all our high quality MCQs which are not available on the free tier.

Not able to solve a problem? MLPro premium brings you access to solutions for all problems available on MLPro

Have an issue, the MLPro support team is available 24X7 to Premium users.