On-device astrophotography stacker — written from scratch, no third-party stacking libraries.
AstroShoot is a Flutter + C++ application that imports light frames shot with any camera and produces a clean, noise-reduced stacked image on-device. The core engine is a custom C++ star-alignment pipeline built on top of OpenCV; no vibe-coded wrappers, no cloud dependency.
| 1. Single Light Frame | 2. Stacked Engine Output | 3. Final Post-Processed |
|---|---|---|
![]() |
![]() |
|
| Single raw frame (high noise, faint target) | Aligned & averaged output (boosted SNR) | Final histogram stretch & color edit |
The project was originally scoped as an all-in-one astrophotography suite (planner → camera → plate solver → stacker → editor). After hitting hard limits with Flutter's camera ecosystem — specifically the inability to control raw exposure, ISO, and focus programmatically on Android/iOS — the scope was narrowed to the stacking engine, which is the technically novel part.
Users capture frames with dedicated camera software or a standalone camera, then import them into AstroShoot for on-device processing.
| Feature | Status | Notes |
|---|---|---|
| Background subtraction | ✅ Done | Heavy Gaussian blur → subtract |
| Star detection | ✅ Done | Local-maxima via dilation + percentile threshold |
| Connected-component analysis | ✅ Done | Filters by area, circularity, eccentricity |
| Candidate scoring | ✅ Done | Weighted score across brightness, contrast, area |
| k-NN graph | ✅ Done | Brute-force, squared-distance (avoids sqrt) |
| Triangle descriptors | ✅ Done | Rotation/translation-invariant side-ratio pairs |
| Triangle matching | ✅ Done | 0.2% tolerance on (r1, r2) ratios |
| Star-pair correspondence voting | ✅ Done | Multi-triangle vote deduplication |
| Affine transform (RANSAC) | ✅ Done | 4-DOF similarity, 3 px reprojection threshold |
| Frame warping + accumulation | ✅ Done | warpAffine → float32 accumulator |
| Calibration frames | ✅ Done | Bias / dark / flat support |
| Mean stacking + histogram stretch | ✅ Done | Percentile stretch (0.1%–99.9%) |
| Flutter FFI bridge | 🔨 In progress | — |
| UI: import → stack → preview | 🔨 In progress | — |
| Post-stack editing | 📋 Planned | Histogram tools, export |
| Document | Description |
|---|---|
| Architecture | Component map, data flow, layer responsibilities |
| Stacking Pipeline | Step-by-step algorithm with flowchart |
| Calibration Frames | Bias / dark / flat math and processing order |
| Design Decisions | Why each major technical choice was made |
| Build & Dev Guide | Prerequisites, build commands, test harness |
- Flutter ≥ 3.x + Dart SDK ≥ 3.x
- Android NDK (for on-device FFI build)
- OpenCV ≥ 4.x (system install or CMake
find_package) - CMake ≥ 3.20, a C++17 compiler
cd native
make run-cpu # builds with CMake and runs CPU binary ./build/astroshoot_native
make run-gpu # builds with CMake and runs CUDA binary ./build/astroshoot_native_cuda
make cli # interactive CLI sessionOutput images are written to native/test/.
flutter pub get
flutter run| Concern | Choice |
|---|---|
| UI + app logic | Flutter / Dart |
| Stacking engine | C++17 / OpenCV via Flutter FFI (raw FFI, no plugin wrapper) |
| Star detection & matching | Custom implementation — no external descriptor library |
| Local storage | SQLite via drift |
| Build system (native) | CMake 3.20 + GNU Make |
astroshoot/
├── lib/ # Flutter / Dart
│ ├── main.dart
│ ├── camera/ # Camera capture UI
│ ├── gallery/ # Session browser, frame-type list, photo grid
│ ├── stacker/ # Stack trigger UI (in progress)
│ ├── editor/ # Post-stack editing (planned)
│ ├── planner/ # DSO visibility planner (planned)
│ ├── plate_solver/ # Plate solving UI (planned)
│ └── storage/ # Drift DB, session management, file paths
│
├── native/ # C++ engine
│ ├── main.cpp # CLI entry point & workflow
│ ├── cli/ # Interactive CLI prompt & folder validation
│ │ ├── cli.hpp
│ │ └── cli.cpp
│ ├── stack/
│ │ ├── stacker.hpp # All public types + function declarations
│ │ └── stacker.cpp # Full pipeline implementation (~1 000 lines)
│ ├── edit/
│ │ └── editor.cpp # Post-stack editing stub
│ ├── CMakeLists.txt
│ └── makefile
│
├── docs/ # Developer documentation
│ ├── ARCHITECTURE.md
│ ├── PIPELINE.md
│ ├── CALIBRATION.md
│ ├── DECISIONS.md
│ └── BUILD.md
│
├── assets/
│ └── catalog/ # Bundled Stellarium DSO catalog
└── pubspec.yaml
Krishanth — 3rd year CSE, Amrita Vishwa Vidyapeetham.

