Parent Topic: ALGORITHM
The Laplacian filter detects edges, regardless of direction. It produces sharper edges than most other edge detection filters.
The Laplacian of a function f(x,y) is
L(f(x,y)) = (d**2)f / d(x**2) + (d**2)f / d(y**2)
where,
(d**2)f / d(x**2) is the second partial derivative of f with respect to x
and,
(d**2)f / d(y**2) is the second partial derivative of f with respect to y
The second partial derivatives can be approximated by,
(d**2)f / d(x**2) = f(x+1) - 2f(x) + f(x-1) and (d**2)f / d(y**2) = f(y+1) - 2f(y) + f (y-1)The Laplacian can therefore be approximated by,
L(f(x,y)) = f(x+1,y) + f(x-1,y) + f(x,y+1) + f(x,y-1) - 4f(x,y)