Objekterkennungsbibliothek fรผr SWENG25
Project description
SWENG25_ObjectPatternRecognizer_GrpA
A small Python application that uses a camera livestream to perform real-time object pattern recognition and color detection.
The main purpose of this project is to practice software engineering principles.
From our perspective, this includes:
- Collaborating as a team on a shared software project using a version control system (Git/GitHub).
- Writing proper documentation that is clear, structured, and maintainable.
- Implementing unit tests to ensure code quality and reliability.
๐ฆ Installation
You can install the latest version of the package from PyPI using:
pip install SWENG25-ObjectPatternRecognizer-GrpA
To install a specific version (for example, version 0.1.1):
pip install SWENG25-ObjectPatternRecognizer-GrpA==0.1.1
๐ Usage
Once installed, you can interact with the package through the command line interface (CLI):
sweng25-objectpatternrecognizer-grpa
โ ๏ธ Only Windows usage has been tested. Other operating systems may not work as expected.
Available Commands
The following command-line arguments are supported:
--config_path : str, optional
Path to the JSON configuration file.
Must be a valid .json file.
--source : {'camera', 'image'}, optional
Input source type. Determines whether the program processes a live camera feed or a static image.
--image_path : str, optional
Path to the image file used when --source=image.
Must be a valid .png, .jpg, or .jpeg file.
--camera_index : int, optional
Index of the camera device used when --source=camera.
Typically 0 for the default webcam.
--headless : flag, optional
If set, the application runs without GUI.
๐งโ๐ป Development Process and Community Rules
Our project follows a collaborative, learning-focused development workflow inspired by professional software engineering practices.
The goal is not only to build a functioning system, but also to practice team collaboration, version control, documentation, testing, and CI/CD workflows.
๐ฅ Team Responsibilities
| Member | Main Responsibilities |
|---|---|
| Lenard | Configuration management, logging system, and output handling (including text-to-speech and processed image export). |
| Sascha | Main orchestration logic and core image processing (pattern recognition, color detection). |
| Fabian | Continuous Integration / Continuous Deployment (CI/CD), graphical user interface (GUI), and project documentation. |
Each team member also writes unit tests for their components and contributes to code reviews.
๐ฟ Branching Model
We use a lightweight Git Flow model adapted to our small project size:
| Branch | Purpose |
|---|---|
main |
Stable, production-ready code. Only merged after full review and tests. |
development |
Integration branch for tested features. |
feature_<feature-name> |
Development of new features or bug fixes. |
doc_<topic> |
For documentation updates and diagrams. |
Branch Naming Convention
feature_<short-feature-name>
fix_<short-description>
doc_<topic>
Example:
feature_color-detection
fix_camera-stream-lag
doc_architecture-diagram
๐ Pull Request & Review Workflow
Every pull request follows a three-person approval rule:
- Developer A opens a PR for their feature/fix.
- Developer B reviews and comments.
- Developer C performs final approval and merges once CI/CD passes.
Each PR must include:
- Clear title and summary of changes
- Related issue link (if any)
- Unit test results or coverage info
- Updated documentation when applicable
๐งญ Pull Request Workflow Diagram
flowchart TD
A[Developer A<br/>creates Feature Branch] --> B[Implements & Commits Code]
B --> C[Opens Pull Request to development]
C --> D[Developer B Reviews PR]
D -->|Request Changes| B
D -->|Approve| E[Developer C Merges PR]
E --> F[CI/CD Pipeline Runs Tests]
F --> G{All Tests Passed?}
G -->|Yes| H[Merge to main]
G -->|No| I[Fix Issues and Reopen PR]
classDef devNode fill:#fef3c7,stroke:#b45309,color:#92400e,font-weight:bold;
classDef reviewNode fill:#dcfce7,stroke:#15803d,color:#166534,font-weight:bold;
classDef ciNode fill:#dbeafe,stroke:#1e40af,color:#1e3a8a,font-weight:bold;
classDef resultNode fill:#fef2f2,stroke:#b91c1c,color:#7f1d1d,font-weight:bold;
class A,B devNode
class D,E reviewNode
class F,G ciNode
class H,I resultNode
๐งช Testing and Quality Rules
- Unit tests for all modules in
/testsusingpytest. - Minimum one test per module.
๐๏ธ Repository Structure
SWENG25_ObjectPatternRecognizer_GrpA/
โ
โโโ .github/workflows/ # CI/CD configuration
โโโ doc/ # Developer & architecture docs
โโโ output/ # default output folder
โ
โโโ sweng25_objectpatternrecognizer_grpa/
โ โโโ __init__.py
โ โโโ main.py
โ โโโ gui/ # Graphical interface
โ โโโ image_processing/ # Pattern & color recognition
โ โโโ source_handler/ # Camera & file input handling
โ โโโ config_service/ # Configuration loading/saving
โ โโโ output_handler/ # Logs, speech, processed images
โ โโโ utils/ # Helper functions
โ โโโ cli.py # CLI entry point
โ
โโโ tests/ # Unit & integration tests
โโโ .gitignore
โโโ pyproject.toml
โโโ README.md
โโโ setup.py
๐บ๏ธ Architecture
The system is designed following the C4 Model, which provides a structured way to describe software architecture at different levels of abstraction. Given the simplicity of this system, we focus on the Context and Container views. It was just necessary to draw one Component view.
System Overview
The core system, called the Object Pattern Recognizer (OPR), is responsible for processing images from various sources, detecting patterns, and producing processed outputs. The system interacts with multiple external entities, including users, cameras, and image files.
At a high level:
- Users interact with the system through a graphical interface or directly via the main orchestration logic.
- Cameras and Image Files serve as the sources of input data.
- The system processes the data to generate Processed Images or Text to Speach.
- System behavior, configuration, and events are captured in Config Files and Log Files for tracking and reproducibility.
This interaction can be visualized in the following Context Diagram:
flowchart TD
user([User])
system[[Object Pattern Recognizer]]
camera([Camera])
imageFile([Images])
configFile([Config File])
logFile([Log File])
output([output])
user --> system
camera --> system
imageFile --> system
system --> logFile
system --> configFile
system --> output
configFile --> system
classDef userNode fill: #fef3c7,stroke: #b45309,color: #92400e,font-weight:bold;
classDef inputNode fill: #dcfce7,stroke: #15803d,color: #166534,font-weight:bold;
classDef systemNode fill: #dbeafe,stroke: #1e40af,color: #1e3a8a,font-size:16px,font-weight:bold;
classDef outputNode fill: #fef2f2,stroke: #b91c1c,color: #7f1d1d,font-weight:bold;
class user userNode
class camera,imageFile inputNode
class system systemNode
class logFile,configFile,output outputNode
Internal Structure
Internally, the Object Pattern Recognizer is composed of several components, each with a distinct responsibility:
- GUI (Graphical User Interface) โ Provides a user-friendly interface for interacting with the system, including starting processing tasks and viewing results.
- Main โ Acts as the orchestration layer, coordinating the flow of data between input sources, processing modules, and outputs.
- image_processing โ Handles all image analysis and processing tasks, including pattern recognition and feature extraction.
- source_handler โ Manages data acquisition from cameras and image files, ensuring that inputs are correctly formatted for processing.
- config_service โ Reads and saves configuration settings, allowing the system to operate flexibly across different environments.
- output_handler โ Captures runtime events and system actions for debugging, monitoring, and audit purposes.
The relationships between these components and the user are shown in the Container Diagram below:
flowchart TD
user([User])
cam([Camera])
img([Image])
subgraph OPR["Object Pattern Recognition"]
gui([GUI<br/>Handles user interaction])
main([main<br/>Core orchestration logic])
imgProc([image_processing<br/>Image processing module])
sources([source_handler<br/>Handles camera and image input])
output([output_handler<br>creats log, text to speach and processed images])
config([config_service<br/>Loads and saves configuration])
end
user --> gui
user --> main
gui --> main
main --> sources
main --> imgProc
main --> config
main --> output
cam --> sources
img --> sources
classDef userNode fill: #fef3c7,stroke: #b45309,color: #92400e,font-weight:bold;
classDef inputNode fill: #dcfce7,stroke: #15803d,color: #166534,font-weight:bold;
classDef systemNode fill: #dbeafe,stroke: #1e40af,color: #1e3a8a,font-size:16px,font-weight:bold;
classDef outputNode fill: #fef2f2,stroke: #b91c1c,color: #7f1d1d,font-weight:bold;
class user userNode
class sources,img,cam inputNode
class gui,main,imgProc systemNode
class config,output outputNode
Output Handler
The output handler shown below contains multiple services, which are shown in the Component Diagram below.
flowchart TD
main([main])
%% verry uggly indet, better solutions welcome!
subgraph OPR[" output_handler"]
tts([tts_service<br>text to speach])
log([log_service])
image([image_service<br>saves processed images])
end
main --> image
main --> tts
main --> log
classDef systemNode fill: #dbeafe,stroke: #1e40af,color: #1e3a8a,font-size:16px,font-weight:bold;
classDef outputNode fill: #fef2f2,stroke: #b91c1c,color: #7f1d1d,font-weight:bold;
class main systemNode
class image,tts,log outputNode
Summary
The architecture ensures a clear separation of concerns:
- Input handling is managed by the Sources component.
- Processing is encapsulated in image_processing.
- Orchestration is centralized in Main.
- User interaction is provided by the GUI.
- Configuration and logging are handled by dedicated components, ensuring maintainability and traceability.
This modular structure allows the system to be easily extended or modified, for example by adding new image processing algorithms or supporting additional input sources, without impacting the rest of the architecture.
๐งพ Additional Information
For more details, visit the project repository on GitHub:
๐ SWENG25_ObjectPatternRecognizer_GrpA
Developer-specific documentation and setup guides can be found in the /doc folder.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sweng25_objectpatternrecognizer_grpa-1.1.0.tar.gz.
File metadata
- Download URL: sweng25_objectpatternrecognizer_grpa-1.1.0.tar.gz
- Upload date:
- Size: 118.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16a4ca7f5e4c7343574df9a42cb4c854e29c8d4b1f6b8413d3f27f65acbcb46b
|
|
| MD5 |
af334f5c06753a20ad7615484f496c9a
|
|
| BLAKE2b-256 |
b9a630488246e9015c28d3251a58ca89dc74fb6ee124a11b1c8631d22d5fa4da
|
Provenance
The following attestation bundles were made for sweng25_objectpatternrecognizer_grpa-1.1.0.tar.gz:
Publisher:
CI_deploy_toPyPI.yml on codemonk8/SWENG25_ObjectPatternRecognizer_GrpA
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sweng25_objectpatternrecognizer_grpa-1.1.0.tar.gz -
Subject digest:
16a4ca7f5e4c7343574df9a42cb4c854e29c8d4b1f6b8413d3f27f65acbcb46b - Sigstore transparency entry: 732844649
- Sigstore integration time:
-
Permalink:
codemonk8/SWENG25_ObjectPatternRecognizer_GrpA@1f729a9a8979445c83486eaa410a5248ecf458cf -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/codemonk8
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
CI_deploy_toPyPI.yml@1f729a9a8979445c83486eaa410a5248ecf458cf -
Trigger Event:
push
-
Statement type:
File details
Details for the file sweng25_objectpatternrecognizer_grpa-1.1.0-py3-none-any.whl.
File metadata
- Download URL: sweng25_objectpatternrecognizer_grpa-1.1.0-py3-none-any.whl
- Upload date:
- Size: 119.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8f4fab948a400986984c83eb83ea808a38017becf682666378d95b409d7cf5e
|
|
| MD5 |
b6f02787b1b599b9517ee27793be4602
|
|
| BLAKE2b-256 |
009d0e2401246f02d450f9a7325e8606309c1cbb687591149319bbd31c2cb0a0
|
Provenance
The following attestation bundles were made for sweng25_objectpatternrecognizer_grpa-1.1.0-py3-none-any.whl:
Publisher:
CI_deploy_toPyPI.yml on codemonk8/SWENG25_ObjectPatternRecognizer_GrpA
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sweng25_objectpatternrecognizer_grpa-1.1.0-py3-none-any.whl -
Subject digest:
d8f4fab948a400986984c83eb83ea808a38017becf682666378d95b409d7cf5e - Sigstore transparency entry: 732844653
- Sigstore integration time:
-
Permalink:
codemonk8/SWENG25_ObjectPatternRecognizer_GrpA@1f729a9a8979445c83486eaa410a5248ecf458cf -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/codemonk8
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
CI_deploy_toPyPI.yml@1f729a9a8979445c83486eaa410a5248ecf458cf -
Trigger Event:
push
-
Statement type: