# prophesee-ai/openeb architecture

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

- Interactive diagram: https://gitdiagram.com/prophesee-ai/openeb
- Repository: https://github.com/prophesee-ai/openeb

## Overview

##### Main Components
a. Hardware & Plugins: At the very bottom, show the “event-based cameras” and associated “camera plugins” (located under hal_psee_plugins). These components abstract the real hardware into a uniform interface.
b. HAL (Hardware Abstraction Layer): Represented as a module (under the “hal” directory) that encapsulates device discovery, connection, and low-level data decoding. This layer directly communicates with the camera plugins/hardware.
c. Base Module: This component (found under sdk/modules/base) provides foundational definitions, common data structures, and utility functions that are used across the stack.
d. Core & Core ML Modules: These modules (found under sdk/modules/core and sdk/modules/core_ml) host the algorithms and pipelines for processing, visualization, manipulation, and machine learning operations (e.g. event conversion pipelines, event-to-video and video-to-event processing).
e. Stream Module: This higher-level abstraction (located in sdk/modules/stream) builds atop HAL – it provides easy-to-use interfaces for event-based data streaming and manipulation.
f. UI Module: The UI (found under sdk/modules/ui) encompasses the viewer and the display controllers that enable interactive display of events.
g. Bindings & Samples: Note that there are Python bindings (across hal/python, sdk/modules/*/python, and others) and sample applications (in directories like hal/cpp/samples, standalone_samples, etc.) that make the functionalities accessible via different languages.
h. Build & Testing Infrastructure: Don’t forget to mark the significance of CMake-based build scripts, custom modules (e.g. in the “cmake” and “utils” directories), and the extensive test suite. These are crucial architectural elements ensuring modularity, cross-platform support (Linux/Windows), and code quality.

b. From Core, branch the flow into two paths – one toward visualization and utilities (Core) and another toward machine learning pipelines (Core ML).
c. That the Stream module sits on top of HAL and Core, offering a user-friendly API for processing and interacting with the data.
d. Finally, indicate that UI components consume data processed through the Stream (and in some instances Core) modules to display a live or recorded event-based stream.
e. Bindings (Python and possibly others) as an interfacing layer that hooks into both the lower-level C++ libraries and the high-level application code.

##### Architectural Patterns & Design Principles
a. Layered and modular design – each module (HAL, Base, Core, Core ML, Stream, UI) is loosely coupled but interacts via well-defined APIs.
b. That the build system (CMake) ties the whole project together and facilitates multi-platform compilation along with dependency management (through subdirectories like cmake, vcpkg toolchain, etc.).
c. Separation between device-level details (HAL and camera plugins) and algorithm/application logic (Core, Core ML, and UI).
d. Mention that extensibility is built-in: camera manufacturers can integrate their own plugins and creators can develop custom processing pipelines.

##### Relevant Technologies and Frameworks
a. C++ (primary language for core libraries and performance-critical components)
b. Python bindings (using pybind11, enabling easy scripting and prototyping)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Device Layer
    subgraph "Device Layer"
        CB["Event-Based Cameras"]:::device
        CP["Camera Plugins"]:::device
    end

    %% Hardware Abstraction Layer
    subgraph "Hardware Abstraction Layer"
        HAL["HAL"]:::hal
    end

    %% Core Processing Layer
    subgraph "Core Processing"
        BASE["Base Module"]:::core
        CORE["Core Module"]:::core
        COREML["Core ML Module"]:::core
    end

    %% Application Layer
    subgraph "Application Layer"
        STREAM["Stream Module"]:::app
        UI["UI Module"]:::app
    end

    %% Supporting Modules
    BIND["Python Bindings & Samples"]:::binding
    BUILD["Build & Testing Infrastructure"]:::build

    %% Connections: Device Layer to HAL
    CB --> CP
    CP --> HAL

    %% Connections: HAL to Core Processing
    HAL --> BASE
    HAL --> CORE
    BASE --> CORE
    CORE --> COREML

    %% Connections: Core Processing to Application Layer
    CORE --> STREAM
    COREML --> STREAM
    STREAM --> UI

    %% Dashed connections from Python Bindings & Samples
    BIND -.-> HAL
    BIND -.-> BASE
    BIND -.-> CORE
    BIND -.-> COREML
    BIND -.-> UI

    %% Dashed connections from Build & Testing Infrastructure
    BUILD -.-> HAL
    BUILD -.-> BASE
    BUILD -.-> CORE
    BUILD -.-> COREML
    BUILD -.-> STREAM
    BUILD -.-> UI

    %% Click Events
    click CP "https://github.com/prophesee-ai/openeb/tree/main/hal_psee_plugins"
    click HAL "https://github.com/prophesee-ai/openeb/tree/main/hal"
    click BASE "https://github.com/prophesee-ai/openeb/tree/main/sdk/modules/base"
    click CORE "https://github.com/prophesee-ai/openeb/tree/main/sdk/modules/core"
    click COREML "https://github.com/prophesee-ai/openeb/tree/main/sdk/modules/core_ml"
    click STREAM "https://github.com/prophesee-ai/openeb/tree/main/sdk/modules/stream"
    click UI "https://github.com/prophesee-ai/openeb/tree/main/sdk/modules/ui"
    click BIND "https://github.com/prophesee-ai/openeb/tree/main/hal/python/bindings"
    click BUILD "https://github.com/prophesee-ai/openeb/tree/main/cmake"

    %% Styles
    classDef device fill:#cce5ff,stroke:#0066cc,stroke-width:2px;
    classDef hal fill:#ffcc99,stroke:#ff9900,stroke-width:2px;
    classDef core fill:#ccffcc,stroke:#339933,stroke-width:2px;
    classDef app fill:#ffcccc,stroke:#cc0000,stroke-width:2px;
    classDef binding fill:#e6ccff,stroke:#9933ff,stroke-width:2px;
    classDef build fill:#ffffcc,stroke:#cccc00,stroke-width:2px;
```
