nabu.preproc.distortion module¶
- nabu.preproc.distortion.correct_distortion_interpn(image, coords, bounds_error=False, fill_value=None)[source]¶
Correct image distortion with scipy.interpolate.interpn.
- Parameters:
image (array) – Distorted image
coords (array) – Coordinates of the distortion correction to apply, with the shape (Ny, Nx, 2)
- class nabu.preproc.distortion.DistortionCorrection(estimation_method='fft-correlation', estimation_kwargs=None, correction_method='interpn', correction_kwargs=None)[source]¶
Bases:
object
A class for estimating and correcting image distortion.
Initialize a DistortionCorrection object.
- Parameters:
estimation_method (str) – Name of the method to use for estimating the distortion
estimation_kwargs (dict, optional) – Named arguments to pass to the estimation method, in the form of a dictionary.
correction_method (str) – Name of the method to use for correcting the distortion
correction_kwargs (dict, optional) – Named arguments to pass to the correction method, in the form of a dictionary.
- estimation_methods = {'fft-correlation': <function estimate_flat_distortion>}¶
- correction_methods = {'interpn': <function correct_distortion_interpn>}¶
- estimate(image, reference_image)¶
- correct(image, coords)¶