Warning

This page is located in archive.
Go to the latest version of this course pages.
Go the latest version of this page.

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:

Start by downloading the template of the assignment.

Use `test_script.m`

to check your solution.

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

- 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**): -

- 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:

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

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

Compare your results to the reference:

**3:** implement the generator of selected separable kernels (** get_kernel.m**) -

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

Compare your results to the reference:

**4:** implement Wiener filter (** wiener_filt.m**) -

- see L4 for explanation

Compare your results to the reference:

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

- 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.

courses/b4m33dzo/labs/4_filtering.txt · Last modified: 2022/11/08 18:05 by panekvo1