x = readImage(system.file("images", "sample-color.png", package="EBImage"))
display(x, title='Sample')
## Low-pass disc-shaped filter
f = makeBrush(21, shape='disc', step=FALSE)
display(f, title='Disc filter')
f = f/sum(f)
y = filter2(x, f)
display(y, title='Filtered image')
## High-pass Laplacian filter
la = matrix(1, nc=3, nr=3)
la[2,2] = -8
y = filter2(x, la)
display(y, title='Filtered image')
Run the code above in your browser using DataLab