# potato03kth/intel_l515_playground architecture

> Architecture diagram of the GitHub repository potato03kth/intel_l515_playground, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/potato03kth/intel_l515_playground
- Repository: https://github.com/potato03kth/intel_l515_playground

## Overview

##### Main System Components

The system should be divided into these primary components:
- Camera Integration Layer
- Image Processing Layer
- Point Cloud Processing Layer
- Utility Services Layer

##### Detailed Component Breakdown

a. Camera Integration Layer:
- Intel L515 LiDAR Interface (pyrealsense2)
- Webcam Interface (OpenCV)
- Camera Configuration Management
- Raw Data Capture

b. Image Processing Layer:
- Pre-processing Pipeline
- Red Channel Threshold Processing
- Dot Detection System
- Image Capture Storage

c. Point Cloud Processing Layer:
- Point Cloud Visualization
- Distance Processing
- 3D Data Rendering

d. Utility Services Layer:
- File Management
- Path Finding
- Testing Framework
- Configuration Management

##### Component Relationships

**Camera Integration Layer**
- ↓
**Image Processing Layer**
- ↓
**Point Cloud Processing Layer**
- ↓
**Data Storage/Output**

With cross-cutting concerns:
**Utility Services Layer**
- ↓
**[All Other Layers]**

##### Implementation Details

Specific file relationships:
- opencv_practice/cam.py → Camera handling
- opencv_practice/image_processing.py → Image processing
- opencv_practice/function_tool.py → Utility functions
- pyglet_pointcloud_viewer.py → Point cloud visualization

##### Integration points with external systems

This system design should reflect both the current implementation and allow for the planned extensions mentioned in the README, such as height-included distance measurements and additional sensor support.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Define styles
    classDef camera fill:#b3d9ff,stroke:#333,stroke-width:2px
    classDef image fill:#90EE90,stroke:#333,stroke-width:2px
    classDef pointcloud fill:#FFB366,stroke:#333,stroke-width:2px
    classDef utility fill:#E0E0E0,stroke:#333,stroke-width:2px
    classDef storage fill:#FFE6CC,stroke:#333,stroke-width:2px

    subgraph Camera["Camera Integration Layer"]
        CI[Camera Interface]:::camera
        L515[Intel L515 Interface]:::camera
        WC[Webcam Interface]:::camera
        CM[Camera Management]:::camera
    end
    click CI "https://github.com/potato03kth/intel_L515_playground/blob/main/opencv_practice/cam.py"

    subgraph Processing["Image Processing Layer"]
        PP[Pre-processing Pipeline]:::image
        RT[Red Channel Threshold]:::image
        DD[Dot Detection]:::image
        IC[Image Capture]:::image
        IS[(Image Storage)]:::storage
    end
    click PP "https://github.com/potato03kth/intel_L515_playground/blob/main/opencv_practice/image_processing.py"
    click RT "https://github.com/potato03kth/intel_L515_playground/blob/main/opencv_practice/pre_process_redchannal_threshold.py"
    click IS "https://github.com/potato03kth/intel_L515_playground/tree/main/opencv_practice/captured/"

    subgraph PointCloud["Point Cloud Processing Layer"]
        PCV[Point Cloud Viewer]:::pointcloud
        PGCV[Pyglet Cloud Viewer]:::pointcloud
        DP[Distance Processing]:::pointcloud
        DR[3D Rendering]:::pointcloud
    end
    click PCV "https://github.com/potato03kth/intel_L515_playground/blob/main/opencv_pointcloud_viewer.py"
    click PGCV "https://github.com/potato03kth/intel_L515_playground/blob/main/pyglet_pointcloud_viewer.py"
    click DP "https://github.com/potato03kth/intel_L515_playground/blob/main/distance_process_test.py"

    subgraph Utility["Utility Services Layer"]
        FM[File Management]:::utility
        PF[Path Finding]:::utility
        TF[Testing Framework]:::utility
        CFG[Configuration]:::utility
        IA[(Image Assets)]:::utility
    end
    click FM "https://github.com/potato03kth/intel_L515_playground/blob/main/opencv_practice/function_tool.py"
    click PF "https://github.com/potato03kth/intel_L515_playground/blob/main/modulePathFinder.py"
    click IA "https://github.com/potato03kth/intel_L515_playground/tree/main/opencv_practice/img/"

    %% Connections
    Camera --> Processing
    Processing --> PointCloud
    Processing --> IS
    
    Utility --> Camera
    Utility --> Processing
    Utility --> PointCloud

    %% Component Details
    CI --> L515
    CI --> WC
    L515 --> CM
    WC --> CM
    
    PP --> RT
    RT --> DD
    DD --> IC
    IC --> IS

    PCV --> DP
    PGCV --> DP
    DP --> DR

    %% Legend
    classDef legend fill:#f9f9f9,stroke:#333,stroke-width:1px
    subgraph Legend
        L1[Camera Components]:::camera
        L2[Image Processing]:::image
        L3[Point Cloud Processing]:::pointcloud
        L4[Utility Services]:::utility
        L5[(Storage Components)]:::storage
    end
```
