This repository contains my solutions to six homework assignments from the Digital Image Processing course. Each assignment focuses on different aspects of image processing, including signal processing, transformations, and machine learning techniques applied to images. The solutions are implemented in Python using Jupyter notebooks, with a combination of theoretical explanations and practical algorithm implementations.
- Homework 1: Image Kernels & Fourier Series
- Homework 2: Quantization Techniques
- Homework 3: Convolution & DCT Compression
- Homework 4: CLAHE & Filter Comparison
- Homework 5: Hough Transform, Segmentation & K-Means
- Homework 6: Compression & Morphological Operations
In this task, I applied the provided kernel to the image image1
. Additionally, I experimented with two other kernels and compared the resulting images to understand how different kernels affect image processing.
I explored Fourier transformations by calculating the Fourier coefficients of image2
and visualizing the transformed image. I then reconstructed the image step by step by summing sinusoidal signals, demonstrating the power of Fourier synthesis.
This homework focused on various quantization methods, including:
- Part a: I explained the concept and purpose of quantization in digital image processing.
- Part b: I applied uniform quantization with 4 levels to a given set of values, visualized the results, and calculated the Mean Squared Error (MSE).
- Part c: I implemented a custom
quantizer
function to quantize an image using decision and reconstruction levels. - Part d/e: I implemented Lloyd-Max and uniform quantization methods and analyzed their effects on a given image, comparing histograms and MSE.
I implemented both standard and circular convolution on images, experimenting with different kernels and observing the resulting transformations.
I utilized the Discrete Cosine Transform (DCT) to compress images, experimenting with different compression ratios and assessing the visual quality and efficiency of the compression.
(a)
|
(b)
|
I implemented Contrast Limited Adaptive Histogram Equalization (CLAHE) from scratch and applied it to image1.jpg
. CLAHE enhances image contrast while preventing over-amplification in high-contrast areas by processing small tiles in the image.
I compared the performance of Wiener and inverse filters on an image that was both blurred and noisy, evaluating which method provided better restoration.
I implemented the Hough transform from scratch to detect lines on a chessboard image (chess.jpg
). I developed an algorithm to remove non-relevant lines and identified chessboard corners.
I applied template matching techniques to the image birds.jpg
, aiming to detect the birds without using external libraries.
I described the K-Means clustering algorithm and used it to quantize the image sight.jpg
. I determined the optimal number of clusters based on image analysis.
I compressed the cameraman.jpg
image using both the Walsh-Hadamard and Discrete Cosine Transforms (DCT) with identical compression ratios. I evaluated the quality of the compressed images using multiple metrics and performed arithmetic coding on the DCT-compressed result.
Ratio | WHT_MSE | WHT_PSNR | WHT_SSIM | DCT_MSE | DCT_PSNR | DCT_SSIM |
---|---|---|---|---|---|---|
5 | 0.001399 | 28.541886 | 0.959120 | 0.001108 | 29.552790 | 0.974540 |
10 | 0.002148 | 26.680216 | 0.917958 | 0.001623 | 27.897143 | 0.936990 |
15 | 0.002814 | 25.506035 | 0.887582 | 0.002203 | 26.569549 | 0.905004 |
20 | 0.003434 | 24.641524 | 0.858834 | 0.002781 | 25.558190 | 0.877347 |
25 | 0.004397 | 23.568252 | 0.822654 | 0.003902 | 24.086957 | 0.833458 |
I implemented custom morphological operations to complete the following tasks:
- Isolating stars in
andromeda-galaxy.png
.
- Segmenting organs in
MRI.png
.
- Coloring the letter "I" red in
text.jpg
.