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.
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.
Input Images
|
↓
Computer Vision Measurement
|
↓
Real World Dimensions
|
↓
Genetic Algorithm Optimizer
|
↓
Optimal 3D Placement Solution
|
↓
3D Visualization
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
Front Image
+
Side Image
+
Reference Object Information
Object Width
Object Height
Object Depth
Annotated Images
The optimizer searches for efficient object arrangements inside a container.
Implemented using:
- Genetic Algorithm
- 3D spatial representation
- Object orientation search
- Fitness-based evaluation
{
"container": {
"width": 30,
"height": 20,
"depth": 10
},
"items": [
{
"id": 1,
"dimensions": {
"width": 6,
"height": 6,
"depth": 2
}
}
]
}Item 1 → Position (x,y,z)
Item 2 → Position (x,y,z)
Item 3 → Position (x,y,z)
Maximum achievable space utilization
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
Setup Reference Object
↓
Scan Items
↓
Scan Storage Space
↓
Measurement System
↓
Optimization Engine
↓
3D Visualization
OptiPack consists of three major integrated subsystems.
Responsible for converting images into real-world dimensions.
Technology:
- C++
- OpenCV
- Dart FFI
- Flutter Native Integration
Responsible for finding efficient object placement.
Technology:
- Dart
- Genetic Algorithm
- 3D spatial search
Responsible for displaying the final packing solution.
Technology:
- Three.js
- JavaScript
- Web-based 3D rendering
| Technology | Purpose |
|---|---|
| Flutter | Cross-platform application framework |
| Dart | Application logic and native integration |
| Technology | Purpose |
|---|---|
| C++ | Native computer vision processing |
| OpenCV | Image processing and analysis |
| Dart FFI | Flutter-C++ communication |
| Technology | Purpose |
|---|---|
| Dart | Native optimizer implementation |
| Genetic Algorithm | Search for efficient packing solutions |
| Technology | Purpose |
|---|---|
| Three.js | 3D rendering |
| JavaScript | Visualization logic |
| WebView | Flutter integration |
OptiPack has evolved through multiple architectural improvements.
Initial implementation:
Flutter Application
|
|
HTTP Requests
|
|
Python Flask APIs
|
|
Measurement + Optimization Systems
The measurement system and optimizer were initially deployed as independent Python services.
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
Current project organization:
OptiPack/
│
├── lib/
│ ├── backend/
│ │ ├── measurement_system/
│ │ └── optimizer/
│ │
│ ├── models/
│ ├── pages/
│ ├── services/
│ └── main.dart
│
├── assets/
│ └── visualizer/
│
├── android/
├── ios/
│
├── README.md
├── LICENSE
└── pubspec.yaml
[Application Demo GIF]
Input:
[Input Image]
Output:
[Annotated Measurement Result]
Input:
[Container + Items]
Output:
[Optimized Placement]
[3D Animation]
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
This project is licensed under the MIT License.
See the LICENSE file for details.
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.




