# sefakurtipek/fdsst_tracking architecture

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

- Interactive diagram: https://gitdiagram.com/sefakurtipek/fdsst_tracking
- Repository: https://github.com/sefakurtipek/fdsst_tracking

## Overview

##### Project type and purpose
- This is a single-executable C++ computer-vision application implementing the Fast Discriminative Scale Space Tracking (fDSST) algorithm.

##### File structure
- Top-level C++ source and header files:
- main.cpp – entry point, parses user input (frames, video, webcam) and drives the tracker
- FDSSTTracker.cpp/.hpp – core tracker class managing initialization, feature extraction, model update, and scale estimation
- fhog_fDSST.* – HOG feature extraction module
- ffttools_fDSST.hpp – FFT routines for fast correlation and scale space computation
- labdata_fDSST.hpp – data structures for loading ground-truth or labelling data
- SSE2NEON.h, sse.hpp – SIMD abstraction layer supporting both x86 SSE2 and ARM NEON optimizations
- Visual Studio solution files (.sln, .vcxproj) indicate a Windows build environment.
- dataset/ holds test sequences and ground-truth files.

##### README for additional insights
- Confirms algorithm purpose: fDSST tracking in C++
- Mentions that main.cpp was extended to handle different input sources
- Instructs the user to adjust file paths for input data

a. Main components
- Input Manager – handles frame sources (image folder, video file, webcam)
- Tracker Engine – encapsulates FDSSTTracker class
– Correlation & Scale Estimation (uses ffttools_fDSST)
– Model Update (online adaptation of target appearance)
- Utilities
– Geometry Utils (recttools, iou, centerPointDistance)
– Data Structures (labdata_fDSST)
– SIMD Layer (SSE2NEON, sse.hpp)
- Dataset Loader – reads dataset/groundtruth.txt and frame lists for benchmarking

b. Relationships and interactions
- The Input Manager feeds raw frames into the Tracker Engine
- Tracker Engine calls the SIMD Layer during feature extraction for performance
- Feature Extraction and FFT modules interact tightly within the Tracker Engine
- Geometry Utils are invoked by the Tracker Engine to compute overlaps, distances
- Output Module subscribes to Tracker Engine events and writes results or overlays

c. Architectural patterns and principles
- Modular decomposition: separate files for each responsibility (features, FFT, tracking logic, utilities)
- Data flow pipeline: Input → Preprocessing → Feature Extraction → Tracking Estimation → Model Update → Output
- Abstraction of hardware optimizations via SIMD layer for portability and maintainability

d. Key technologies and libraries
- C++11 or later (for standard library containers and algorithms)
- FFT routines (in-house ffttools_fDSST)
- HOG descriptor implementation (fhog_fDSST)
- SIMD abstraction (SSE2NEON for cross-platform vectorization)
- Visual Studio build system (.sln, .vcxproj)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Data Sources/Sinks"
        InputManager["Input Manager"]:::dataSource
        DatasetLoader["Dataset Loader"]:::dataSource
        OutputModule["Output Module"]:::dataSource
    end

    subgraph "Core Processing"
        TrackerEngine["Tracker Engine"]:::core
        FeatureExtraction["Feature Extraction (HOG)"]:::core
        FFT["Correlation & Scale Estimation (FFT)"]:::core
        ModelUpdate["Model Update & Tracking Logic"]:::core
    end

    subgraph "Utilities"
        SIMD["SIMD Abstraction Layer"]:::util
        subgraph "Geometry Utilities"
            BoundingTools["Bounding-box Tools"]:::util
            IoU["Intersection-over-Union"]:::util
            Distance["Center-point Distance"]:::util
        end
    end

    subgraph "Build System"
        Solution["fDSST_Tracking.sln"]:::external
        VSProject["Visual Studio Project"]:::external
    end

    InputManager -->|"Raw Frame"| TrackerEngine
    DatasetLoader -->|"Frame List / Ground-truth"| TrackerEngine
    TrackerEngine -->|"Feature Requests"| FeatureExtraction
    FeatureExtraction -->|"HOG Vectors"| FFT
    TrackerEngine -->|"Scale Estimation"| FFT
    FFT -->|"Scale Info"| TrackerEngine
    TrackerEngine -->|"Model Data"| ModelUpdate
    TrackerEngine -->|"Bounding Box"| OutputModule
    TrackerEngine -->|"Compute Overlap"| BoundingTools
    TrackerEngine -->|"Compute IoU"| IoU
    TrackerEngine -->|"Compute Distance"| Distance
    FeatureExtraction -->|"Optimized Ops"| SIMD
    ModelUpdate -->|"Vector Ops"| SIMD

    Solution --> VSProject

    click InputManager "https://github.com/sefakurtipek/fdsst_tracking/blob/master/main.cpp"
    click OutputModule "https://github.com/sefakurtipek/fdsst_tracking/blob/master/main.cpp"
    click TrackerEngine "https://github.com/sefakurtipek/fdsst_tracking/blob/master/FDSSTTracker.cpp"
    click FeatureExtraction "https://github.com/sefakurtipek/fdsst_tracking/blob/master/fhog_fDSST.cpp"
    click FFT "https://github.com/sefakurtipek/fdsst_tracking/blob/master/ffttools_fDSST.hpp"
    click ModelUpdate "https://github.com/sefakurtipek/fdsst_tracking/blob/master/tracker.h"
    click BoundingTools "https://github.com/sefakurtipek/fdsst_tracking/blob/master/recttools_fDSST.hpp"
    click IoU "https://github.com/sefakurtipek/fdsst_tracking/blob/master/iou.cpp"
    click Distance "https://github.com/sefakurtipek/fdsst_tracking/blob/master/centerPointDistance.cpp"
    click SIMD "https://github.com/sefakurtipek/fdsst_tracking/blob/master/SSE2NEON.h"
    click DatasetLoader "https://github.com/sefakurtipek/fdsst_tracking/tree/master/dataset/"
    click Solution "https://github.com/sefakurtipek/fdsst_tracking/blob/master/fDSST_Tracking.sln"
    click VSProject "https://github.com/sefakurtipek/fdsst_tracking/blob/master/fDSST_Tracking.vcxproj"

    classDef dataSource fill:#add8e6,stroke:#000;
    classDef core fill:#90ee90,stroke:#000;
    classDef util fill:#ffff99,stroke:#000;
    classDef external fill:#d3d3d3,stroke:#000;
```
