Skip to content

Repository files navigation

OptiPack

Intelligent 3D Packing Optimization System

Measure. Optimize. Visualize.

A computer vision and evolutionary optimization based system that automatically measures objects, determines optimal packing arrangements, and visualizes the final solution in 3D.



Overview

Packing problems appear everywhere:

  • Airport luggage organization
  • Cargo loading
  • Warehouse storage
  • Container utilization
  • Industrial packaging

Traditional packing methods often rely on manual estimation and trial-and-error approaches, which are time-consuming and rarely guarantee optimal space utilization.

OptiPack automates this process by combining:

  • Computer vision based measurement
  • 3D dimensional estimation
  • Genetic algorithm optimization
  • Interactive 3D visualization

The system takes images of objects and a storage container, calculates their dimensions, finds an efficient placement arrangement, and presents the optimized result visually.


How OptiPack Works

                 Input Images
                      |
                      ↓
          Computer Vision Measurement
                      |
                      ↓
              Real World Dimensions
                      |
                      ↓
          Genetic Algorithm Optimizer
                      |
                      ↓
          Optimal 3D Placement Solution
                      |
                      ↓
              3D Visualization

Key Features

1. Computer Vision Measurement System

The measurement system estimates real-world object dimensions using:

  • Object images from different perspectives
  • A reference object with known dimensions
  • OpenCV based image processing
  • Native C++ integration through Flutter FFI

Input

Front Image
     +
Side Image
     +
Reference Object Information

Output

Object Width
Object Height
Object Depth
Annotated Images


2. Intelligent Packing Optimization

The optimizer searches for efficient object arrangements inside a container.

Implemented using:

  • Genetic Algorithm
  • 3D spatial representation
  • Object orientation search
  • Fitness-based evaluation

Input

{
  "container": {
    "width": 30,
    "height": 20,
    "depth": 10
  },
  "items": [
    {
      "id": 1,
      "dimensions": {
        "width": 6,
        "height": 6,
        "depth": 2
      }
    }
  ]
}

Output

Item 1 → Position (x,y,z)
Item 2 → Position (x,y,z)
Item 3 → Position (x,y,z)

Maximum achievable space utilization


3. 3D Visualization

The optimized packing arrangement is visualized using Three.js.

The visualization provides:

  • Container representation
  • Object placement
  • Animation of the final arrangement
  • Human-friendly interpretation of optimization results


Application Workflow

Setup Reference Object

        ↓

Scan Items

        ↓

Scan Storage Space

        ↓

Measurement System

        ↓

Optimization Engine

        ↓

3D Visualization

System Architecture

OptiPack consists of three major integrated subsystems.


Measurement System

Responsible for converting images into real-world dimensions.

Technology:

  • C++
  • OpenCV
  • Dart FFI
  • Flutter Native Integration

Optimization System

Responsible for finding efficient object placement.

Technology:

  • Dart
  • Genetic Algorithm
  • 3D spatial search

Visualization System

Responsible for displaying the final packing solution.

Technology:

  • Three.js
  • JavaScript
  • Web-based 3D rendering

Technology Stack

Mobile Application

Technology Purpose
Flutter Cross-platform application framework
Dart Application logic and native integration

Measurement

Technology Purpose
C++ Native computer vision processing
OpenCV Image processing and analysis
Dart FFI Flutter-C++ communication

Optimization

Technology Purpose
Dart Native optimizer implementation
Genetic Algorithm Search for efficient packing solutions

Visualization

Technology Purpose
Three.js 3D rendering
JavaScript Visualization logic
WebView Flutter integration

Project Evolution

OptiPack has evolved through multiple architectural improvements.

Version 1 — Distributed Architecture

Initial implementation:

Flutter Application

        |
        |

HTTP Requests

        |
        |

Python Flask APIs

        |
        |

Measurement + Optimization Systems

The measurement system and optimizer were initially deployed as independent Python services.


Version 2 — Native Integration

The system was redesigned for better performance and reliability.

Changes:

  • Measurement system migrated from Python to C++
  • OpenCV processing integrated natively
  • Flutter connected through FFI
  • Optimizer migrated from Python to Dart

Current architecture:

Flutter Application

        |
        |

Native Measurement System
        |
        |
      OpenCV C++

        +

Dart Optimization Engine

        +

Three.js Visualization

Repository Structure

Current project organization:

OptiPack/
│ 
├── lib/
│   ├── backend/
│   │   ├── measurement_system/
│   │   └── optimizer/
│   │
│   ├── models/
│   ├── pages/
│   ├── services/
│   └── main.dart
│
├── assets/
│   └── visualizer/
│
├── android/
├── ios/
│
├── README.md
├── LICENSE
└── pubspec.yaml

Screenshots & Demonstrations

Complete Application Flow

[Application Demo GIF]

Measurement System

Input:

[Input Image]

Output:

[Annotated Measurement Result]

Optimization Result

Input:

[Container + Items]

Output:

[Optimized Placement]

Visualization

[3D Animation]

Future Improvements

Planned improvements include:

  • Local Three.js visualization instead of remote WebView hosting
  • Improved depth estimation techniques
  • Polygon-assisted measurement refinement
  • Real-time camera based measurement
  • Cloud synchronization
  • Multiple container optimization
  • Enhanced visualization capabilities

License

This project is licensed under the MIT License.

See the LICENSE file for details.


Author

Developed as a Final Year Project in Software Engineering.

OptiPack demonstrates the integration of:

  • Computer Vision
  • Computational Geometry
  • Evolutionary Algorithms
  • Mobile Application Development
  • Native System Integration

OptiPack — Transforming manual packing into intelligent optimization.

About

A mobile app that uses computer vision to scan and measure physical items and storage spaces, then calculates and visualizes the optimal arrangement for efficient organization in limited spaces.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages