This repository presents a comprehensive framework for Sparse Hadamard Single-Pixel Imaging (SHSI) utilizing the
- Generation of positive and negative sparse Hadamard speckle patterns derived from the
$H_{64}$ matrix. - Simulation of single-pixel imaging data acquisition employing these speckle patterns.
- High-fidelity image reconstruction via the SHSI algorithm.
- Evaluation of noise robustness through additive white Gaussian noise (AWGN) simulations.
- Quantitative assessment of reconstruction quality using Peak Signal-to-Noise Ratio (PSNR) metrics.
-
Generate_hadamard_matrix_random_64_H.m
Script to generate sparse Hadamard speckle patterns based on the$H_{64}$ matrix. The patterns are saved as PNG images along with the corresponding row and column indices required for SHSI reconstruction, as outlined in Algorithm 1:
-
Natural_Hadamard_Transform.m
Function to generate Hadamard matrices of order$2^n$ via Sylvester's construction, yielding matrices in natural order. -
SHSI.m
Main demonstration script that:- Loads the generated speckle patterns and associated indices.
- Loads and preprocesses a test image (e.g., Cameraman).
- Simulates single-pixel measurements using the speckle patterns.
- Performs image reconstruction via SHSI.
- Assesses noise robustness by adding AWGN and comparing noisy and noise-free reconstructions.
- Computes and displays PSNR values for quantitative evaluation.
Requirements: MATLAB with Image Processing Toolbox and Communications Toolbox. The demo uses MATLAB's local cameraman.tif sample by default instead of redistributing a copied bitmap. To use an authorized custom image, set the cross-platform environment variable SHSI_TARGET_IMAGE before running the script.
setenv('SHSI_TARGET_IMAGE', fullfile(pwd, 'my_target.png'));-
Generate Hadamard Speckle Patterns
RunGenerate_hadamard_matrix_random_64_H.mto generate and save the positive and negative sparse Hadamard speckle patterns based on the$H_{64}$ basis. The patterns and corresponding reconstruction indices will be stored under./data/Random_Discrete_Hadamard_Postive_and_Negetive_matrix_64_H/. -
Run the SHSI Reconstruction Demo
ExecuteSHSI.mto simulate the single-pixel imaging acquisition and reconstruction process using the generated patterns.
(a) Experimental setup for active single-pixel imaging, featuring two ground glasses as occluders.
(b) Target object: resolution testing board.
(c–i) Reconstruction results obtained via ADMM-based CS, THSI, THSI combined with the CC, mode one using the
@article{han2025generalized,
title={Generalized sparse Hadamard single-pixel Imaging},
author={Han, Yuyuan and Wu, Peng and Xu, Hanxiong and Li, Bin and He, Yuchen and Liu, Jianbin and Chen, Hui and Zheng, Huaibin},
journal={Optics Express},
volume={33},
number={20},
pages={43324--43341},
year={2025},
publisher={Optica Publishing Group}
}The MATLAB source code is released under the MIT License. Generated illumination patterns under data/ are local outputs and are not committed. Reference figures and sample-image handling have separate provenance notes in ASSET_PROVENANCE.md; the MIT license must not be interpreted as relicensing third-party material.


