How sproc01/8ballpool works
Main Components
• Input/Video Loader:
• Receives a video file path via command-line input.
• Responsible for reading the video and splitting it into frames.
• Preprocessing Pipeline:
• Manages frame extraction and any necessary pre-processing before analysis.
• Core Vision Modules:
• Detection Module (implemented in detection.cpp / detection.h): detects balls or objects on the pool table.
• Segmentation Module (segmentation.cpp / segmentation.h): performs segmentation of table regions, balls, etc.
• Table & Minimap Module (table.cpp, tableOrientation.cpp, minimap.h): analyzes table orientation and builds a minimap visualization.
• Tracking Module (tracking.cpp / tracking.h): tracks detected objects across frames.
• Performance & Metrics Engine:
• ComputePerformance, TestAllClip, and ShowSegmentationColored executables use modules such as metrics.cpp, util*.cpp, and compare against ground truth (from the Dataset) for computing IoU, AP, etc.
• Output Generator:
• Combines analysis results (detection, segmentation, minimap overlay) into an output video.
Relationships and Interactions
• Data Flow:
• The CLI input flows to the video loader.
• Frames pass through the preprocessing pipeline; then each frame is fed into the detection/segmentation/tracking modules.
• Detected/segmented results are passed to the table orientation and minimap modules, which compute and overlay additional information.
• Processed frames are aggregated into a final output video.
• Evaluation Flow:
• Test executables compare algorithm outputs with the ground truth files (located in the Dataset’s bounding_boxes, frames, and masks directories).
• This flow calculates metrics like mAP and mIoU and outputs performance reports.
• Support Structure:
• Common utilities, constants, and helper functions are defined in the include/ folder and used across the modules.
Architectural Patterns and Design Principles
• Modular Structure:
• Each functional aspect such as detection, segmentation, tracking, and table orientation is encapsulated in separate modules/libraries.
• Separation of Concerns:
• There is a clear division between the main processing pipeline (for video transformation and minimap augmentation) and the testing/performance analysis executables.
• Reusability and Extensibility:
• The structure (with separate “src” and “include” folders) allows individual modules to be updated or extended independently.
• Data-Driven Testing:
• Use of a well-organized Dataset folder indicates a design that supports robust evaluation.
• “CLI & Video Input” (front-end of the system).
• “Video Loader & Preprocessor” to represent the initial post–user input stage.
• “Detection Module” (with reference to detection source/header files).
• “Segmentation Module.”
• “Tracking Module.”
• “Table Orientation & Minimap Generator.”
• “Output Assembler & Video Writer.”
• “Performance & Metrics Evaluator” (for ComputePerformance, TestAllClip, etc.).
• “Dataset & Ground Truth” (as an input source for performance evaluation).
• Additional flows where the test executables pull ground truth data from the Dataset to their evaluation modules.
• External Dependencies:
• Notate that CMakeLists.txt handles the build, suggesting a build pipeline component.
• Labels: