Skip to content

Stabilize affine color correction for nearly uniform channels - #1088

Open
Afloat16 wants to merge 1 commit into
nerfstudio-project:mainfrom
Afloat16:fix/affine-color-centered-moments
Open

Afloat16 wants to merge 1 commit into
nerfstudio-project:mainfrom
Afloat16:fix/affine-color-centered-moments

Conversation

@Afloat16

Copy link
Copy Markdown

The affine color fit forms variance as E[x²] - E[x]² and clamps it to 1e-8. Nearly uniform but identifiable channels consequently lose their true slope; singular reference channels can be corrected toward zero instead of their mean.

Form covariance/variance from centered samples and handle singular channels with the reference mean. Preserve the public interface, output shape and final [0, 1] clipping.

Validation on Python 3.12.14 / PyTorch 2.8.0+cpu, with native full-package imports and the repository pytest configuration:

  • Unchanged main: 8 failed / 1 passed; this branch: 9 passed.
  • Tests cover float32/float64 low-variance affine signals, constant input/reference channels and mixed identifiable/singular channels against independent known affine references.
  • Project-pinned Black 22.3.0 changed-file formatting, critical Ruff checks, Python compilation and git diff --check pass.

CUDA, full rendering/reconstruction suites, image-quality benchmarks and runtime/memory measurements were not run.

The affine color fit computes variance as E[x²]−E[x]² and clamps it to 1e-8. Nearly uniform but identifiable reference channels therefore lose their true slope, and singular reference channels are corrected toward zero rather than their mean.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant