# vedantnitt27/fast_corner_detection architecture

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

- Interactive diagram: https://gitdiagram.com/vedantnitt27/fast_corner_detection
- Repository: https://github.com/vedantnitt27/fast_corner_detection

## Overview

This repository implements FPGA-accelerated FAST corner detection, with Python host tools for receiving, visualizing, and evaluating results. The principal workflow is grayscale image data in FPGA memory, streamed through windowing and threshold/corner logic, then sent as coordinates over UART for host display or evaluation. README documents fixed, global-adaptive, and local-adaptive thresholds, NMS, and multiple image sizes. RTL wiring was not excerpted, so hardware relationships below follow the README’s documented pipeline; host-side evidence is limited to the shown Python excerpts.

Main entry points: [`Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/fast_detector.v`](https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/fast_detector.v) (FAST Detector), [`Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/sliding_window.v`](https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/sliding_window.v) (Sliding Window), [`Python/evaluate.py`](https://github.com/vedantnitt27/fast_corner_detection/blob/main/Python/evaluate.py) (Detection Evaluation), [`Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/image_rom.v`](https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/image_rom.v) (Image Memory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_hardware["FPGA Detection"]
  node_top["Top Controller<br/>[Top_module.v]"]
  node_rom["Image Memory<br/>[image_rom.v]"]
  node_stream["Pixel Stream"]
  node_buffer["Line Buffer<br/>[line_buffer.v]"]
  node_window["Sliding Window<br/>[sliding_window.v]"]
  node_threshold["Threshold Logic"]
  node_mean["Mean Calculator<br/>[mean_calculator.v]"]
  node_score["Corner Scoring<br/>[corner_score.v]"]
  node_detector["FAST Detector<br/>[fast_detector.v]"]
  node_detector_local["Local Detector"]
  node_uart["UART Transmitter<br/>[uart_tx.v]"]
end

subgraph group_host["Host Visualization"]
  node_receiver["UART Receiver<br/>[uart_receive.py]"]
  node_visualizer["Corner Visualization"]
end

subgraph group_evaluation["Evaluation"]
  node_evaluator["Detection Evaluation<br/>[evaluate.py]"]
  node_cpu_fast["CPU FAST Reference<br/>[cpu_fast.py]"]
end

subgraph group_inputs["Image Inputs"]
  node_image_files["Image Data"]
  node_ground_truth["Ground Truth"]
  node_image_convert["Image Conversion"]
end

node_user(("Operator"))
node_hostpc(("Host PC"))

node_user -->|"views results"| node_hostpc
node_image_files -->|"loads pixels"| node_rom
node_top -->|"reads image"| node_rom
node_rom -->|"streams pixels"| node_stream
node_stream -->|"buffers pixels"| node_buffer
node_buffer -->|"forms windows"| node_window
node_window -->|"provides neighborhoods"| node_detector
node_threshold -->|"provides threshold"| node_detector
node_mean -.->|"computes mean"| node_threshold
node_window -.->|"scores corners"| node_score
node_score -.->|"provides score"| node_detector
node_detector -.->|"local variant"| node_detector_local
node_detector -->|"sends coordinates"| node_uart
node_uart -->|"transmits UART"| node_hostpc
node_hostpc -->|"receives packets"| node_receiver
node_receiver -.->|"renders corners"| node_visualizer
node_hostpc -->|"evaluates detections"| node_evaluator
node_evaluator -->|"reads labels"| node_ground_truth
node_evaluator -->|"displays results"| node_visualizer
node_user -.->|"prepares images"| node_image_convert
node_image_convert -->|"writes HEX"| node_image_files
node_user -.->|"runs reference"| node_cpu_fast

click node_top "https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/Top_module.v"
click node_rom "https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/image_rom.v"
click node_stream "https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/coordinate_generator.v"
click node_buffer "https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/line_buffer.v"
click node_window "https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/sliding_window.v"
click node_threshold "https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/threshold_generator.v"
click node_mean "https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/mean_calculator.v"
click node_score "https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/corner_score.v"
click node_detector "https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/fast_detector.v"
click node_detector_local "https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/fast_detector_local.v"
click node_uart "https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/uart_tx.v"
click node_receiver "https://github.com/vedantnitt27/fast_corner_detection/blob/main/Python/uart_receive.py"
click node_visualizer "https://github.com/vedantnitt27/fast_corner_detection/blob/main/Python/uart_receive_NMS256.py"
click node_evaluator "https://github.com/vedantnitt27/fast_corner_detection/blob/main/Python/evaluate.py"
click node_cpu_fast "https://github.com/vedantnitt27/fast_corner_detection/blob/main/Python/cpu_fast.py"
click node_image_files "https://github.com/vedantnitt27/fast_corner_detection/tree/main/Image"
click node_ground_truth "https://github.com/vedantnitt27/fast_corner_detection/tree/main/Dataset_256/Ground%20Truth"
click node_image_convert "https://github.com/vedantnitt27/fast_corner_detection/blob/main/Image/image_conversion.py"

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_top,node_rom,node_stream,node_buffer,node_window,node_threshold,node_mean,node_score,node_detector,node_detector_local,node_uart toneBlue
class node_receiver,node_visualizer toneAmber
class node_evaluator,node_cpu_fast toneMint
class node_image_files,node_ground_truth,node_image_convert toneRose
class node_user,node_hostpc toneIndigo
```

## Components

### FPGA Detection

- [Top Controller](https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/Top_module.v): `Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/Top_module.v`
- [Image Memory](https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/image_rom.v): `Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/image_rom.v`
- [Pixel Stream](https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/coordinate_generator.v): `Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/coordinate_generator.v`
- [Line Buffer](https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/line_buffer.v): `Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/line_buffer.v`
- [Sliding Window](https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/sliding_window.v): `Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/sliding_window.v`
- [Threshold Logic](https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/threshold_generator.v): `Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/threshold_generator.v`
- [Mean Calculator](https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/mean_calculator.v): `Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/mean_calculator.v`
- [Corner Scoring](https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/corner_score.v): `Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/corner_score.v`
- [FAST Detector](https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/fast_detector.v): `Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/fast_detector.v`
- [Local Detector](https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/fast_detector_local.v): `Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/fast_detector_local.v`
- [UART Transmitter](https://github.com/vedantnitt27/fast_corner_detection/blob/main/Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/uart_tx.v): `Vivado/SummerIntern_project/SummerIntern_project.srcs/sources_1/new/uart_tx.v`

### Host Visualization

- [UART Receiver](https://github.com/vedantnitt27/fast_corner_detection/blob/main/Python/uart_receive.py): `Python/uart_receive.py`
- [Corner Visualization](https://github.com/vedantnitt27/fast_corner_detection/blob/main/Python/uart_receive_NMS256.py): `Python/uart_receive_NMS256.py`

### Evaluation

- [Detection Evaluation](https://github.com/vedantnitt27/fast_corner_detection/blob/main/Python/evaluate.py): `Python/evaluate.py`
- [CPU FAST Reference](https://github.com/vedantnitt27/fast_corner_detection/blob/main/Python/cpu_fast.py): `Python/cpu_fast.py`

### Image Inputs

- [Image Data](https://github.com/vedantnitt27/fast_corner_detection/tree/main/Image): `Image`
- [Ground Truth](https://github.com/vedantnitt27/fast_corner_detection/tree/main/Dataset_256/Ground%20Truth): `Dataset_256/Ground Truth`
- [Image Conversion](https://github.com/vedantnitt27/fast_corner_detection/blob/main/Image/image_conversion.py): `Image/image_conversion.py`

### Other components

- **Operator**
- **Host PC**

## Connections

- Operator → Host PC: views results (evidence: `README.md`)
- Image Data → Image Memory: loads pixels (evidence: `README.md`)
- Top Controller → Image Memory: reads image (evidence: `README.md`)
- Image Memory → Pixel Stream: streams pixels (evidence: `README.md`)
- Pixel Stream → Line Buffer: buffers pixels (evidence: `README.md`)
- Line Buffer → Sliding Window: forms windows (evidence: `README.md`)
- Sliding Window → FAST Detector: provides neighborhoods (evidence: `README.md`)
- Threshold Logic → FAST Detector: provides threshold (evidence: `README.md`)
- Mean Calculator → Threshold Logic: computes mean
- Sliding Window → Corner Scoring: scores corners
- Corner Scoring → FAST Detector: provides score
- FAST Detector → Local Detector: local variant
- FAST Detector → UART Transmitter: sends coordinates (evidence: `README.md`)
- UART Transmitter → Host PC: transmits UART (evidence: `README.md`)
- Host PC → UART Receiver: receives packets (evidence: `README.md`)
- UART Receiver → Corner Visualization: renders corners
- Host PC → Detection Evaluation: evaluates detections (evidence: `Python/evaluate.py`)
- Detection Evaluation → Ground Truth: reads labels (evidence: `Python/evaluate.py`)
- Detection Evaluation → Corner Visualization: displays results (evidence: `Python/evaluate.py`)
- Operator → Image Conversion: prepares images
- Image Conversion → Image Data: writes HEX (evidence: `Image/image_conversion.py`)
- Operator → CPU FAST Reference: runs reference
