Skip to content

Repository files navigation

AstroShoot

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.


Output Comparison

1. Single Light Frame 2. Stacked Engine Output 3. Final Post-Processed
Single Light Frame Stacked Engine Output Final Post-Processed
Single raw frame (high noise, faint target) Aligned & averaged output (boosted SNR) Final histogram stretch & color edit

Scope

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

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

Documentation

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

Quick Start

Prerequisites

  • 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

Run the native test harness

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 session

Output images are written to native/test/.

Run the Flutter app

flutter pub get
flutter run

Tech Stack

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

Project Structure

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

Author

Krishanth — 3rd year CSE, Amrita Vishwa Vidyapeetham.

About

On-device astrophotography stacking engine built with C++17, OpenCV, and CUDA. Features custom asterism triangle matching, RANSAC alignment, and calibration frame processing with Flutter UI bindings.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages