Laplacian of gaussian filter use

maximus picture maximus · Mar 30, 2010 · Viewed 25.4k times · Source

This is a formula for LoG filtering: alt text
(source: ed.ac.uk)

Also in applications with LoG filtering I see that function is called with only one parameter: sigma(σ). I want to try LoG filtering using that formula (previous attempt was by gaussian filter and then laplacian filter with some filter-window size ) But looking at that formula I can't understand how the size of filter is connected with this formula, does it mean that the filter size is fixed? Can you explain how to use it?

Answer

AVB picture AVB · Mar 30, 2010

As you've probably figured out by now from the other answers and links, LoG filter detects edges and lines in the image. What is still missing is an explanation of what σ is.

σ is the scale of the filter. Is a one-pixel-wide line a line or noise? Is a line 6 pixels wide a line or an object with two distinct parallel edges? Is a gradient that changes from black to white across 6 or 8 pixels an edge or just a gradient? It's something you have to decide, and the value of σ reflects your decision — the larger σ is the wider are the lines, the smoother the edges, and more noise is ignored.

Do not get confused between the scale of the filter (σ) and the size of the discrete approximation (usually called stencil). In Paul's link σ=1.4 and the stencil size is 9. While it is usually reasonable to use stencil size of 4σ to 6σ, these two quantities are quite independent. A larger stencil provides better approximation of the filter, but in most cases you don't need a very good approximation.