This project implements three classical image processing tasks:
- Chemical Noise Removal and Reconstruction
- Speckle Noise Removal
- MRI Visualization
Install dependencies:
pip install -r requirements.txt- opencv-python
- numpy
- matplotlib
- pydicom
src/
main.py
chemical.py
speckle.py
mri.py
utils.py
noisy/
chemical/
speckle/
output/
chemical/
speckle/
mri/
Run the main application:
python src/main.pyThen choose a task:
- Chemical Noise Removal
- Speckle Removal
- MRI Visualization
- Run All Tasks
- Each task automatically selects 3 images randomly
- All results are saved in the output/ folder
Remove noise from chemical structure images and reconstruct clean shapes (lines, letters, bonds).
- Apply filters:
- Mean
- Median
- Gaussian
- Convert to binary using Otsu thresholding
- Reconstruct shapes using morphological operations
- Evaluating results
- Mean filter produced the most consistent and visually correct results.
- Gaussian filter often caused fragmentation of structures.
- Median filter sometimes removed too much information, making structures faint or incomplete.
- The evaluation metric did not always match visual quality, so visual inspection was also considered.
Overall, the mean filter performed best, while Gaussian and median filters showed limitations depending on noise and structure.
The evaluation metric is based on number of connected components and small noise regions.
However, fewer components does NOT always mean better result and median filter can get good scores but produce unusable images
Therefore, both quantitative metrics and visual inspection were used
Remove speckle noise using non-ML techniques.
- Median
- Gaussian
- Bilateral
- Bilateral filter achieved the best balance between noise reduction and edge preservation.
- Gaussian filter smoothed noise effectively but blurred important details.
- Median filter reduced noise but sometimes removed useful texture.
- Overall, bilateral filtering was the most reliable method.
Score is based on:
- noise level (Laplacian)
- edge preservation (Sobel)
- Read the file
- Extract metadata
- Visualize slices
When running this task, you must provide a MRI file path:
Example paths: noisy/mri/sample.dcm
- metadata.txt
- slice images
- grid visualization
- Metadata extraction provided useful information about the scan and image properties.
- Slice visualization allowed clear understanding of the MRI structure.
- Grid visualization helped compare different layers effectively.
- The task demonstrated handling of real-world medical image data formats.
Important Note
The MRI file is NOT included in repository due to size.
✔ Python only
✔ No machine learning (especially for speckle)
✔ Using standard libraries (OpenCV, NumPy, etc.)
✔ Random selection of 3 images per task
✔ Outputs saved in structured folders
✔ Clean, readable, user-friendly code
All algorithms and techniques used in this project are based on concepts covered in our course lectures, primarily from the 07_Image_processing.pdf material.
The implementation follows standard approaches introduced in the lecture, including:
- image filtering (mean, median, Gaussian, bilateral)
- thresholding (Otsu method)
- morphological operations (opening, closing)
- connected component analysis
- edge and noise estimation (Sobel, Laplacian)
I have not used any external or advanced methods beyond the lecture scope.
This project demonstrates classical image processing techniques, noise removal strategies, importance of combining metrics with visual analysis and structured user-friendly application design.
The results show that different noise types require different approaches and no single filter is universally optimal. Careful evaluation and visualization are essential for selecting the best method.


