Skip to main content
1-Visitor
September 7, 2017
Question

Laplacian filter

  • September 7, 2017
  • 3 replies
  • 2617 views

Hi,

 

i need help programming a 2D laplacian filter filter using a {\mathbf {D}}_{{xy}}^{2}={\begin{bmatrix}0&1&0\\1&-4&1\\0&1&0\end{bmatrix}}

matrix.

The program should load a picture via READBMP then apply the filter and output the edited picture.

It would be really cool if you could also comment your program since i have no experience using Mathcad at all.

 

Thank you very much

JensE

3 replies

23-Emerald I
September 7, 2017

I'll give it a shot:

The sheet (not terribly well commented

before

after

25-Diamond I
September 7, 2017

Maybe you could use the built-in functions laplace4, laplace8, laplace 24 or convolve3 to do the job.

Here done in Mathcad15 as we can view the pics in the Mathcad sheet and have not to resort to external picture viewers.

Bild.PNG

 

23-Emerald IV
September 7, 2017

Another program, suitable for an arbitrary size mask:

PictureConvolution0.png

With a result:

PictureConvolution1.png

Success!
Luc

23-Emerald IV
September 7, 2017

A correction is in order (to restrict the arbitrary mask size to odd dimensions only, and to make sure that the output picture is as large as the input picture):

PictureConvolution0.png

With as result:

PictureConvolution1.png

Success!

Luc