# What does it mean “derivative of an image”?

I am reading a book about OpenCV, it speaks about some derivative of images like sobel. I am confused about image derivative! What is derived from? How can we derived from an image? I know we consider an image(1-channel) as a n*m matrix with 0 to 255 intensity numbers. How can we derive from this matrix?

EDIT: a piece of text of the book:

One of the most basic and important convolutions is computing derivatives (or approximations to them). There are many ways to do this, but only a few are well suited to a given situation.

In general, the most common operator used to represent differentiation is the Sobel derivative operator. Sobel operators exist for any order of derivative as well as for mixed partial derivatives (e.g., ∂ 2 /∂x∂y).

Imagine a line laid through the image. All pixels along the line count as values, so you can graph the pixels along the line like a function.

The derivative is of that 'function'. A black picture and a white picture have the same derivative (0), but a black-fading-to grey image would have a constant derivative bigger or smaller than zero, depending on the direction of the line in relation to the fading. Hard contrasts have huge derivarives at the points in the line where the line crosses a white/black border. Usually the rows and columns are used as the lines, but you could also lay any oblique line, and some algorithms do.

The term 'derivative' is somewhat a misnomer in this case, as usually the pixel values do net get fitted by a function of which then a derivative is taken, but the 'derivative' is directly taken by looking at the differences from one pixel to it's neighbor.

There is a thread in dsp.stackexchange that deals with this, the following illustrative picture is from there:

• Thank you bukwyrm! So you mean for a 100*200 image, sobel in x-direction, plots 100 functions for each row of the image, then takes the derivative of each row, and so on? And also does the same for each column in y-direction? If I got it true, do you know what is the next step of the algorithm(just like to know) – Hasani Jun 8 '18 at 15:22
• @Hasani I edited the answer, hopefully adressing your remarks. – bukwyrm Jun 11 '18 at 4:45
• Applying the word DERIVATIVE to the output of a process to characterize image change is NOT a misnomer. Rather post(s) in the dsp.stackexchange thread are apparently incorrectly using the term. The diagram and description you provided describes what is called an DIFFERENCE SEQUENCE. It is, as you say, applied to either ORTHOGONAL or DIAGONAL slices. It was a design component used by early 1D bar code readers. DERIVATIVE matrices (x-y) or cubes (x-y-time) can be developed using Hamming, trapezoidal, or other windowing along with 2/3D splines or FFTs. (Not all DSP programs are well designed.) – FauChristian Jun 18 '18 at 2:20

The term Derivative of an Image in the context you mention has two meanings.

1. A matrix, image, or floating point number that is derived from an image via convolution, passing the image through a two dimensional NN, the application of an FFT analysis, or some other process. In this context, the word Derivative implies the direction of calculation: Image B is derived from image A.
2. A matrix or cube that represents the rate of change at in the image being processed. The change being measured between only two adjacent pixels in a single dimension and only one direction at a time, but the applications of this technique is very limited, and such a sequence is of differences, not at all reasonable approximations of the derivative of light. What is more useful in real recognition systems are two dimensional or hexagonal windowing (Gausian, Hamming, Hanning, trapazoidal, cosine, ...) across space and, for video, through time. The calculus term derivative should always reference the theoretical surface being approximated using these techniques, not the discrete matrix or cube that approximates the surface.

Such multidimensional convolution and neural network based approaches are less sensitive to capture noise and orientation nuances. Two dimensional whole image or windowed FFT techniques have met with much success because filtering the expected frequency range of features to be detected is merely an attenuation process. Two and three dimensional splines can also be tuned to be useful in the detection of features in an orientation independent way.

In addition to gray scale analysis, color and transparency channels can be selected for independent or parallel analysis or added to the dimension of the fitting model from which the derivative is taken.

Advances in deep networks have blossomed into a new area of image processing and recognition research, bringing new hope to robotics, automated transportation, and cybernetics in general.

• Thank you FauChristian, I updated my question, maybe clarifies what exactly I asked. – Hasani Jun 9 '18 at 7:28