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
- 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
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![]() |
- Select Source – Choose "Local Camera" or "Network Stream"
- Configure – For network, enter the IP address and port
- Connect – Establish the video stream connection
- Choose Mode – Pick one of 11 processing algorithms
- Process – Real-time processing and face detection, with FPS and timing stats
- Adjust – Fine-tune Canny thresholds and re-apply (Canny / Contour modes)
- Scan / Detect / Match – Point the camera at a QR code, colored object, shape, or a loaded template
- Save – Take screenshots or record video at any time
- Load Image – Offline analysis from image files
All processing runs asynchronously on a background thread, keeping the UI responsive.
- Install IP Webcam (Android) or a similar app on your phone
- Make sure the phone and PC are on the same Wi-Fi network
- Launch the app and note the URL (e.g.,
http://192.168.1.100:8080/video) - 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.
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
| 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 |
- Default language is English (click EN/中 in the title bar to switch to Chinese)
- All UI strings are managed via
.resxresource files - To add a new language: copy
Strings.en.resx, rename toStrings.xx.resx, and translate the values
- .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 bindingsOpenCvSharp5.runtime.win– Native OpenCV binariesOpenCvSharp5.WpfExtensions–BitmapSourceconversionZXing.Net– QR code and barcode decodingAWSSDK.S3/AWSSDK.Lambda/AWSSDK.SimpleNotificationService– AWS integrationNModbus/OPCFoundation.NetStandard.Opc.Ua.*– industrial protocolsMicrosoft.Data.Sqlite– local work-report storage
Grab the latest self-contained package from Releases:
- Download
VirtualPathVision-win-x64-vX.Y.Z.zip - Extract it to any folder
- Run
VirtualPathVision.exe
# 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.csprojOr open VirtualPathVision.sln in Visual Studio 2022 and press F5.
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 |
| 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 |
Contributions are welcome! Please read CONTRIBUTING.md and the Code of Conduct. Security issues should be reported per SECURITY.md.
Released under the GNU General Public License v3.0. © 2026 xianshi3 and contributors.











