Chapter 6 Sampling, Reconstruction, and Interpolation (Including Bayer / Multi-Resolution)
One-Sentence Goal
Start from the sampling theorem to unify CFA mosaics, reconstruction/interpolation, and multi-resolution pyramids; publish auditable kernels, frequency budgets, and aliasing measures; and ensure imaging consistency across scales and pixel structures.
I. Scope & Targets
- Inputs
- From Chapter 3 (device & mode binding): pixel_pitch, CFA(pattern,map), binning_mode, mode_axes.
- From Chapter 4 (radiometric harmonization): I_lin or I_corr (linear domain).
- From Chapter 5 (transfer priors): MTF_pixel, MTF_sys, stab_trace (for motion-aware resampling).
- Outputs
- Demosaiced I_rgb or multispectral I_channels; resampled image I_rescaled; pyramid { MIP_0..L }.
- Kernels & frequency budgets: k_interp, h_lp, H_rec, alias_ratio, kernel_id.
- Contracts & manifest: assert_report.sampling, manifest.imaging.sampling.
- Boundaries
Spatially linear, time-invariant kernels are assumed. Adaptive/learning-based reconstructions must be captured as an equivalent kernel and effective MTF_proc at registration.
II. Terms & Variables
- Grids & sampling
- Source grid G_src = { (n * Δx, m * Δy) }, target grid G_tgt.
- Nyquist: f_Nx = 1 / ( 2 * Δx ), f_Ny = 1 / ( 2 * Δy ).
- CFA & masks
- CFA(x,y) ∈ {R,G,B} or extended { c_1..c_K }; binary mask M_c(x,y) ∈ {0,1}.
- Mosaic image: I_mos(x,y) = ∑_c M_c(x,y) * I_c(x,y).
- Kernels & filters
- Interpolation kernel k_interp(x) (1-D, separable to 2-D), low-pass h_lp(x), frequency response H(f).
- Common kernels: nearest, bilinear, bicubic(a), Lanczos(a).
- Operators
- Convolution *, downsampling down_K, upsampling up_K.
- Pyramid levels level = 0..L, with example scale scale(level) = 2^level.
III. Axioms P206- (Sampling & Reconstruction)*
- P206-1 (Linear domain first): Perform all sampling and reconstruction on I_lin or I_corr.
- P206-2 (Spectral window conservation): Before any down_K, configure h_lp so that the passband ≤ min(f_Nx,f_Ny)/K.
- P206-3 (Explicit, reproducible kernels): Persist parameterized k_interp, h_lp, with kernel_id and version.
- P206-4 (CFA consistency): CFA(pattern,map) aligns with the physical array; masks M_c are disjoint and complete: ∑_c M_c(x,y) = 1.
- P206-5 (Sampling–MTF coupling): On publication, report MTF_proc and verify with Chapter 5’s MTF_sys via composition.
- P206-6 (Time-base coherence): For cross-frame reconstruction or multi-frame SR, align on tau_mono and record offset/skew/J.
- P206-7 (Units & dimensions): check_dim( I_* ) = radiance (or linear intensity); resampling must not alter dimensions.
IV. Minimal Equations S206-*
- S206-1 (Regular sampling model)
m[n,m] = s( n * Δx, m * Δy ) + w[n,m], with noise term w. - S206-2 (CFA mosaic)
I_mos(x,y) = ∑_c M_c(x,y) * I_c(x,y), where M_c(x,y) ∈ {0,1} and ∑_c M_c = 1. - S206-3 (Linear demosaic prototype)
I_c_hat = ( up_1( M_c * I_mos ) * k_c ) + ∑_{c'≠c} α_{c,c'} * ( up_1( M_{c'} * I_mos ) * k_{c,c'} ).
Kernels k_c, k_{c,c'} are direction- or frequency-constrained; α_{c,c'} are cross-channel correction weights. - S206-4 (Anti-aliasing condition)
|H_lp(f)| ≈ 1, for |f| ≤ min(f_Nx,f_Ny)/K - ε, and |H_lp(f)| ≈ 0, for |f| > min(f_Nx,f_Ny)/K. - S206-5 (Resampling interpolation)
1-D separable form: I_rescaled(x) = ∑_n I_src[n] * k_interp( ( x / K - n ) ); 2-D via row/column products. - S206-6 (Lanczos-a kernel)
k_L(x) = sinc(x) * sinc( x / a ), when |x| < a; else k_L(x) = 0. - S206-7 (Bicubic—Keys(a))
- k_B(x) = {
- (a+2)|x|^3 - (a+3)|x|^2 + 1, if |x| < 1;
- a|x|^3 - 5a|x|^2 + 8a|x| - 4a, if 1 ≤ |x| < 2;
- 0, otherwise
- }.
- S206-8 (Pyramid generation)
G_{l+1} = down_2( G_l * h_lp ), LAP_l = G_l - up_2( G_{l+1} * h_lp ). - S206-9 (MTF impact of pixel binning)
For bin_m × bin_n:
MTF_bin(fx,fy) = MTF_pixel(fx,fy) * sinc( π * m * fx * pitch_x ) * sinc( π * n * fy * pitch_y ). - S206-10 (Aliasing measures, luma/chroma)
alias_ratio_luma = ( ∫_{Ω_alias} PDS_Y dΩ ) / ( ∫_{Ω_pass} PDS_Y dΩ ),
alias_ratio_chroma = ( ∫_{Ω_alias} PDS_C dΩ ) / ( ∫_{Ω_pass} PDS_C dΩ ).
V. Sampling & Reconstruction Process M60-*
- M60-1 Metadata ready: Load CFA(pattern,map), pixel_pitch, binning_mode, mode_axes; import MTF_pixel from Ch. 5.
- M60-2 Mosaic validation: Build M_c, verify exclusivity & coverage; assert ∑_c M_c = 1.
- M60-3 Demosaic strategy: strategy ∈ { gradient, edge-directed, frequency, learning }; register kernel_id and parameters.
- M60-4 Green-first recovery: For RGGB-type layouts, reconstruct G first using gradient constraints or frequency balancing; then reconstruct R,B and apply cross-channel de-artifacting.
- M60-5 Spectral hygiene: Using MTF_pixel and estimated H, attenuate chroma high frequencies to control alias_ratio_chroma.
- M60-6 Resampling & scaling: Choose k_interp for the target scale; for down_K, prefilter with h_lp (anti-alias); record H_rec.
- M60-7 Multi-resolution pyramid: Produce { G_0..G_L } and { LAP_0..LAP_{L-1} }; compute MTF_proc(level) at each scale.
- M60-8 Metrics & uncertainty: Report alias_ratio_{luma,chroma}, zipper_score, false_color_ratio, and evaluate u(metric).
- M60-9 Contract checks: Run assert_contract.sampling.
- M60-10 Persistence & signature:
manifest.imaging.sampling = { CFA, kernels, scales, metrics, hashes }, signed.
VI. Contracts & Assertions
- assert cfa_complete: ∀(x,y), ∑_c M_c(x,y) = 1.
- assert anti_alias: for down_K, alias_ratio_luma ≤ tol_alias_luma and alias_ratio_chroma ≤ tol_alias_chroma.
- assert identity@K=1: with K=1, resampling is L2-close to source: || I_rescaled - I_src ||_2 ≤ tol_identity.
- assert kernel_energy: ∑_x k_interp(x) = 1 (1-D); for separable 2-D kernels, row/column sums each normalize.
- assert mtf_compose: max| MTF_sys' - ( MTF_sys * MTF_proc ) | ≤ tol_compose.
- assert binning_consistency: under bin_m × bin_n, pixel-level statistics and energy conservation are within tolerance.
VII. Implementation Bindings I60-*
- I60-1 build_cfa_masks(pattern, size) -> { M_c }
- I60-2 demosaic(I_mos, M_c, strategy, params) -> I_rgb, artifacts
- I60-3 design_lowpass(K, pitch, mtf_pixel, spec) -> h_lp, H_lp
- I60-4 resample(I_in, scale, k_interp, h_lp=None) -> I_out, H_rec
- I60-5 make_pyramid(I_in, L, h_lp) -> { G_0..G_L, LAP_0..LAP_{L-1} }
- I60-6 estimate_aliasing(I, band_defs) -> { alias_ratio_luma, alias_ratio_chroma }
- I60-7 validate_sampling_contract(metrics, contracts) -> assert_report.sampling
- I60-8 emit_manifest_sampling(params, metrics, hashes) -> manifest
VIII. Cross-References
- Optical & pixel transfer, MTF_pixel and MTF_sys: this volume’s Chapter 5.
- Radiometric units & dimension checks: this volume’s Chapter 4; use check_dim per Methods.Cleaning v1.0, Chapter 4.
- Time base & alignment for multi-frame reconstruction: Methods.Cleaning v1.0, Chapter 5.
- Anomaly & drift monitoring (false color, jaggies): Methods.Cleaning v1.0, Chapter 8.
- Data schema & manifest keys: EFT.WP.Core.DataSpec v1.0.
IX. Quality Metrics & Risk Control
- Key indicators
alias_ratio_luma, alias_ratio_chroma, zipper_score, false_color_ratio, MTF_proc, u(alias_ratio). - Risk handling
- Aliasing above limits: tighten h_lp cutoff or use higher-order kernels; if needed, increase target pixel scale or publish a downsampled version.
- Visible false color: strengthen cross-channel constraints or enable direction-adaptive de-artifacting; down-rank q_score and record TraceID.
- Pyramid non-closure: verify up/down energy and offset pairings; roll back to the last freeze_release kernel configuration.
Summary
This chapter aligns the pipeline CFA → demosaic → anti-alias → resample → multi-resolution pyramid, standardizing kernel expressions and frequency budgets under a contract loop. Assertions such as alias_ratio, kernel_energy, and mtf_compose guarantee reconstruction consistency and auditability across Bayer and multi-resolution scenarios.