# keep-passion/imagestitch architecture

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

- Interactive diagram: https://gitdiagram.com/keep-passion/imagestitch
- Repository: https://github.com/keep-passion/imagestitch

## Overview

VFSMS is a Python application for stitching sequential material micrographs into panoramas. A researcher configures stitching options in Main.py; Stitcher processes image sets, estimates pairwise offsets, assembles the aligned images, and writes results. ImageUtility supplies feature, ROI, and offset operations, while ImageFusion provides overlap blending. The README also describes incremental searching and GPU acceleration. The excerpts show the optional GPU matching call, but do not establish how the appendix C++ conversion code participates in runtime execution; that node is therefore shown separately.

Main entry points: [`Stitcher.py`](https://github.com/keep-passion/imagestitch/blob/master/Stitcher.py) (Sequence stitching), [`Main.py`](https://github.com/keep-passion/imagestitch/blob/master/Main.py) (Run configuration), [`ImageUtility.py`](https://github.com/keep-passion/imagestitch/blob/master/ImageUtility.py) (Feature and offset methods), [`demoImages`](https://github.com/keep-passion/imagestitch/tree/master/demoImages) (Micrograph sets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Stitching workflow"]
  node_main["Run configuration<br/>[Main.py]"]
  node_stitcher["Sequence stitching<br/>[Stitcher.py]"]
  node_image_sets["Micrograph sets"]
  node_results["Stitched images"]
end

subgraph group_analysis["Image analysis"]
  node_feature_offset["Feature and offset methods<br/>[ImageUtility.py]"]
end

subgraph group_fusion["Fusion and acceleration"]
  node_fusion["Overlap blending<br/>[ImageFusion.py]"]
  node_gpu["GPU feature matching<br/>[myGpuFeatures.cpp]"]
end

subgraph group_bridge["Native conversion"]
  node_conversion["NumPy OpenCV conversion<br/>[conversion.cpp]"]
end

node_researcher(("Researcher"))

node_researcher -->|"configures and runs"| node_main
node_main -->|"invokes stitching"| node_stitcher
node_stitcher -->|"reads image sets"| node_image_sets
node_stitcher -->|"estimates offsets"| node_feature_offset
node_stitcher -->|"blends overlaps"| node_fusion
node_stitcher -->|"writes results"| node_results
node_feature_offset -->|"dispatches matching"| node_gpu

click node_main "https://github.com/keep-passion/imagestitch/blob/master/Main.py"
click node_stitcher "https://github.com/keep-passion/imagestitch/blob/master/Stitcher.py"
click node_image_sets "https://github.com/keep-passion/imagestitch/tree/master/demoImages"
click node_feature_offset "https://github.com/keep-passion/imagestitch/blob/master/ImageUtility.py"
click node_fusion "https://github.com/keep-passion/imagestitch/blob/master/ImageFusion.py"
click node_gpu "https://github.com/keep-passion/imagestitch/blob/master/appendix/myGpuFeatures.cpp"
click node_conversion "https://github.com/keep-passion/imagestitch/blob/master/appendix/conversion.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_stitcher,node_image_sets,node_results toneBlue
class node_feature_offset toneAmber
class node_fusion,node_gpu toneMint
class node_conversion toneRose
class node_researcher toneIndigo
```

## Components

### Stitching workflow

- [Run configuration](https://github.com/keep-passion/imagestitch/blob/master/Main.py): `Main.py`
- [Sequence stitching](https://github.com/keep-passion/imagestitch/blob/master/Stitcher.py): `Stitcher.py`
- [Micrograph sets](https://github.com/keep-passion/imagestitch/tree/master/demoImages): `demoImages`
- **Stitched images**

### Image analysis

- [Feature and offset methods](https://github.com/keep-passion/imagestitch/blob/master/ImageUtility.py): `ImageUtility.py`

### Fusion and acceleration

- [Overlap blending](https://github.com/keep-passion/imagestitch/blob/master/ImageFusion.py): `ImageFusion.py`
- [GPU feature matching](https://github.com/keep-passion/imagestitch/blob/master/appendix/myGpuFeatures.cpp): `appendix/myGpuFeatures.cpp`

### Native conversion

- [NumPy OpenCV conversion](https://github.com/keep-passion/imagestitch/blob/master/appendix/conversion.cpp): `appendix/conversion.cpp`

### Other components

- **Researcher**

## Connections

- Researcher → Run configuration: configures and runs (evidence: `Main.py`)
- Run configuration → Sequence stitching: invokes stitching (evidence: `Main.py`)
- Sequence stitching → Micrograph sets: reads image sets (evidence: `Stitcher.py`)
- Sequence stitching → Feature and offset methods: estimates offsets (evidence: `Stitcher.py`)
- Sequence stitching → Overlap blending: blends overlaps (evidence: `Stitcher.py`)
- Sequence stitching → Stitched images: writes results (evidence: `Stitcher.py`)
- Feature and offset methods → GPU feature matching: dispatches matching (evidence: `ImageUtility.py`)
