Function iterative_deconv

Source
pub fn iterative_deconv<T>(
    input: &Array<T>,
    kernel: &Array<f32>,
    iterations: u32,
    relaxation_factor: f32,
    algo: IterativeDeconvAlgo,
) -> Array<T::AbsOutType>
Expand description

Iterative Deconvolution

The following table shows the iteration update equations of the respective deconvolution algorithms.

AlgorithmUpdate Equation
LandWeber $ \hat{I}_{n} = \hat{I}_{n-1} + \alpha * P^T \otimes (I - P \otimes \hat{I}_{n-1}) $
Richardson-Lucy $ \hat{I}_{n} = \hat{I}_{n-1} . ( \frac{I}{\hat{I}_{n-1} \otimes P} \otimes P^T ) $

where

  • $ I $ is the observed(input/blurred) image
  • $ P $ is the point spread function
  • $ P^T $ is the transpose of point spread function
  • $ \hat{I}_{n} $ is the current iteration’s updated image estimate
  • $ \hat{I}_{n-1} $ is the previous iteration’s image estimate
  • $ \alpha $ is the relaxation factor
  • $ \otimes $ indicates the convolution operator

The type of output Array from deconvolution will be of type f64 if the input array type is f64. For other types, output type will be f32 type. Should the caller want to save the image to disk or require the values of output to be in a fixed range, that should be done by the caller explicitly.