# gilbertfrancois/object-color-tracker architecture

> Architecture diagram of the GitHub repository gilbertfrancois/object-color-tracker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gilbertfrancois/object-color-tracker
- Repository: https://github.com/gilbertfrancois/object-color-tracker

## Overview

Object Color Tracker is a desktop camera app that turns a user-calibrated object’s color into normalized position and size features for expressive control, including use as Wekinator input. Its main workflow is camera capture, color-range calibration and blob detection, then cursor/trail display and feature output. The graph separates those domain stages from controls and tracking state. The excerpts show camera setup, GUI configuration and tracking state, but omit parts of the frame-processing and OSC-send implementations; those relationships are documented or marked unverified accordingly.

Main entry points: [`src/ofApp.cpp`](https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/ofApp.cpp) (Control Center), [`src/main.cpp`](https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/main.cpp) (App Entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Camera Input"]
  node_main["App Entry<br/>[main.cpp]"]
  node_app["App Runtime<br/>[ofApp.cpp]"]
  node_capture_device["Camera Capture<br/>[ofApp.cpp]"]
end

subgraph group_vision["Color Tracking"]
  node_calibration["Color Calibration<br/>[ofApp.cpp]"]
  node_segmentation["Color Segmentation<br/>[ofApp.cpp]"]
  node_blob_detection["Blob Detection<br/>[ofApp.cpp]"]
  node_tracking["Position and Size<br/>[ofApp.cpp]"]
  node_smoothing["Motion Smoothing<br/>[ofApp.cpp]"]
end

subgraph group_interaction["Controls and Display"]
  node_controls["Control Center<br/>[ofApp.cpp]"]
  node_visualization["Preview and Overlays<br/>[ofApp.cpp]"]
end

subgraph group_output["Feature Output"]
  node_osc["OSC Sender<br/>[ofApp.cpp]"]
end

node_user(("User"))
node_camera["Camera"]
node_wekinator["Wekinator or Receiver"]

node_user -->|"calibrates and configures"| node_controls
node_main -->|"starts"| node_app
node_app -->|"sets up"| node_capture_device
node_camera -.->|"provides frames"| node_capture_device
node_controls -->|"sets color range"| node_calibration
node_capture_device -.->|"supplies image"| node_segmentation
node_calibration -->|"defines accepted range"| node_segmentation
node_segmentation -.->|"finds blobs"| node_blob_detection
node_blob_detection -->|"selects largest blob"| node_tracking
node_tracking -->|"updates position buffer"| node_smoothing
node_user -->|"chooses camera and display"| node_controls
node_controls -->|"selects camera"| node_capture_device
node_tracking -.->|"draws cursor and trail"| node_visualization
node_smoothing -.->|"provides features"| node_osc
node_osc -.->|"sends features"| node_wekinator

click node_main "https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/main.cpp"
click node_app "https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/ofApp.cpp"
click node_capture_device "https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/ofApp.cpp"
click node_calibration "https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/ofApp.cpp"
click node_segmentation "https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/ofApp.cpp"
click node_blob_detection "https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/ofApp.cpp"
click node_tracking "https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/ofApp.cpp"
click node_smoothing "https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/ofApp.cpp"
click node_controls "https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/ofApp.cpp"
click node_visualization "https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/ofApp.cpp"
click node_osc "https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/ofApp.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_app,node_capture_device,node_user toneBlue
class node_calibration,node_segmentation,node_blob_detection,node_tracking,node_smoothing toneAmber
class node_controls,node_visualization toneMint
class node_osc toneRose
class node_camera,node_wekinator toneIndigo
```

## Components

### Camera Input

- [App Entry](https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/main.cpp): `src/main.cpp`
- [App Runtime](https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/ofApp.cpp): `src/ofApp.cpp`
- [Camera Capture](https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/ofApp.cpp): `src/ofApp.cpp`

### Color Tracking

- [Color Calibration](https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/ofApp.cpp): `src/ofApp.cpp`
- [Color Segmentation](https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/ofApp.cpp): `src/ofApp.cpp`
- [Blob Detection](https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/ofApp.cpp): `src/ofApp.cpp`
- [Position and Size](https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/ofApp.cpp): `src/ofApp.cpp`
- [Motion Smoothing](https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/ofApp.cpp): `src/ofApp.cpp`

### Controls and Display

- [Control Center](https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/ofApp.cpp): `src/ofApp.cpp`
- [Preview and Overlays](https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/ofApp.cpp): `src/ofApp.cpp`

### Feature Output

- [OSC Sender](https://github.com/gilbertfrancois/object-color-tracker/blob/master/src/ofApp.cpp): `src/ofApp.cpp`

### Other components

- **User**
- **Camera**
- **Wekinator or Receiver**

## Connections

- User → Control Center: calibrates and configures (evidence: `README.md`)
- App Entry → App Runtime: starts (evidence: `src/main.cpp`)
- App Runtime → Camera Capture: sets up (evidence: `src/ofApp.cpp`)
- Camera → Camera Capture: provides frames
- Control Center → Color Calibration: sets color range (evidence: `README.md`)
- Camera Capture → Color Segmentation: supplies image (evidence: `src/ofApp.cpp`)
- Color Calibration → Color Segmentation: defines accepted range (evidence: `README.md`)
- Color Segmentation → Blob Detection: finds blobs (evidence: `src/ofApp.cpp`)
- Blob Detection → Position and Size: selects largest blob (evidence: `README.md`)
- Position and Size → Motion Smoothing: updates position buffer (evidence: `src/ofApp.cpp`)
- User → Control Center: chooses camera and display (evidence: `README.md`)
- Control Center → Camera Capture: selects camera (evidence: `src/ofApp.cpp`)
- Position and Size → Preview and Overlays: draws cursor and trail (evidence: `src/ofApp.cpp`)
- Motion Smoothing → OSC Sender: provides features (evidence: `src/ofApp.cpp`)
- OSC Sender → Wekinator or Receiver: sends features
