Image Processing

JWST-StarClustering

A MATLAB pipeline that pulls stars, dust, and galaxies out of a single JWST image — separating them by scale, not color, with unsharp masking and Difference-of-Gaussians.

Year2025
StackMATLAB · Image Processing Toolbox
View source
JWST-StarClustering

JWST-StarClustering takes a single James Webb deep-field frame — Stephan’s Quintet — and pulls it apart into three populations: stars, dust, and galaxies. The guiding idea: the structures worth isolating are separated not by color but by size, so the whole pipeline is spatial-frequency filtering rather than thresholding.

Separate by size, not color

In a dark-sky frame, stars are compact point sources, dust is mid-scale clumpy structure, and galaxies are large luminous bodies — three different scales. Scale-space filtering (the Marr–Hildreth idea behind blob detection) separates them cleanly where a single brightness threshold would just smear them together.

The pipeline

Lightly denoise with a 3×3 Gaussian (σ=0.5), then convert RGB → HSV and work only on the Value channel, which stays stable across dark sky where Hue and Saturation go numerically unstable. Each population is then isolated by a different band of spatial frequencies:

  • Stars — high-pass via unsharp masking: Value − blur(σ=8), keeping only the sharpest point sources.
  • Dust — band-pass Difference-of-Gaussians: blur(σ=18) − blur(σ=1), for mid-scale clumps.
  • Galaxies — wider band-pass: blur(σ=18) − blur(σ=100), for the large, slow structure.

From layers to clusters

The star layer is the project’s namesake payload: fed into unsupervised clustering (DBSCAN), it surfaces stellar associations and over-densities — the groupings that flag star-forming knots and tidal debris in an interacting system like the Quintet.

The result

The single input frame separates into three clean layers: stars carrying JWST’s six-point diffraction spikes, the mid-scale dust of star-forming regions, and the five galaxies of Stephan’s Quintet resolved as distinct blobs. Every stage is written out, so the decomposition is reproducible end to end.

What stuck

This is exactly the front-end stage of professional astronomy pipelines — source separation and background estimation, the same job tools like SExtractor do for Spitzer, WISE, and 2MASS archives. The lesson: principled, reproducible parameter choices beat clever ones. Pick your scales deliberately and the structure falls out on its own.