问题
I am currently, learning the working of Seam Carving aka Content Aware Resizing.
Seam Carving involves calculation of Energy of Each individual pixel in an image. Where the Energy could be calculated using several methods, one of which being Gradient Magnitude (Image Gradient).
I have previously used Sobel Filter/Operator, which involves calculation of gradients in X and Y direction, where the output of the two is used for finding edges. But, I am not quite sure what a Gradient is by definition.
P.S.:- I read the Wikipedia page of Image Gradient but was unable to understand it, clearly.
回答1:
With Sobel you have computed the derivatives in the x and y directions.
These two derivatives together form the gradient. That is, the gradient has two values (a 2D vector) at each pixel. Because we have a vector at each pixel, we have a vector field.
The gradient gives the strength and the direction of the slope at each point. The magnitude of the gradient gives the slope strength.
来源:https://stackoverflow.com/questions/56911127/what-is-an-image-gradient