Speckle Stacker is a C++ application and SMIP (Speckle Masking Image Processing) library designed to reconstruct high-resolution astronomical images from short-exposure video frames. By employing speckle masking techniques, the software mitigates the blurring effects of atmospheric turbulence, enabling astronomical imaging close to the diffraction limit of the optical instrument.
This project targets astronomers, astrophotographers, and image processing enthusiasts aiming to enhance ground-based telescope imagery. It processes input video data, applies fft, bispectrum accumulation, phase revovery, windowing and fft back transform resulting in a reconstructed deblurred object image close to the diffraction limit of the telescope without atmospheric distortions, depending on the quality and amount of video frames.
Speckle imaging is a high-resolution astronomical technique that involves capturing numerous short-exposure images to "freeze" atmospheric distortions. These images are then processed to reconstruct a deblurred representation of the observed object.
Speckle masking is a form of speckle interferometry that utilizes the bispectrum (or closure phases) of short-exposure images. By analyzing the statistical properties of speckle patterns, it reconstructs high-resolution images, overcoming limitations imposed by atmospheric turbulence.
More on Speckle Imaging and Speckle Masking
| Video sequence of binary star WDS 19055+3352 (HU 940) disturbed by atmospheric turbulence (source: http://www.astrosurf.com/hfosaf/uk/speckle10.htm) mag:9.2/9.8, sep = 0.32 arcs, texp: 7ms (40 frames) |
|
|---|---|
| Naive picture sum over 40 frames of the sequence (false color) |
|
| Speckle reconstructed image (false color) with the two clearly separated components |
- Bispectrum Analysis: Implements bispectral analysis for image reconstruction.
- Phase Retrieval: Uses closure phase algorithm to recover object phases from bispectrum.
- Cross Correlation: Provides functions to calculate cross and auto correlations of arrays.
- Shift and Add (SAA): Provides processing of picture sums and shifted picture sums based on cross correlation.
- CLI Tool & Library: Offers both an end-user interface and reusable code modules.
- Cross-platform Build Support: Works under Linux and Windows (MinGW).
- Image Output: Generates multiple diagnostic and reconstruction visualizations.
- OpenCV (>= 4.x)
- FFTW3 (tested with 3.3.5)
- CMake (>= 3.10)
- C++20-compatible compiler (GCC ≥ 10 or Clang ≥ 12)
sudo apt install libopencv-dev fftw3-dev cmake- Install
libopencv-dev(e.g. via Chocolatey) - Install FFTW3 library following instructions from: https://fftw.org/install/windows.html
git clone https://github.com/hangeza/speckle-stacker.git
cd speckle-stacker
mkdir build && cd build
cmake ..
make- The CLI executable will be located in
build/bin/smip-cli - Library will be under
build/output/lib
The CLI processes videos or GIFs to reconstruct high-resolution images using speckle masking.
bin/smip-cli -v -b 32 -p 64 -c r ../data/hu940ani/hu940ani.gif(Assuming execution from build folder)
- Sum image
- Power spectrum
- Phase map
- Phase consistency map
- Reconstructed image (grayscale & false color, 16-bit)
Future versions will support exporting to HDF5 and FITS file formats.
- FITS & HDF5 export formats
- OpenMP utilization
- GPU acceleration (CUDA/OpenCL)
- Image analysis algorithms (noise, SNR, entropy etc.)
- Adaptive frame selection (lucky imaging mode based on image analysis)
Contributions are highly welcome! To propose changes:
- Fork the repository.
- Create a feature branch:
git checkout -b feature-xyz - Commit and push your changes.
- Open a pull request with a description.
This project is licensed under the GNU General Public License v2.0.
See the LICENSE file for details.