opticks.contrast_model.processing_mtf
Image-processing-stage MTF models (resampling, sharpening, etc.).
Currently includes:
Resampling MTF for orthorectification / geometric correction with configurable interpolation kernels (nearest-neighbor, bilinear, bicubic, Lanczos, ideal sinc). Models both up- and downsampling via the
p_eff = max(input_pitch, output_pitch)rule (Schowengerdt; Holst, CMOS/CCD Sensors and Camera Systems, 2nd ed., Ch. 10).
Functions
|
1-D resampling MTF for a chosen interpolation kernel. |
|
Validate that supplied/missing parameters match the selected kernel. |
Classes
|
Interpolation kernel selection for the resampling MTF. |
- class ResamplingKernel(label, required_params)[source]
Interpolation kernel selection for the resampling MTF.
Each member carries its
required_params- the set of optional parameter names the kernel accepts. Any optional parameter not in this set is forbidden (triggersValueErrorif supplied).- BICUBIC = ('bicubic', {'bicubic_a'})
- BILINEAR = ('bilinear', {})
- LANCZOS = ('lanczos', {'lanczos_n'})
- NEAREST_NEIGHBOR = ('nearest_neighbor', {})
- SINC = ('sinc', {})
- resampling_mtf_1d(input_line_freq, kernel, input_pitch, output_pitch, bicubic_a=None, lanczos_n=None)[source]
1-D resampling MTF for a chosen interpolation kernel.
Models the MTF of an interpolation step that resamples from a grid of spacing
input_pitch(= local SSD on the ground in the geometric-correction case) onto a grid of spacingoutput_pitch(= ortho grid). The kernel is scaled to:p_eff = max(input_pitch, output_pitch)
so the same expression covers both upsampling and downsampling (the kernel doubles as anti-alias prefilter on downsample):
MTF(f) = |H_kernel(f * p_eff)|
The returned value is always non-negative; the absolute value is taken because Bicubic, Lanczos, and the bare sinc all have negative side-lobes that would be misleading inside an MTF chain product.
- Return type:
- Parameters:
input_line_freq (
Quantity) – Spatial frequency (e.g. in cy/m or cy/mm).kernel (
ResamplingKernel) – Selected resampling kernel.input_pitch (
Quantity[``”length”``]) – Local input sample spacing (= SSD on ground for ortho).output_pitch (
Quantity[``”length”``]) – Output resampling grid pitch.bicubic_a (
float, optional) – Keys cubic shape parameter; defaults to -0.5. Only used whenkernel == BICUBIC.lanczos_n (
int, optional) – Lanczos lobe count; defaults to 3. Only used whenkernel == LANCZOS.
- Returns:
float | NDArray[np.float64]– Resampling MTF value(s) in [0, 1].