Skip to content
kzxlPublic

About

Sovereign High-Performance Computational Imaging & Macro Metrology Workstation (.NET 9 + D3D11 ZeroGraphics)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

🔬 ZStack Pro — High-Performance Computational Imaging & Macro Metrology Workstation

Type: Desktop Application Version Ecosystem Platform .NET 9.0 GPU Engine Unit Tests License: MIT

English | Tiếng Việt

ZStack Pro is a sovereign professional computational photography and optical metrology workstation desktop application (.NET 9, WPF Studio) powered by ZeroGraphics Direct3D 11 GPU Compute Shaders and hardware-accelerated SIMD AVX2/512. Designed for high-magnification macro photography, industrial SMD electronics quality control, biological entomology inspection, and precision optical measurement, it features a Canvas-Centric Obsidian Studio layout, dynamic reticle diagnostics, 3D surface depth reconstruction, and multi-scale frequency pyramid fusion.


🌟 Key Capabilities

1. Canvas-Centric Obsidian Pro Studio (ZeroUI.Wpf)

  • Maximized Canvas Geometry: Frees over 82% of screen area for image inspection by replacing static vertical sidebars with an ergonomic bottom drawer.
  • Focus Wave & Z-Elevation Drawer (F): Bottom horizontal filmstrip displaying thumbnail proxies, focus uniformity waves, Z-depth elevation indicators, and auto-cull quality badges.
  • Dynamic Reticle Loupe (L): Real-time floating magnifier overlay with crosshair reticle and hardware-accelerated 100% focus peaking neon contours that track mouse movement seamlessly.
  • Interactive Split Curtain Divider (\): Live side-by-side Before/After comparison curtain directly on the viewport with zero render latency.
  • Adaptive Workspace Modes: Instant layout switching tailored to operational contexts:
    • ⚡ Fast Field: Streamlined one-click fusion for macro photographers in the field.
    • 🔬 Metrology Lab: Precision industrial inspection with MTF sharpness curves, sub-pixel alignment vectors, and 3D point cloud export.
    • 🖌️ Retouch Studio: Pixel-level focus slice painting and occlusion artifact repair.
  • Accordion Tool Cards (Tab): Collapsible GPU-elevated cards (ZeroOptimizedCard) for Presets, Strategy, Diagnostics, Depth Bokeh, and Optical Metrology.

2. Multi-Scale Computational Imaging Algorithms

ZStack integrates 10 high-performance computational imaging subsystems:

Subsystem Architecture & Engine Core Capabilities
Focus Stacking Multi-Scale Laplacian Pyramid & Wavelet DWT Blends 10–200+ macro slices into edge-to-edge sharp master images with edge discontinuity repair.
Noise Reduction SIMD Kappa-Sigma & Winsorized Clipping Temporal noise elimination across multi-frame burst captures with streaming $O(1)$ memory allocation.
HDR Exposure Fusion Mertens Multi-Scale & Debevec Radiance Exposure fusion without unnatural tone-mapping halos, preserving dynamic range in highlights and shadows.
Astro Deep-Sky Star Centroid Triangulation & MTF Auto-Stretch Dark/Flat/Bias calibration, asterism triangle pattern matching, and sub-pixel star alignment.
Super-Resolution HST Subpixel Drizzle & Iterative Back-Projection Variable pixel linear reconstruction yielding 2x–4x spatial detail beyond camera sensor limits.
Optical Restoration Richardson-Lucy Deconvolution & Dark Channel Prior Optical deblurring with Total Variation (TV) damping and haze removal for microscopy specimens.
Matrix Mosaic Stitching Directional Normalized Cross-Correlation (NCC) Multi-tile gigapixel planar and cylindrical panorama stitching with seamless feather blending.
3D Depth Reconstruction Volumetric Focus Energy & Sobel Normal Map Generates continuous metric depth maps, 3D Point Clouds (.ply), and textured 3D meshes (.obj).
Sub-Pixel Alignment 6-DOF Affine, 8-DOF Homography & Elastic Mesh 8x8 tiled sub-pixel optical flow motion vectors to counteract hand tremor and macro perspective shift.
Computational RAW Bayer CFA Mosaic Fusion (Google HDR+ Pipeline) Multi-frame spatial Bayer accumulation before demosaicing to maximize raw sensor signal-to-noise ratio.

3. Hardware GPU Acceleration (ZeroGraphics Direct3D 11)

  • Direct3D 11 Compute Shaders: Real-time Modified Laplacian energy computation and continuous blend weighting directly in VRAM (CsFocusMeasure, CsFocusBlend), slashing processing time on 50-frame sequences to sub-second levels.
  • Flip Model SwapChain Viewport: Ultra-low latency DXGI swapchain yielding smooth 144 Hz pan/zoom interactions.
  • Gigapixel Tiled Processing: Memory-bounded tiled scheduler (512 to 4096 px tiles) handling ultra-high-resolution images (100MP+) without out-of-memory crashes.

