Warning

# Linear and Non-linear Filtering

The two following labs deal with filtration of images, which can be used for smoothing, deblurring, denoising and other applications.

The theory behind the labs can be found in the lectures:

Use test_script.m to check your solution.

## Brute-force convolution and simple kernels

1a: implement brute-force convolution using loops (convolution_2D.m) - 2 points

• Note that the input kernels can have general 2D shape (not just square matrices).
• Use “DC” padding, i.e., clip the pixel coordinates just to the area of the original image. For the pixels in areas, where the kernel would look outside of the original image, use the nearest image pixel.
• A nice visualization of 2D convolution with simple kernels: https://setosa.io/ev/image-kernels/.

1b: implement the generator for specified kernels (get_kernel.m): - 0.2 point / kernel - 1 point total

• Implement the following kernels: average, Sobel, Gauss, Gauss derivation, Laplacian of Gaussian
• Note that there are many other commonly used simple kernels. Check, e.g., Wikipedia for few examples.
• If your Sobel operator is mirrored relative to the reference solution, it is OK. You can find both definitions in literature.

Compare your results to the reference:

## Convolution using Fourier Transform

2: implement convolution using Fourier Transform (convolution_ft.m) - 1 point

• Check if the results match the outputs of your brute-force implementation.

Compare your results to the reference:

## Convolution with separable kernels

3: implement the generator of selected separable kernels (get_kernel.m) - 0.5 point / kernel - 1.5 points total

• Check If the results match the outputs of your standard kernel implementations.

Compare your results to the reference:

## Sharpening with Wiener filter

4: implement Wiener filter (wiener_filt.m) - 2 points

• see L4 for explanation

Compare your results to the reference:

## Denoising with bilateral filter

5: implement basic Bilateral filter (bilateral_filt.m) - 2.5 points

• take your implementations of the 2D convolution and Gauss kernel as a starting point
• see L5 for explanation

Try to change the values in the test script so the difference between Gaussian smoothing and Bilateral filter is more visible:

• smooth_stddev = 5
• int_stddev = 0.1

Compare your results to the reference (with updated values):

When you are done, upload the complete zip archive containing your implemented files to BRUTE:
• bilateral_filt.m
• convolution_2D.m
• convolution_2D_ft.m
• get_kernel.m
• wiener_filt.m

Keep the files in the root of the zip archive (zip directly the files, NOT a folder containing the files). The evaluation system searches for the files just in the root of zip archive.

The points will be assigned manually by TA after the deadline.