Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Image processing for image sums of astronomical videos using speckle masking processing

License

hangeza/speckle-stacker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Speckle Stacker

CodeFactor Multi-Platform

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.


📖 Project Overview

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.


🔬 Scientific Background

What is Speckle Imaging?

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 Technique

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


🌌 What SMIP Can Do

Video sequence of HU940 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)
Sum image of HU940 over 40 frames Naive picture sum over 40 frames of the sequence
(false color)
Speckle reco image of HU940 from 40 frames Speckle reconstructed image (false color)
with the two clearly separated components

🚀 Features

  • 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.

🛠️ Build From Source

Dependencies

  • OpenCV (>= 4.x)
  • FFTW3 (tested with 3.3.5)
  • CMake (>= 3.10)
  • C++20-compatible compiler (GCC ≥ 10 or Clang ≥ 12)

Linux Installation

sudo apt install libopencv-dev fftw3-dev cmake

Windows Installation (MinGW64)

Build Instructions

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

🧪 CLI Usage

The CLI processes videos or GIFs to reconstruct high-resolution images using speckle masking.

Reproduce the Example Above

bin/smip-cli -v -b 32 -p 64 -c r ../data/hu940ani/hu940ani.gif

(Assuming execution from build folder)

Output

  • 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.


🧠 Planned Enhancements

  • 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)

🤝 Contributing

Contributions are highly welcome! To propose changes:

  1. Fork the repository.
  2. Create a feature branch: git checkout -b feature-xyz
  3. Commit and push your changes.
  4. Open a pull request with a description.

📄 License

This project is licensed under the GNU General Public License v2.0.
See the LICENSE file for details.


📚 References

About

Image processing for image sums of astronomical videos using speckle masking processing

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published