🏛️ Core Architecture

ZStack Studio & GPU Computational Imaging Architecture
│
├── 1. Focus Stacking ────────── Multi-Scale Laplacian Pyramid, Wavelet DWT, Focus Volume 3D, Virtual DOF
├── 2. Noise Stacking ────────── SIMD Mean, Median, Kappa-Sigma Clipping, Winsorized, Streaming O(1) RAM
├── 3. HDR Exposure Fusion ───── Mertens Multi-Scale Fusion, Debevec Radiance, Motion Deghosting, ACES/AgX
├── 4. Astro Deep-Sky ────────── Star Centroid Detector, Asterism Triangles, Dark/Flat Calibration
├── 5. Super Resolution ──────── HST Subpixel Drizzle (Variable Pixel Linear Reconstruction) + Multi-frame IBP
├── 6. Optical Restoration ───── Richardson-Lucy Deconvolution + TV Damping, Dark Channel Prior Dehazing
├── 7. Matrix Mosaic Stitching ── Directional Overlap Matching (NCC), Multi-Tile Planar/Cylindrical Stitching
├── 8. 3D Depth Reconstruction ─ Continuous Metric Depth Maps, Point Cloud (.ply), 3D Polygonal Mesh (.obj)
├── 9. Sub-Pixel Alignment ───── 6-DOF Affine, 8-DOF Homography, Optical Flow, Elastic Local Mesh Warping
├── 10. Computational RAW ────── Bayer CFA Mosaic Fusion before Demosaic, Edge-Directed Demosaic
└── 11. ZeroGraphics Engine ──── D3D11 Compute Shaders, Flip Model SwapChain (sub-4ms), 144Hz Pan/Zoom Viewport

🏗️ Solution Structure

ZStack/
├── src/
│   ├── ZStack.Core/                      # Domain contracts, 37 computational algorithms, image buffers
│   ├── ZStack.Application/               # Application service layer, project packaging, pipeline graph
│   ├── ZStack.Infrastructure/            # File IO adapters, RawDecoder, ImageSharp IO
│   ├── ZStack.Infrastructure.ZeroGraphics/ # Direct3D 11 compute shader acceleration adapter
│   ├── ZStack.UI/                        # WPF Studio frontend (Canvas-Centric Obsidian Dark, ZeroUI.Wpf)
│   └── ZStack.Cli/                       # Headless batch processing and automated pipeline CLI
├── tests/
│   └── ZStack.Core.Tests/                # 130 automated unit and regression tests (100% pass)
├── tools/
│   └── ZStack.DatasetGenerator/          # Synthetic test dataset generator for optical verification
├── docs/                                    # Technical algorithm specifications and architectural guides
└── ZStack.slnx                           # Unified modern XML-format solution definition

⚡ Quick Start for Developers

Prerequisites

  • Windows 10 (build 1809+) or Windows 11 (64-bit)
  • .NET 9.0 SDK
  • DirectX 11 compatible GPU (Feature Level 11_0 or higher)

Build Solution

# Clone repository inside ZeroUniverse/ZeroApps/
git clone https://github.com/kzxl/ZStack.git
cd ZStack

# Build entire solution in Debug mode
dotnet build ZStack.slnx -c Debug

# Run all 130 automated unit tests
dotnet test tests/ZStack.Core.Tests/ZStack.Core.Tests.csproj -c Release

Launch Desktop Application

# Run WPF Desktop Studio
dotnet run --project src/ZStack.UI/ZStack.UI.csproj -c Release

Run Batch CLI Headless

# Stack all frames in a folder via command line
dotnet run --project src/ZStack.Cli/ZStack.Cli.csproj -- --input "path/to/frames" --output "master_result.tif" --method Pyramid --levels 5

⌨️ Professional Keyboard Shortcuts

Shortcut Action Description
F Toggle Filmstrip Drawer Show/hide bottom Focus Wave elevation strip and thumbnails
L Toggle Dynamic Loupe Activate interactive 100% focus peaking circular reticle magnifier
\ Quick A/B Peek Toggle Before/After split comparison screen
Alt + P Toggle Focus Peaking Overlay neon contours over in-focus high-frequency image areas
Tab Toggle Right Tool Dock Collapse side panel for edge-to-edge full-canvas view
Space + Drag Viewport Pan Pan smoothly across gigapixel canvas at any zoom level
Ctrl + Wheel Viewport Zoom Precision zoom centered at cursor position from 10% to 1000%

📄 License & Ecosystem Sovereignty

Architected and developed by Phong Võ (kzxl). Released under the permissive MIT License. Part of the ZeroUniverse industrial computing ecosystem.

About

Sovereign High-Performance Computational Imaging & Macro Metrology Workstation (.NET 9 + D3D11 ZeroGraphics)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages