According to Zhihu's query, in mathematics, the gradient is a vector, whose direction is the fastest growing direction of the function, and its size is equal to the slope of the function at this point. For a function in two-dimensional space, the gradient is a vector whose direction is the direction with the largest change rate of the function, and its size is equal to the slope of the function at this point. In image processing, gradient is used to calculate the change rate of image brightness or color in a certain direction, so as to extract the edge and outline of the image. In image processing, gradient is usually calculated by partial derivatives in horizontal and vertical directions. So the gradient is not a coordinate, nor a number, but a vector, indicating the rate of change and direction of the function at a certain point.