5 Commits
Author SHA1 Message Date
bemoregtandClaude Sonnet 4.6 f586f95908 fix: subtract noise floor before normalizing phase output
Root cause: abs(phase) has a constant background floor (~0.02 rad)
that was making flat regions display as 35% gray instead of black.

Fix: compute noise_floor = 50th percentile of abs(phase), subtract it,
then normalize — background becomes ~0 (black), edges remain bright.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 18:53:05 +09:00
bemoregtandClaude Sonnet 4.6 d8ca874e4b fix: match reference implementation LPF and two-stage FFT pipeline
Key fixes:
1. lpf_sigma now interpreted as FWHM (not sigma), matching JalaliLab
   reference code: sigma = FWHM / (2*sqrt(2*ln2)) — factor ~2.4x stronger
   filtering, which suppresses noise before PST phase extraction
2. Two-stage FFT: apply LPF to real filtered image first, then re-FFT
   for PST kernel application (matches reference pipeline exactly)
3. Soft mode normalization: percentile-99 instead of max, robust to outliers
4. Default morph_flag=False for soft continuous edge output

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 18:39:11 +09:00
bemoregtandClaude Sonnet 4.6 26184e04a1 fix: use abs(phase) for soft edge map output
Previous soft mode (morph_flag=False) used linear phase normalization
which spread noise across the full brightness range.

abs(phase) makes edges bright and flat regions dark, matching the
paper's Fig.4(C) style continuous edge map. Same fix applied to
phase_image output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 18:15:49 +09:00
bemoregtandClaude Sonnet 4.6 ce73aaa91c fix: correct PST kernel formula per paper Eq.5
Previous kernel incorrectly modified both amplitude and phase:
  (W*R/(1+W*R)) * exp(-j*S*R/(1+R))

Corrected to unit-amplitude pure-phase kernel as defined in the paper:
  K = exp(j * S * W*R/(1+W*R))

Also updated default thresholds to symmetric ±0.35 which is appropriate
for the corrected phase range of approximately [-S, S] = [-0.48, 0.48].

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 18:03:05 +09:00
bemoregtandClaude Sonnet 4.6 5a8e65296b Initial commit: ComfyUI Phase Stretch Transform custom node
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 12:24:44 +09:00