A Python library for recognizing geometric shapes from noisy measurement data, developed as part of the Algebraic Structures course (2IMA10) of the University of Technology of Eindhoven.
This project implements algorithms for identifying:
- Right-angled triangles from measured side lengths
- Regular n-gons from vertex coordinates (two methods: angular sorting and power sum invariants)
All recognizers account for bounded measurement error using mathematically derived tolerance bounds.
├── src/shape_recognizer/ # Main package
│ ├── geometry.py # Point2D, ShapeData models
│ ├── main.py # CLI entry point
│ ├── utils.py # Data loading utilities
│ └── recognizers/ # Recognition algorithms
│ ├── base.py # Abstract base class
│ ├── triangle.py # Right triangle recognizer
│ └── polygon.py # Regular polygon recognizers
├── tests/ # Unit tests (pytest)
├── Docs/ # Documentation
└── report/ # Project report
# Install
pip install -e .
pip install -r requirements.txt
# Run CLI
python -m src.shape_recognizer.main --help
# Run tests
pytest| Document | Description |
|---|---|
Docs/USAGE.md |
Installation and usage guide |
Docs/recognizing_shapes.md |
Original project assignment |
Docs/contracts.md |
Coding principles and design contracts |
report/report.md |
Full project report with mathematical foundations |
See LICENSE.txt.