Skip to content

Latest commit

Β 

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Prodexa

Prodexa Logo

Smart Product Vision & Analysis System

PRODuct EXamination & Analysis

An image-processing-based system for detecting, classifying, counting and statistically analyzing supermarket products from images.

Python OpenCV NumPy EC9570 Local Processing



🧠 About Prodexa

PRODEXA (PRODuct EXamination & Analysis) is an image processing based smart supermarket product identification system developed for EC9570: Digital Image Processing, Department of Computer Engineering, University of Jaffna.

The system is designed to transform a supermarket basket or product-layout image into structured product information by combining image acquisition, image preprocessing, product segmentation, object detection, product classification, counting and statistical analysis.

The overall objective is to demonstrate how Digital Image Processing and Computer Vision techniques can be integrated into a practical smart-checkout-oriented application.



πŸ“Œ Overview

Given an image of a supermarket basket / product layout, the system:

  1. Preprocesses the image (noise removal, resizing, normalization)
  2. Detects and segments individual products
  3. Classifies each product into a category
  4. Generates a statistical summary report (counts, percentages, charts)
  5. Displays results as labeled bounding boxes on the image and/or console output

Real-time capture is not used; the system works on pre-collected / manually captured images.

All processing is performed locally (no cloud APIs).



✨ Key Features

Feature Description
πŸ–ΌοΈ Image Acquisition Accepts supermarket basket and product-layout images
βš™οΈ Preprocessing Resizing, noise removal, normalization and color-space processing
🎯 Product Segmentation Separates product regions from the background
πŸ” Object Detection Identifies individual product regions using image-processing techniques
🏷️ Product Classification Assigns detected products to predefined categories
πŸ”’ Product Counting Calculates total and category-wise product counts
πŸ“Š Statistical Analysis Generates category percentages and distribution information
πŸ“ˆ Visualization Supports bar charts and pie charts
🏷️ Annotated Output Displays detected products using bounding boxes and labels
πŸ”’ Local Processing Performs processing locally without cloud-based inference


🎯 Project Objectives

The main objectives of Prodexa are to:

  • Develop an image-processing-based supermarket product identification pipeline.
  • Apply preprocessing techniques to improve image quality and consistency.
  • Isolate individual products from supermarket images.
  • Detect product regions using segmentation and object-detection techniques.
  • Classify detected products into meaningful categories.
  • Calculate total and category-wise product counts.
  • Generate statistical summaries and visualizations.
  • Evaluate classification performance against the required accuracy target.
  • Demonstrate modular and collaborative software development using GitHub.


βš™οΈ Dataset

RPC: Retail Product Checkout Dataset

(Wei et al., 200 SKUs across 17 meta-categories, ~83,739 images, COCO-format bounding box annotations, ~20GB).

The dataset contains two main image types:

Exemplar Images

Single-product images captured against a clean/plain background and from multiple viewing angles.

Purpose:

  • Training the classification module
  • Validating the classification module
  • Extracting product-level visual characteristics

Checkout Images

Images containing multiple products placed on a checkout tray with different levels of visual clutter.

The checkout images include:

  • Easy - 3-5 categories / 3-10 instances
  • Medium
  • Hard

These images are used for testing:

  • Product detection
  • Product segmentation
  • Full end-to-end pipeline performance

Category Strategy

Classification targets the dataset's 17 meta-categories (e.g. bottle-like, box-like, canister-like, bag-like) rather than all 200 fine-grained SKUs.

These categories are visually distinguishable by shape, color and texture and are therefore better suited to a classical image-processing pipeline within the project's scope.

Project Dataset Scope

Due to the 12-hour project limit, a curated subset of the complete dataset is used rather than the entire dataset.

The project uses:

  • A sample of exemplar images per meta-category for classification training/testing
  • Easy-difficulty checkout images for detection, segmentation and the full pipeline demonstration

Higher clutter levels involve heavy occlusion, which conflicts with the assignment's "clearly separated products preferred" scope.

Note: The complete dataset (~20GB) is not stored in this repository. See Getting the Dataset.



πŸ”„ System Workflow

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚    Input Image       β”‚
                    β”‚ Basket / Layout      β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚ Image Acquisition    β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   Preprocessing      β”‚
                    β”‚ Resize β€’ Denoise     β”‚
                    β”‚ Normalize β€’ HSV      β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚    Segmentation      β”‚
                    β”‚ Thresholding         β”‚
                    β”‚ Morphology           β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   Object Detection   β”‚
                    β”‚ Contours β€’ Filtering β”‚
                    β”‚ Bounding Boxes       β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚ Feature Extraction   β”‚
                    β”‚ Color β€’ Shape        β”‚
                    β”‚ Texture              β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚    Classification    β”‚
                    β”‚     SVM / KNN        β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚ Counting & Statisticsβ”‚
                    β”‚ Counts β€’ Percentages β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   Final Visualizationβ”‚
                    β”‚ Labels β€’ Boxes β€’     β”‚
                    β”‚ Charts β€’ Summary     β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Core Pipeline

Raw Image
    ↓
Preprocessing
    ↓
Segmentation
    ↓
Product Detection
    ↓
Feature Extraction
    ↓
Classification
    ↓
Product Counting
    ↓
Statistical Analysis
    ↓
Annotated Output + Charts


πŸ‘₯ Team

Member Modules Owned
De Costa M.S.M. Image Acquisition & Preprocessing, Product Classification
Senarathna S.A.D.H.D. Object Detection & Segmentation, Statistical Analysis & Report Generation

Collaborative Module Flow

                 MEMBER 01
                     β”‚
          Image Acquisition
                     ↓
              Preprocessing
                     β”‚
                     β–Ό
                 MEMBER 02
                     β”‚
              Segmentation
                     ↓
             Object Detection
                     ↓
              Product Crops
                     β”‚
                     β–Ό
                 MEMBER 01
                     β”‚
             Feature Extraction
                     ↓
              Classification
                     β”‚
                     β–Ό
                 MEMBER 02
                     β”‚
             Product Counting
                     ↓
            Statistical Analysis
                     ↓
             Report Generation

This modular division allows both members to work independently while maintaining clear interfaces between the system components.



🧠 Techniques Used

Preprocessing

  • Resizing
  • Gaussian / median blur
  • Color-space conversion
  • Lighting normalization
  • Image normalization

Segmentation

  • Thresholding
  • HSV-based background masking
  • Morphological operations
  • Contour detection

Object Detection

  • Contour-based object detection
  • Contour-area filtering
  • Bounding-box extraction
  • Product-region isolation

Feature Extraction

  • Color features
  • Shape features
  • Texture features

Classification

  • (Fill in once decided: handcrafted features + ML classifier, or pretrained CNN feature extractor + shallow classifier with justification, since pretrained models must be explained as required by the assignment)

Statistical Analysis

The system generates:

  • Total product count
  • Category-wise product counts
  • Percentage distribution
  • Bar charts
  • Pie charts


πŸ—οΈ Project Structure

PRODEXA/
β”‚
β”œβ”€β”€ README.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ .gitignore
β”‚
β”œβ”€β”€ assets/
β”‚   └── prodexa-logo.png
β”‚
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ raw/                  # RPC dataset subset - git-ignored
β”‚   β”œβ”€β”€ annotations/          # COCO-format bounding box JSON - git-ignored
β”‚   β”œβ”€β”€ processed/            # Preprocessed images
β”‚   β”œβ”€β”€ dataset/              # Cropped product images organized by meta-category
β”‚   └── dataset_subset.txt    # Exact files used from the full RPC dataset
β”‚
β”œβ”€β”€ notebooks/
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ acquisition/
β”‚   β”œβ”€β”€ preprocessing/
β”‚   β”œβ”€β”€ segmentation/
β”‚   β”œβ”€β”€ detection/
β”‚   β”œβ”€β”€ features/
β”‚   β”œβ”€β”€ classification/
β”‚   β”œβ”€β”€ analytics/
β”‚   β”œβ”€β”€ visualization/
β”‚   └── pipeline/
β”‚
β”œβ”€β”€ models/                   # Trained classifier artifacts
β”‚
β”œβ”€β”€ outputs/
β”‚   β”œβ”€β”€ annotated_images/     # Bounding boxes + labels
β”‚   └── reports/              # Summary tables / charts
β”‚
β”œβ”€β”€ docs/                     # Documentation 
β”‚
└── tests/                    # Module-level tests


πŸ”— Module Integration

Prodexa follows a modular architecture where each component has a clearly defined responsibility.

Acquisition
     β”‚
     β–Ό
Preprocessing
     β”‚
     β–Ό
Segmentation
     β”‚
     β–Ό
Detection
     β”‚
     β–Ό
Feature Extraction
     β”‚
     β–Ό
Classification
     β”‚
     β–Ό
Analytics
     β”‚
     β–Ό
Visualization

The final integration layer connects these modules into a single end-to-end processing pipeline.



πŸ“Š Statistical Output

For every processed supermarket image, Prodexa aims to provide:

         PRODEXA ANALYSIS

Total Products Detected: 6

Category             Count       %
----------------------------------------
Category A              2       33.33%
Category B              2       33.33%
Category C              1       16.67%
Category D              1       16.67%

----------------------------------------
Total                   6      100.00%
----------------------------------------

The system can additionally generate:

  • Category distribution bar chart
  • Category distribution pie chart
  • Annotated product image
  • Classification evaluation results


πŸ“ˆ Evaluation

The classification module will be evaluated using an independent test set.

Primary Metric

Classification Accuracy

Accuracy =
Correct Predictions
──────────────────── Γ— 100
Total Predictions

Target

Classification accuracy β‰₯ 80%

Additional evaluation metrics may include:

  • Precision
  • Recall
  • F1-score
  • Confusion matrix
Metric Value
Classification accuracy TBD (target β‰₯ 80%)
Categories TBD
Test images TBD


πŸŽ“ Course Information

EC9570 - Digital Image Processing

Department of Computer Engineering Faculty of Engineering University of Jaffna

This project is developed as part of the EC9570 Digital Image Processing coursework.



Prodexa
From Pixels to Product Insights.

EC9570 β€’ Digital Image Processing β€’ University of Jaffna

About

A Python based smart supermarket checkout system developed using OpenCV and NumPy to detect, classify, and count supermarket products from images. The system performs image acquisition, preprocessing, product segmentation, classification, and statistical analysis, producing

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages