1. A road surface gradient detection device, the road surface gradient detection device comprising: an image area setting unit configured to divide a captured image to set a plurality of image areas; a coordinate recognition unit configured to recognize coordinates of a pixel range corresponding to an image area of the plurality of image areas; a parallax calculation unit configured to calculate a parallax of the pixel range based on the parallax information of the captured image; a luminance calculation unit configured to calculate a luminance of the pixel range based on luminance information of the captured image; a weighting setting unit configured, based on the luminance of the pixel range and the coordinates of the pixel range, to set a weight of the pixel range to a first value when the luminance difference between the pixel range and an adjacent pixel range is less than a first threshold value, and configured, based on the luminance of the pixel range and the coordinates of the pixel range, to set the weight of the pixel range to a second value greater than the first value when the luminance difference between the pixel range and the adjacent pixel range is equal to or greater than the first threshold value; a representative height calculation unit configured to calculate a representative parallax of the image area and a representative height of the image area based on the parallax of the pixel range, the coordinates of the pixel range, and a magnitude of the weight of the pixel range; and a road surface gradient detection unit configured to detect a road surface gradient from the captured image based on the representative parallax of the image area and the representative height of the image area.