# twoo0220/lane_detection_camera_pose architecture

> Architecture diagram of the GitHub repository twoo0220/lane_detection_camera_pose, 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/twoo0220/lane_detection_camera_pose
- Repository: https://github.com/twoo0220/lane_detection_camera_pose

## Overview

Project Type: Computer Vision Application
This is a specialized computer vision application focused on lane detection and camera pose estimation (extrinsic calibration).

##### Input Layer
- Image Input Component
- Image folder as a data source
- Supported image formats

##### Processing Pipeline

a. Lane Detection Module (Lane_detector.py)
- Connection to the FastAI model (model/fastai_model.pth)
- Lane segmentation processing steps

b. Camera Geometry Module (Camera_geometry.py)
- Vanishing point calculation
- Extrinsic parameter estimation
- Coordinate transformation

c. Main Orchestrator (main.py)
- How it coordinates the workflow between components

##### Model Component
- FastAI model representation
- Model input/output specifications
- Integration with the lane detection pipeline

- [Image Input] → [Lane Detection] → [Camera Geometry] → [Output]

##### Component Details
- Input/output specifications for each module
- Parameters and configurations
- Dependencies between components

##### Technical Specifications
- Python dependencies (OpenCV, PyTorch, FastSeg)
- Version requirements (e.g., numpy 1.26.4)

Specific Recommendations:

- Data input/output operations
- Image processing pipeline
- Geometric calculations
- Machine learning inference

- Lane detection algorithm steps
- Camera calibration process
- Coordinate system transformations

Level of Detail:
- Configuration parameters without overwhelming detail
- Interaction between components rather than internal implementations

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Legend
        direction TB
        A[Process]:::process --- B[(Data Storage)]:::storage
        C[/Input/Output/]:::io --- D{{ML Component}}:::ml
    end

    subgraph "Input Layer"
        direction TB
        IMG[/Image Input/]:::io
        IMGF[(Image Folder)]:::storage
    end

    subgraph "Processing Pipeline"
        direction TB
        LD[Lane Detection]:::process
        CG[Camera Geometry]:::process
        MAIN[Main Orchestrator]:::process
    end

    subgraph "Model Component"
        direction TB
        FM{{FastAI Model}}:::ml
        MP[(Model Parameters)]:::storage
    end

    %% Main Flow
    IMG --> IMGF
    IMGF --> MAIN
    MAIN --> LD
    LD --> FM
    FM --> LD
    LD --> CG
    
    %% Component Details
    IMGF -- "Supported Formats:|.jpg|.png" --> LD
    LD -- "Lane Segmentation" --> CG
    CG -- "Vanishing Point|Extrinsic Parameters" --> MAIN
    FM -- "Inference" --> LD
    MP --> FM

    %% Click Events
    click IMG "https://github.com/twoo0220/lane_detection_camera_pose/tree/main/image"
    click LD "https://github.com/twoo0220/lane_detection_camera_pose/blob/main/code/Lane_detector.py"
    click CG "https://github.com/twoo0220/lane_detection_camera_pose/blob/main/code/Camera_geometry.py"
    click MAIN "https://github.com/twoo0220/lane_detection_camera_pose/blob/main/code/main.py"
    click FM "https://github.com/twoo0220/lane_detection_camera_pose/blob/main/model/fastai_model.pth"

    %% Styling
    classDef process fill:#90EE90,stroke:#333,stroke-width:2px
    classDef storage fill:#D3D3D3,stroke:#333,stroke-width:2px
    classDef io fill:#87CEEB,stroke:#333,stroke-width:2px
    classDef ml fill:#FFD700,stroke:#333,stroke-width:2px
```
