Skip to content

MATLAB project for shape-based object detection and classification using 8 geometric features (Area, Eccentricity, Aspect Ratio, Solidity, Perimeter, Circularity, Extent, Euler Number). Includes preprocessing, feature extraction, and visual labeling of detected objects

License

Notifications You must be signed in to change notification settings

ShadyNikooei/Object-Detection-using-MATLAB

Repository files navigation

Object Detection using Shape Features in MATLAB

Overview

This project implements an object detection and recognition system in MATLAB.
The approach is based on shape feature extraction and comparison between query objects and a set of reference images.

The system can:

  • Detect objects in an input image
  • Extract multiple geometric features
  • Compare detected objects with a reference library
  • Classify and label objects with bounding boxes on the query image

Features

  • Preprocessing: Convert RGB images to clean binary masks
  • Shape Features (8-element vector):
    • Area
    • Eccentricity
    • Aspect Ratio
    • Solidity
    • Perimeter
    • Circularity
    • Extent
    • Euler Number
  • Weighted Matching: Compare query object features with references using weighted error scores
  • Visualization: Show bounding boxes and predicted labels on the query image

How to Run

  1. Place your reference images in the folder specified in reference_folder
    reference_folder = 'path_to_reference_images';
  2. Set your query image path in the code:
    query_image_path = 'example.jpg';
  3. Run the project:
    main

Example Workflow

  1. The script builds a feature library from reference images.
  2. It extracts 8 shape features for each object in the query image.
  3. Features are compared with the library using weighted errors.
  4. The best match is displayed on the image with bounding boxes and labels.

Future Improvements

  • Extend feature extraction with texture and color features
  • Replace manual weights with learned weights (ML-based optimization)
  • Support video input for real-time object detection
  • Improve robustness against noisy or complex backgrounds

Author: Shady Nikooei
Digital Image Processing

About

MATLAB project for shape-based object detection and classification using 8 geometric features (Area, Eccentricity, Aspect Ratio, Solidity, Perimeter, Circularity, Extent, Euler Number). Includes preprocessing, feature extraction, and visual labeling of detected objects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages