# shimat/opencvsharp_samples architecture

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

- Interactive diagram: https://gitdiagram.com/shimat/opencvsharp_samples
- Repository: https://github.com/shimat/opencvsharp_samples

## Overview

This repository is a collection of OpenCvSharp examples, not a single application. Its principal workflows demonstrate image/video operations through runnable console samples, desktop viewers, and two Web API endpoints: upload or use a default image/video, process it with OpenCV, then display or return analysis. The graph preserves the README’s documented sample domains and UI variants. The API and Avalonia internals are supported by excerpts; unsampled sample directories are represented at their exact paths, without inferred call chains.

Main entry points: [`Samples.WebApi/Program.cs`](https://github.com/shimat/opencvsharp_samples/blob/main/Samples.WebApi/Program.cs) (ASP.NET endpoints), [`AvaloniaViewer/App.axaml.cs`](https://github.com/shimat/opencvsharp_samples/blob/main/AvaloniaViewer/App.axaml.cs) (Avalonia startup), [`AvaloniaViewer/MainWindow.axaml.cs`](https://github.com/shimat/opencvsharp_samples/blob/main/AvaloniaViewer/MainWindow.axaml.cs) (Canny image viewer), [`Samples/Samples`](https://github.com/shimat/opencvsharp_samples/tree/main/Samples/Samples) (OpenCV samples)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Console samples"]
  node_console_samples["OpenCV samples"]
  node_calib["Calibration"]
  node_core["Core operations"]
  node_dnn["DNN super-resolution"]
  node_features["Feature detection"]
  node_imgproc["Image processing"]
  node_ml["Machine learning"]
  node_objdetect["Object detection"]
  node_photo["Photo effects"]
  node_stitching["Image stitching"]
  node_video["Video processing"]
end

subgraph group_api["Web API"]
  node_web_api["ASP.NET endpoints<br/>[Program.cs]"]
  node_cartoonify["Cartoonify image<br/>[Program.cs]"]
  node_frame_analysis["Frame analysis<br/>[Program.cs]"]
  node_static_ui["Web interface<br/>[index.html]"]
end

subgraph group_viewers["Image viewers"]
  node_avalonia_app["Avalonia startup<br/>[App.axaml.cs]"]
  node_avalonia_window["Canny image viewer"]
  node_bitmap_converter["Bitmap converter"]
end

subgraph group_capture["Camera viewers"]
  node_windows_samples["Windows-only samples<br/>[Samples.Windows]"]
  node_winforms_app["WinForms capture"]
  node_wpf_app["WPF capture<br/>[MainWindow.xaml.cs]"]
end

node_user(("Sample user"))
node_api_client(("HTTP client"))
node_avalonia_user(("Desktop user"))
node_windows_user(("Windows user"))
node_winforms_user(("WinForms user"))
node_wpf_user(("WPF user"))

node_user -->|"runs samples"| node_console_samples
node_user -->|"runs samples"| node_windows_samples
node_api_client -->|"calls endpoints"| node_web_api
node_web_api -->|"routes request"| node_cartoonify
node_web_api -->|"routes request"| node_frame_analysis
node_web_api -->|"serves static files"| node_static_ui
node_avalonia_user -->|"starts viewer"| node_avalonia_app
node_avalonia_app -->|"creates window"| node_avalonia_window
node_avalonia_window -->|"converts images"| node_bitmap_converter
node_winforms_user -->|"starts capture"| node_winforms_app
node_wpf_user -->|"starts capture"| node_wpf_app

click node_console_samples "https://github.com/shimat/opencvsharp_samples/tree/main/Samples/Samples"
click node_calib "https://github.com/shimat/opencvsharp_samples/tree/main/Samples/Samples/Calib3D"
click node_core "https://github.com/shimat/opencvsharp_samples/tree/main/Samples/Samples/Core"
click node_dnn "https://github.com/shimat/opencvsharp_samples/tree/main/Samples/Samples/Dnn"
click node_features "https://github.com/shimat/opencvsharp_samples/tree/main/Samples/Samples/Features2D"
click node_imgproc "https://github.com/shimat/opencvsharp_samples/tree/main/Samples/Samples/ImgProc"
click node_ml "https://github.com/shimat/opencvsharp_samples/tree/main/Samples/Samples/Ml"
click node_objdetect "https://github.com/shimat/opencvsharp_samples/tree/main/Samples/Samples/ObjDetect"
click node_photo "https://github.com/shimat/opencvsharp_samples/tree/main/Samples/Samples/Photo"
click node_stitching "https://github.com/shimat/opencvsharp_samples/tree/main/Samples/Samples/Stitching"
click node_video "https://github.com/shimat/opencvsharp_samples/tree/main/Samples/Samples/Video"
click node_web_api "https://github.com/shimat/opencvsharp_samples/blob/main/Samples.WebApi/Program.cs"
click node_cartoonify "https://github.com/shimat/opencvsharp_samples/blob/main/Samples.WebApi/Program.cs"
click node_frame_analysis "https://github.com/shimat/opencvsharp_samples/blob/main/Samples.WebApi/Program.cs"
click node_static_ui "https://github.com/shimat/opencvsharp_samples/blob/main/Samples.WebApi/wwwroot/index.html"
click node_avalonia_app "https://github.com/shimat/opencvsharp_samples/blob/main/AvaloniaViewer/App.axaml.cs"
click node_avalonia_window "https://github.com/shimat/opencvsharp_samples/blob/main/AvaloniaViewer/MainWindow.axaml.cs"
click node_bitmap_converter "https://github.com/shimat/opencvsharp_samples/blob/main/AvaloniaViewer/MatToAvaloniaBitmapConverter.cs"
click node_windows_samples "https://github.com/shimat/opencvsharp_samples/tree/main/Samples.Windows"
click node_winforms_app "https://github.com/shimat/opencvsharp_samples/blob/main/VideoCaptureForm/VideoCaptureForm.cs"
click node_wpf_app "https://github.com/shimat/opencvsharp_samples/blob/main/VideoCaptureWPF/MainWindow.xaml.cs"

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_console_samples,node_calib,node_core,node_dnn,node_features,node_imgproc,node_ml,node_objdetect,node_photo,node_stitching,node_video,node_user,node_api_client,node_avalonia_user,node_windows_user,node_winforms_user,node_wpf_user toneBlue
class node_web_api,node_cartoonify,node_frame_analysis,node_static_ui toneAmber
class node_avalonia_app,node_avalonia_window,node_bitmap_converter toneMint
class node_windows_samples,node_winforms_app,node_wpf_app toneRose
```

## Components

### Console samples

- [OpenCV samples](https://github.com/shimat/opencvsharp_samples/tree/main/Samples/Samples): `Samples/Samples`
- [Calibration](https://github.com/shimat/opencvsharp_samples/tree/main/Samples/Samples/Calib3D): `Samples/Samples/Calib3D`
- [Core operations](https://github.com/shimat/opencvsharp_samples/tree/main/Samples/Samples/Core): `Samples/Samples/Core`
- [DNN super-resolution](https://github.com/shimat/opencvsharp_samples/tree/main/Samples/Samples/Dnn): `Samples/Samples/Dnn`
- [Feature detection](https://github.com/shimat/opencvsharp_samples/tree/main/Samples/Samples/Features2D): `Samples/Samples/Features2D`
- [Image processing](https://github.com/shimat/opencvsharp_samples/tree/main/Samples/Samples/ImgProc): `Samples/Samples/ImgProc`
- [Machine learning](https://github.com/shimat/opencvsharp_samples/tree/main/Samples/Samples/Ml): `Samples/Samples/Ml`
- [Object detection](https://github.com/shimat/opencvsharp_samples/tree/main/Samples/Samples/ObjDetect): `Samples/Samples/ObjDetect`
- [Photo effects](https://github.com/shimat/opencvsharp_samples/tree/main/Samples/Samples/Photo): `Samples/Samples/Photo`
- [Image stitching](https://github.com/shimat/opencvsharp_samples/tree/main/Samples/Samples/Stitching): `Samples/Samples/Stitching`
- [Video processing](https://github.com/shimat/opencvsharp_samples/tree/main/Samples/Samples/Video): `Samples/Samples/Video`

### Web API

- [ASP.NET endpoints](https://github.com/shimat/opencvsharp_samples/blob/main/Samples.WebApi/Program.cs): `Samples.WebApi/Program.cs`
- [Cartoonify image](https://github.com/shimat/opencvsharp_samples/blob/main/Samples.WebApi/Program.cs): `Samples.WebApi/Program.cs`
- [Frame analysis](https://github.com/shimat/opencvsharp_samples/blob/main/Samples.WebApi/Program.cs): `Samples.WebApi/Program.cs`
- [Web interface](https://github.com/shimat/opencvsharp_samples/blob/main/Samples.WebApi/wwwroot/index.html): `Samples.WebApi/wwwroot/index.html`

### Image viewers

- [Avalonia startup](https://github.com/shimat/opencvsharp_samples/blob/main/AvaloniaViewer/App.axaml.cs): `AvaloniaViewer/App.axaml.cs`
- [Canny image viewer](https://github.com/shimat/opencvsharp_samples/blob/main/AvaloniaViewer/MainWindow.axaml.cs): `AvaloniaViewer/MainWindow.axaml.cs`
- [Bitmap converter](https://github.com/shimat/opencvsharp_samples/blob/main/AvaloniaViewer/MatToAvaloniaBitmapConverter.cs): `AvaloniaViewer/MatToAvaloniaBitmapConverter.cs`

### Camera viewers

- [Windows-only samples](https://github.com/shimat/opencvsharp_samples/tree/main/Samples.Windows): `Samples.Windows`
- [WinForms capture](https://github.com/shimat/opencvsharp_samples/blob/main/VideoCaptureForm/VideoCaptureForm.cs): `VideoCaptureForm/VideoCaptureForm.cs`
- [WPF capture](https://github.com/shimat/opencvsharp_samples/blob/main/VideoCaptureWPF/MainWindow.xaml.cs): `VideoCaptureWPF/MainWindow.xaml.cs`

### Other components

- **Sample user**
- **HTTP client**
- **Desktop user**
- **Windows user**
- **WinForms user**
- **WPF user**

## Connections

- Sample user → OpenCV samples: runs samples (evidence: `README.md`)
- Sample user → Windows-only samples: runs samples (evidence: `README.md`)
- HTTP client → ASP.NET endpoints: calls endpoints (evidence: `Samples.WebApi/Program.cs`)
- ASP.NET endpoints → Cartoonify image: routes request (evidence: `Samples.WebApi/Program.cs`)
- ASP.NET endpoints → Frame analysis: routes request (evidence: `Samples.WebApi/Program.cs`)
- ASP.NET endpoints → Web interface: serves static files (evidence: `Samples.WebApi/Program.cs`)
- Desktop user → Avalonia startup: starts viewer (evidence: `README.md`)
- Avalonia startup → Canny image viewer: creates window (evidence: `AvaloniaViewer/App.axaml.cs`)
- Canny image viewer → Bitmap converter: converts images (evidence: `AvaloniaViewer/MainWindow.axaml.cs`)
- WinForms user → WinForms capture: starts capture (evidence: `README.md`)
- WPF user → WPF capture: starts capture (evidence: `README.md`)
