# Intuition behind image derivative using Fourier Transform for edges detection

This equation can be shown mathematically:

$$\frac{\partial f}{\partial x}=\frac{2\pi i}{N} \mathcal F^{-1}\left(u\cdot \mathcal F(f(x,y)\right)$$

I am struggling to understand the intuition behind it when talking about 2D fourier for images and the use of derivatives to detect edges.

How does multiplying the Fourier transform of the image with $$u$$ help us detect edges in the x direction? Why does it make the "edges" white and the rest of the image darker?

Any help would be appreciated. Thank you!

• What is u specifically? – Dan Boschen Dec 14 '19 at 19:53
• u is the x axis of the fourier transform (-L/2 to L/2) – PhysicsPrincess Dec 14 '19 at 20:47
• But do note that this is usually not a good way to compute the derivative because it enhances noise a lot. Adding a (Gaussian) regularization (smoothing) is highly recommended. – Cris Luengo Dec 16 '19 at 1:48

In general, the time derivative property of the Fourier Transform is given as

$$\mathscr{F}[\frac{d}{dt}x(t)] = j\omega X(j\omega)$$

Notice that we can simply multiply by the frequency index in the Fourier Transform result.

For the 2D FT result:

$$\mathscr{F}[f(x,y)]= F(u,v)$$

Using the same property results in:

$$\mathscr{F}[\frac{d}{dx}f(x,y)]= uF(u,v)$$

$$\mathscr{F}[\frac{d}{dy}f(x,y)]= vF(u,v)$$

The reason this detects edges is clear if you observe how the differentiation of a 1D step function results in an impulse. Your edges approximate steps. The derivative is the slope, so where the slope is high (edges) the derivative is large.

• Sorry, I don't get what you mean in the last part. Why do edges contain high frequencies? – PhysicsPrincess Dec 14 '19 at 21:52
• The fast you change in time the higher will be the frequency - although that statement is probably more confusing--- I can say it another way so will update that. – Dan Boschen Dec 14 '19 at 21:58
• @PhysicsPrincess Roughly speaking, a sudden change (very short in duration) in the state of something such hitting a tensioned string with a hammer would induce oscillations of very high frequencies, whereas slowly shaking one end of an attached rope would induce a wave of very low frequency, as the event happens slowly. Now by definition edges happen suddenly in an image. Hence in the frequency domain they require high frequency components (oscillations). – Fat32 Dec 14 '19 at 22:26
• Well said- I had trouble explaining the presence of high frequencies so simply—- (further complicated by the fact that a step is the integral of an impulse and an integral is a low pass function) – Dan Boschen Dec 14 '19 at 22:33