laplace input output
LAPLACE convolves the list of images specified by input with one of four 3 by 3 Laplacian kernels specified by laplace and places the convolved images in output. If the image names in output equal the image names in input the Laplacian operation is performed in place and the original images are overwritten. Out of bounds pixels are computed using the algorithm specified by boundary.
The Laplacian filters are high-pass filters which act as a local edge detector. A characteristic of the Laplacian is that it is zero at points where the gradient is a maximum or a minimum. Therefore points detected as gradient edges would generally not be detected as edge points with the Laplacian filter. Another characteristic of Laplacian operators is that a single grey level transition may produce two distinct peaks one positive and one negative in the Laplacian which may be offset from the gradient location.
The four Laplacian filters are listed below. The I[*,*] are the elements of the input image and the O[*,*] are the elements of the output image.
xycenter 0*I[-1,1] + 1*I[0,1] + 0*I[1,1] + O[0,0] = 1*I[-1,0] - 4*I[0,0] + 1*I[1,0] + 0*I[-1,-1] + 1*I[0,-1] + 0*I[1,-1] diagonals I[-1,1]/sqrt(2) + I[0,1]*0 + I[1,1]/sqrt(2) + O[0,0] = I[-1,0]*0 - I[0,0]*4/sqrt(2) + I[1,0]*0 + I[-1,-1]/sqrt(2) + I[0,-1]*0 + I[1,-1]/sqrt(2) xyall 2/3*I[-1,1] - 1/3*I[0,1] + 2/3*I[1,1] + O[0,0] = - 1/3*I[-1,0] - 4/3*I[0,0] - 1/3*I[1,0] + 2/3*I[-1,-1] - 1/3*I[0,-1] + 2/3*I[1,-1] xydiagonals I[-1,1]/sqrt(2)/2 + I[0,1]/2 + I[1,1]/sqrt(2)/2 + O[0,0] = I[-1,0]/2 - I[0,0]*(2-sqrt(2)) + I[1,0]/2 + I[-1,-1]/sqrt(2)/2 + I[0,-1]/2 + I[1,-1]/sqrt(2)
1. Convolve an image with the Laplacian filter xyall using nearest neighbour boundary extension.
cl> laplace m83 m83.lap xyall
LAPLACE requires approximately 1.7 cpu seconds to convolve a 512 square real image with a 3 by 3 Laplacian kernel on a Sparc Station 1.
convolve, gauss, gradient, boxcar,