Skip to content

About

Image Processing Final Exam PyGUI

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

61 Commits

Folders and files

Repository files navigation

Image Processing Project

Overview

This project is a comprehensive image processing application that performs the following tasks:

  • Image sharpening
  • Smoothing
  • Edge detection (using Sobel and Canny methods)
  • Image segmentation (using K-means clustering)

This project was developed as part of a final examination for Semester 3 at Soegijapranata Catholic University. It aims to showcase advanced image processing techniques applied through a user-friendly GUI for academic and practical applications.

The application provides a user-friendly GUI to upload images, adjust parameters, and view the processed results in real-time.


Features

  1. Sharpening

    • Enhances image details using a Laplacian filter.
    • Adjustable sharpening intensity.
  2. Smoothing

    • Reduces noise in the image using Gaussian blur.
    • Adjustable smoothing intensity.
  3. Edge Detection

    • Implements both Sobel and Canny methods.
    • Compares results of both methods side by side.
  4. Image Segmentation

    • Clusters the image into distinct regions using K-means clustering.
    • Adjustable parameters for fine-tuned segmentation.

New Features

Rather than choosing program from folder, now in this new version user can use the app for each image and in one single display, which the display won't follow the image size

  1. Compact Version

    • On the app.py the user can experience the one image per process and much more freshed display
    • The display will not follow the image size, so it will be more compact and user-friendly
  2. Live Stream Features

    • On livestream.py User can now use the camera to exxperience realtime Image Processing with adjusted parameter

The main different on app.py and src/main.py was the ability to process which

  • main.py
    • Focused on process a bunch image, which good for research purpose because you will have all together processed image.. Im still work on this feature so we can make it into one UI and do it by choosen step
  • app.py
    • Focused on showing the user how per image can see the image one by one and adjustingit one by one also.

Installation

Requirements

  • Python 3.12+
  • Libraries: OpenCV, NumPy, PySimpleGUI, Pillow

Setup

  1. Clone the repository:
    git clone https://github.com/Corneliox/Image-Processing-Final-Exam-PyGUI.git
    cd Image-Processing-Final-Exam-PyGUI
  2. Install the required dependencies:
    pip install -r requirements.txt
  3. Run and Enjoy

Usage

  1. Run the application using Python:
    • For folder-based processing
      •  python main.py
    • For single-based processing
      •  python app.py 
  2. Use the GUI to:
    • Upload an image from your computer
    • Select the desired processing step & Adjust parameters for sharpening, smoothing, edge detection, and image segmentation
    • View Result
  3. Processed image will be saved if you click the save button.

Folder Structure

The project follows a NEW folder structure:

Image-Processing-Final-Exam-PyGUI/
├── Comparison/
│   ├── comparefinal.py             # Tools to Compare and Merge image Vertically
│   └── imagecomparison.py          # Tools to Compare and Merge image Horizontally
├── New/
│   ├── Image/                      # 25 Choosen Dataset that you can play with
│   ├── app.py                      # Compact version of /src
│   ├── livestream.py               # Real Time Camera Image Processing [Raka Idea's, Thanks!!]
│   └──  src/
│       ├── __pycache__             # Somehow it just Appear??
│       ├── edgedetection.py        # Module for Canny edge detection algorithms.
│       ├── imagesegmentation.py    # Module for segmentation
│       ├── main.py                 # Main entry point for the application
│       ├── sharpening.py           # Module for Laplacian sharpening filter
│       └── smoothing.py            # Module for smoothing functionality
├── .gitignore
├── README.md                       # Project documentation
├── Sharpening.jpg                  # Sharpening image for README.md
├── Smoothing.jpg                   # Smoothing image for README.md
└── requirements.txt                # List of dependencies


Preview

  • Processed Images: Simply put the parameters and Click process to see the differences
  • GUI Features:
    • Simple, intuitive design for uploading and processing images.
    • Real-time parameter adjustments.

Algorithm Used

  1. Sharpening:
    • Unsharp masking algorithm to enhance image details.
  2. Smoothing
    • Gaussian blur for noise reduction while preserving image features.
  3. Edge Detection
    • Sobel : Gradient-based edge detection.
    • Canny : Multi-stage edge detection for precise results.
  4. Image Segmentation
    • K-means clustering to separate the image into distinct regions.

Acknowledgment

Thanks for :

  • Raka : For the idea of using a real-time camera feed for image processing.
  • Ms. Shinta (Lecturer) : For the Briefing and explanation in a whole Semester.

Comparison on Sharpening and Smoothing

I did some try on Sharpening on Smoothing methode, because it has seenable and more litle parameter to adjst with, and each parameter did a big difference on each

Notes : If you want to Zoom in i put 28347 x 5500 Resolution of image on link below, the readme picture is the low resolution image (Github prohibition >100 mb file)

  • Sharpening

    Low Res Sharpening Comparison This images show us 5 row of image that categorize as

    • Row 1 = Sharpening with *1 Intensity
    • Row 2 = Sharpening with *2 Intensity
    • Row 3 = Sharpening with *3 Intensity
    • Row 4 = Sharpening with *4 Intensity
    • Row 5 = Sharpening with *5 Intensity

    My Conclusion on this photo was 1-3 Intensity still good with litle noise, but once you step on 4-5 i think you need the smoothies methode xD

    High Resolution Image :

  • Smoothing

    Low Res Smoothing Comparison

    For Smoothing I use Gaussian Blur, which was need an odd number to work with, but first we make the merged image first to compare

    • Row 1 = Smoothing with 1 Intensity
    • Row 2 = Smoothing with 5 Intensity
    • Row 3 = Smoothing with 9 Intensity
    • Row 4 = Smoothing with 13 Intensity
    • Row 5 = Smoothing with 17 Intensity

    For this photo, i prefer to have a blur Less than 9 for only smoothing (Because its readable) and 9 - 15 for little sharpness addition, and 17+ if you got high noise on your image.. Afterall this two methods can be merged.

    High Resolution Image =

After all you as a user can try all by yourself on merging all the method that possible on app.py and try livestream using your camera on livestream.py, Try it on and Give me Feedback later.. God bless you and Thanks!!!


Creator License

This Project was created by Cornelio Abdimash Christiono | 23.K4.0005, Soegijapranata Satholic University

Purpose: Final Examination of Semester 3

About

Image Processing Final Exam PyGUI

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages