Skip to content

azizdeniz890/GorselIslemeGUI

Repository files navigation

Python GUI Computer%20Vision

OpenCV NumPy Matplotlib Pillow

HOG SVM Sliding%20Window Non--Maximum%20Suppression

Image%20Processing Feature%20Visualization Classical%20ML

Status

GorselIslemeGUI — Modular Computer Vision GUI (Python)

A unified, interactive Python GUI that combines multiple classic computer vision & image processing capabilities in a single, modular application. The project emphasizes algorithmic (non–deep learning) approaches and provides a clean structure to experiment with enhancement, analysis, and restoration workflows from one interface.

Table of Contents


Key Features (Part 1)

1) Image Processing Toolkit (Point & Histogram Operations)

An image enhancement and analysis module covering core intensity and histogram-based operations:

  • Brightness adjustment (with 0–255 clipping)
  • Contrast adjustment (factor-based)
  • Negative transformation
  • Thresholding (binary segmentation)
  • Manual histogram computation & visualization
  • Basic image statistics (mean, standard deviation, entropy, min/max)
  • Contrast stretching
  • Manual histogram equalization
  • Gamma correction (multiple gamma options)

Goal: Offer a fast, GUI-driven way to test and compare classic enhancement techniques and observe their effect on histogram shape and image statistics.


2) Prokudin-Gorskii Color Photo Restoration

A restoration pipeline for historical color photo plates based on classical channel alignment techniques.

Prokudin-Gorskii Color Photo Restoration Pipeline

The module reconstructs a full-color RGB image from a single scanned plate that contains three grayscale exposures captured with different color filters.

Workflow:

  • Split the scanned plate into Blue / Green / Red channels (top-to-bottom order)
  • Create an initial unaligned RGB composite to visualize channel misalignment
  • Align channels using similarity metrics:
    • SSD (Sum of Squared Differences)
    • NCC (Normalized Cross-Correlation)
  • Apply the computed shifts to obtain an aligned RGB image
  • Produce a final enhanced output after optional post-processing

Outputs shown in the pipeline:

  • RAW: Original scanned plate containing three grayscale channels
  • UNALIGNED: Initial RGB composition without alignment
  • ALIGNED: Result after channel alignment
  • FINAL: Visually enhanced and color-corrected image

Goal: Restore historically accurate color photographs using reliable, classical alignment strategies without deep learning.


3) HOG-Based Feature Extraction, Detection, and Classification

This module provides a comprehensive implementation of Histogram of Oriented Gradients (HOG) for feature extraction, visualization, object detection, and classical machine learning–based classification within the GUI.

The focus is on understanding gradient-based representations and applying them to real-world detection tasks without relying on deep neural networks.


3.1 HOG Feature Extraction (Custom Implementation)

A full HOG descriptor pipeline is implemented from scratch, following the standard methodology introduced by Dalal & Triggs.

Implementation details:

  • Gradient computation in x and y directions
  • Gradient magnitude and orientation calculation
  • Division of the image into fixed-size cells (e.g., 8×8 pixels)
  • Orientation histogram construction (e.g., 9 bins, unsigned gradients)
  • Block-based normalization (L2 / L2-Hys) for illumination robustness
  • Concatenation of all normalized block histograms into a final feature vector

This process encodes local edge and shape information, which is highly discriminative for rigid objects such as humans and vehicles.


3.2 HOG Feature Visualization

To improve interpretability, the GUI includes a HOG visualization module that renders orientation histograms for each cell.

  • Each cell is represented by line segments
  • Line orientation corresponds to gradient direction
  • Line length is proportional to histogram magnitude

This visualization makes it easier to understand which structural information is captured by the descriptor.

HOG Cell and Bin Representation


3.3 Human Detection using HOG + SVM

The project integrates OpenCV’s pretrained HOG + SVM pedestrian detector for multi-scale human detection.

Pipeline:

  • Image pyramid for scale variation
  • Sliding window scanning
  • HOG feature extraction per window
  • Linear SVM scoring
  • Confidence-based filtering
  • Bounding box visualization

Detected humans are displayed with bounding boxes and confidence scores, allowing qualitative performance assessment.

Human Detection using HOG + SVM


3.4 Custom Object Detection (Vehicle Example)

Beyond pedestrian detection, the system supports custom object detection using HOG features and a trained SVM classifier.

Approach:

  • Sliding window search over the image
  • HOG feature extraction for each window
  • Classification using a pretrained SVM model
  • Thresholding and result visualization

This demonstrates how classical descriptors can be adapted to detect different object categories such as cars.

HOG Feature Visualization


3.5 Effect of HOG Parameters

The GUI allows experimentation with key HOG parameters to observe their effect on performance and descriptor structure:

  • Cell size
  • Number of orientation bins
  • Block configuration

Goal: Provide a clear, visual, and practical demonstration of how HOG descriptors work internally and how they can be applied to detection and classification tasks in a unified GUI environment.


4) GUI Architecture and Module Integration

The project is designed as a modular, extensible Python GUI, where each computer vision component operates independently while being orchestrated under a single user interface.

The architecture emphasizes separation of concerns, making the system easy to understand, maintain, and extend with additional vision modules.


4.1 Overall Design Philosophy

  • Each computer vision task is implemented as a self-contained module
  • The GUI acts as a controller layer, coordinating data flow and user interaction
  • Processing logic is decoupled from the interface logic
  • New algorithms or pipelines can be added without modifying existing modules

This design allows the GUI to function as a unified experimentation platform for classical computer vision techniques.


4.2 Module-Level Structure

The main functional blocks of the system are:

  • Image Processing Engine (filtre_motor)
    • Point operations and histogram-based enhancement
    • Low-level image manipulation utilities
  • Prokudin-Gorskii Restoration Engine (prokudin_motor)
    • Channel splitting and alignment logic
    • Similarity metrics and post-processing steps
  • HOG Engine (hog_motor)
    • Custom HOG feature extraction
    • Visualization utilities
    • Detection and classification pipelines
  • Model Management (models)
    • Storage and loading of pretrained SVM classifiers
  • Data and Assets
    • Test images, example inputs, and visualization outputs

Each engine exposes a clear set of functions that can be invoked directly by the GUI.


4.3 GUI Control Flow

The GUI follows a simple and transparent execution flow:

  1. The user selects a module (Image Processing, Prokudin Restoration, or HOG)
  2. Input images are loaded through the GUI
  3. Parameters are adjusted interactively (where applicable)
  4. The selected algorithm is executed
  5. Results are visualized directly within the interface or saved to disk

This workflow allows rapid experimentation while keeping the underlying implementation accessible.


4.4 Central GUI Entry Point

  • gui_main.py serves as the single entry point of the application
  • It initializes the GUI layout and menus
  • Routes user actions to the corresponding processing modules
  • Handles visualization and result presentation

By centralizing control in gui_main.py, the project avoids duplicated logic and ensures consistent behavior across all modules.

Goal: Provide a clean, modular GUI architecture that integrates multiple classical computer vision pipelines into a single, coherent application without sacrificing clarity or extensibility.


How to Use

1) Launch

From the project root directory, run: python gui_main.py

2) Image Processing

  1. Load an image from the file dialog.
  2. Choose an operation (e.g., brightness/contrast, thresholding, histogram enhancement, gamma).
  3. Adjust parameters in the GUI.
  4. Apply and view the output (and any related plots/visuals).

3) Prokudin-Gorskii Restoration

  1. Select a Prokudin plate image (three stacked grayscale channels).
  2. Choose the alignment method (SSD or NCC).
  3. Run restoration.
  4. Review: unaligned → aligned → final enhanced result.

4) HOG (Features / Detection / Classification)

  1. Load a test image.
  2. Select a task:
    • HOG feature visualization
    • Human detection (HOG + SVM)
    • Custom object detection / classification (SVM, if available)
  3. Set thresholds/parameters.
  4. Run and review bounding boxes, confidence scores, and visualizations.

5) Save Results

Use the GUI’s save/export options (if available) to store processed images, detections, and visualizations.

Releases

No releases published

Packages

 
 
 

Contributors

Languages