Skip to content

English | 中文

Virtual Path Vision

release stars .NET 8 WPF OpenCV 5 AWS Windows i18n License

A modern machine vision desktop application for real-time video processing, image recognition, barcode scanning and measurement over local or network cameras.
Built with WPF · OpenCvSharp5 (OpenCV 5) · AWS SDK · .NET 8

Dark theme Light theme


Features

  • Dual Source – Local USB camera or network IP camera (RTSP / MJPEG over HTTP)
  • Face Detection – Haar cascade classifier with configurable overlay style
  • 11 Processing Modes – Canny, Sobel, Laplacian, Binary, Contour, QR/Barcode, Color Detection, Template Matching, Shape Detection, Feature Matching, Enhancement
  • QR / Barcode – Real-time decoding of QR codes and 1D barcodes (EAN/UPC/Code128/Code39) with on-screen result display
  • Color Detection – HSV-based detection with 9 preset colors, object counting, and click-to-pick sampling directly from the live image
  • Template Matching – Locate a template image in the live feed with a match score
  • Shape Detection – Classify objects into circles, rectangles, triangles, pentagons and polygons with per-type statistics
  • Feature Matching – ORB keypoint matching with RANSAC homography, robust to rotation and scale changes
  • Enhancement – CLAHE histogram equalization and unsharp masking for low-contrast scenes
  • Video Recording – Record processed video to AVI files with one click
  • Screenshot – Save the current frame as a PNG image
  • Network Camera – Connect to phone cameras via IP Webcam apps
  • i18n Support – Built-in English and Chinese, switchable at runtime
  • Light / Dark Themes – Apple-style card UI with runtime theme switch (incl. Follow system) and a collapsible sidebar
  • AI Active Perception – YOLO object detection, Kalman multi-object tracking and a digital-twin overlay
  • AWS Cloud – S3 screenshot upload, IoT Core telemetry and Lambda invocation
  • Industrial Connectivity – Modbus TCP, OPC UA, serial / TCP barcode scanners and work-report export
  • Responsive Layout – panels adapt and stack on narrow windows; crisp on 2K/4K displays (PerMonitorV2 DPI)
  • Image Analysis – Load static images and apply the full processing pipeline
  • Real-time Stats – FPS counter, processing time, face/contour counts

Processing Modes

All screenshots below are produced by the app itself using the bundled test scene TestImages/test_scene.png.

Canny Edge
Contour Detection
Binary Threshold
Shape Detection
Color Detection (Red)
QR / Barcode
Template Matching
Feature Matching (ORB)
Enhancement (CLAHE + Sharpen)
Face Detection

How It Works

  1. Select Source – Choose "Local Camera" or "Network Stream"
  2. Configure – For network, enter the IP address and port
  3. Connect – Establish the video stream connection
  4. Choose Mode – Pick one of 11 processing algorithms
  5. Process – Real-time processing and face detection, with FPS and timing stats
  6. Adjust – Fine-tune Canny thresholds and re-apply (Canny / Contour modes)
  7. Scan / Detect / Match – Point the camera at a QR code, colored object, shape, or a loaded template
  8. Save – Take screenshots or record video at any time
  9. Load Image – Offline analysis from image files

All processing runs asynchronously on a background thread, keeping the UI responsive.


