How to Calculate Image Gradient

Every image has an image gradient. The image gradient shows the change of color (or color intensity for black-and-white images) present in the image. If you know the image function, you can calculate the image gradient through methods of multivariate calculus. These multivariate methods are simply extensions of standard calculus methods, and if you are proficient in calculus, you will likely have few problems calculating the image gradient.

Instructions

    • 1

      Write out your image function. Your image function will be a field in the form of f(x,y). In other words, your image will be a function of x and y, so make sure your image looks like this.

    • 2

      Calculate the partial derivative of the image with respect to x. You do this just as if you were computing a standard derivative. The only exception is that you must see y as a constant. That is, treat y as a number and not a variable. Your answer should be a function of both x and y unless one term disappeared while you were taking the derivative. For example, the partial derivative of 2xy with respect to x is 2y.

    • 3

      Calculate the partial derivative of the image with respect to y. You do this just like you did with x. Act as if you were computing a standard derivative, but look at x as a constant this time. Again, your answer should be a function of both x and y unless one term disappeared while you were taking the derivative. For example, the partial derivative of 2xy with respect to y is 2x.

    • 4

      Write the image gradient. The image gradient is written in a manner similar to how you would write coordinates in geometry. Write the partial derivative of the image with respect to x that you found, along with the partial derivative of the image with respect to y, in that order. Between these partial derivatives, place a comma, separating them. Do not forget to put the answer inside parentheses, just as you would do when writing coordinates.

Learnify Hub © www.0685.com All Rights Reserved