Using Your Phone as Camera

  1. Install IP Webcam (Android) or a similar app on your phone
  2. Make sure the phone and PC are on the same Wi-Fi network
  3. Launch the app and note the URL (e.g., http://192.168.1.100:8080/video)
  4. In this application:
    • Select "Network Stream" as the source
    • Enter the IP and port
    • Click Connect

The app automatically constructs the MJPEG URL and starts streaming.


Project Structure

VirtualPathVision/
├── App.xaml / App.xaml.cs           # Application entry, DI container, theme init
├── MainWindow.xaml / .cs            # Main UI, navigation and event orchestration
├── SettingsWindow.xaml / .cs        # Settings dialog (language + theme)
├── ThemeService.cs                  # Light / Dark / System theme switching
├── TranslationService.cs            # i18n singleton with INotifyPropertyChanged
├── AppLogger.cs                     # Logging service (singleton)
├── app.manifest                     # PerMonitorV2 DPI awareness
├── Resources/
│   ├── Strings.resx                 # Chinese resource strings (fallback)
│   └── Strings.en.resx              # English resource strings
├── Themes/
│   ├── LightTheme.xaml              # Apple-style light palette + control styles
│   └── DarkTheme.xaml               # Apple-style dark palette + control styles
├── Views/                           # One UserControl per page
│   ├── CameraPanel.xaml / .cs       # Home: capture, preview, screenshot / record
│   ├── ProcessingPanel.xaml / .cs   # 11 processing modes + thresholds
│   ├── AIPanel.xaml / .cs           # YOLO detection, tracking, digital twin
│   ├── CloudPanel.xaml / .cs        # AWS S3 / IoT Core / Lambda
│   ├── IndustrialPanel.xaml / .cs   # Modbus / OPC UA / scanners / work report
│   ├── LogPanel.xaml / .cs          # Application log
├── AI/                              # Active perception, Kalman tracking, digital twin
├── Cloud/                           # S3Service, IoTService, LambdaClient
├── Industrial/                      # Modbus, OPC UA, serial/TCP scanners, DI factory
├── Components/                      # Capture + 10 image-processing components
├── Converters/                      # Value converters (log level → colour, …)
├── TestImages/                      # Sample test images (scene, templates, face photo)
├── docs/images/                     # Screenshots used by this README
├── face_detection_yunet_2023mar.onnx
└── haarcascade_frontalface_default.xml

Key Architecture

Component Responsibility
VideoCaptureComponent VideoSourceType.LocalCamera / .NetworkStream, auto-fallback APIs (DSHOW → MSMF → ANY), connection state machine
ImageDisplayComponent Batched Dispatcher.Invoke for dual-image update
ImageProcessingComponent 5 classic modes: Canny, Sobel, Laplacian, Binary Threshold, Contour Detection
FaceDetectionComponent DetectMultiScale + histogram equalization preprocessing + bounding box rendering
BarcodeDetectionComponent ZXing.Net decoding of QR/DataMatrix/EAN/UPC/Code128/Code39, frame-throttled with result caching
ColorDetectionComponent HSV InRange masks + morphology + contour counting for 9 preset colors, plus click-to-pick custom sampling
TemplateMatchComponent MatchTemplate (CCoeffNormed) with threshold gating and score overlay
ShapeDetectionComponent Canny + contour polygon approximation + circularity analysis, classifies circles/rects/triangles/pentagons/polygons
FeatureMatchComponent ORB keypoints + BFMatcher ratio test + RANSAC homography, draws perspective detection box
EnhancementComponent CLAHE histogram equalization + unsharp masking
RecordingComponent VideoWriter-based AVI recording with MJPG codec
ThresholdParameterComponent Validates input and fires OnThresholdsChanged
TranslationService INotifyPropertyChanged singleton, ResourceManager-backed, fires full refresh on culture switch
AppLogger ObservableCollection<LogEntry> singleton with INFO/WARN/ERROR levels

Internationalization

  • Default language is English (click EN/中 in the title bar to switch to Chinese)
  • All UI strings are managed via .resx resource files
  • To add a new language: copy Strings.en.resx, rename to Strings.xx.resx, and translate the values

Requirements

  • .NET 8 SDK (build only; the release package below is self-contained)
  • Windows 10/11 with WPF support
  • NuGet packages (restored automatically):
    • OpenCvSharp5 – OpenCV 5 bindings
    • OpenCvSharp5.runtime.win – Native OpenCV binaries
    • OpenCvSharp5.WpfExtensions – BitmapSource conversion
    • ZXing.Net – QR code and barcode decoding
    • AWSSDK.S3 / AWSSDK.Lambda / AWSSDK.SimpleNotificationService – AWS integration
    • NModbus / OPCFoundation.NetStandard.Opc.Ua.* – industrial protocols
    • Microsoft.Data.Sqlite – local work-report storage

Getting Started

Download (no build required)

Grab the latest self-contained package from Releases:

  1. Download VirtualPathVision-win-x64-vX.Y.Z.zip
  2. Extract it to any folder
  3. Run VirtualPathVision.exe

Build from source

# Clone the repository
git clone https://github.com/virtual-path/virtual-path-vision.git
cd virtual-path-vision

# Restore and build
dotnet restore
dotnet build -c Release

# Run
dotnet run --project VirtualPathVision/VirtualPathVision.csproj

Or open VirtualPathVision.sln in Visual Studio 2022 and press F5.

Try the bundled test images

Open TestImages/ from the Load Image dialog:

Image What to test
test_scene.png All processing modes – edges, contours, shapes, colors, QR (https://github.com/virtual-path/virtual-path-vision) and barcode (OPENCV5)
template_green.png Template Matching (green square, score ≈ 1.0)
template_qr.png Feature Matching (texture-rich QR crop)
face_lena.jpg Face Detection

Tech Stack

Technology Description
WPF UI framework for Windows apps
OpenCvSharp5 .NET wrapper for OpenCV 5
AWS SDK v4 S3 / IoT / Lambda integration
ZXing.Net QR code and barcode decoding
C# Primary programming language
XAML UI design and layout
.resx Resource files for i18n

Contributing

Contributions are welcome! Please read CONTRIBUTING.md and the Code of Conduct. Security issues should be reported per SECURITY.md.


License

Released under the GNU General Public License v3.0. © 2026 xianshi3 and contributors.

About

Modern Windows machine-vision desktop app (WPF + OpenCV 5 / OpenCvSharp): 11 real-time processing modes, QR/barcode, template & feature matching, AI active perception (YOLO + Kalman tracking), AWS (S3 / IoT / Lambda) and industrial protocols (Modbus / OPC UA), with light/dark themes and high-DPI support.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages