From 4ba6f68a3585e27a7792bec1392fca523b9c059c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gi=C3=B9=20Marcer?= Date: Fri, 27 Mar 2020 23:18:17 +0100 Subject: [PATCH] ex-6: rearranged the RL deconvolution description --- notes/sections/6.md | 63 +++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/notes/sections/6.md b/notes/sections/6.md index 275f3be..17f546b 100644 --- a/notes/sections/6.md +++ b/notes/sections/6.md @@ -107,14 +107,14 @@ The convolution was implemented as follow. Consider the definition of convolution of two functions $f(x)$ and $g(x)$: $$ - f*g (x) = \int \limits_{- \infty}^{+ \infty} dy f(y) g(x - y) + f \otimes g (x) = \int \limits_{- \infty}^{+ \infty} dy f(y) g(x - y) $$ Since a histogram is made of discrete values, a discrete convolution of the signal $s$ and the kernel $k$ must be computed. Hence, the procedure boils -down to a dot product between $s$ and the reverse histogram of $k$ for each -relative position of the two histograms. Namely, if $c_i$ is the $i^{\text{th}}$ -bin of the convoluted histogram: +down to an element wise product between $s$ and the reverse histogram of $k$ +for each relative position of the two histograms. Namely, if $c_i$ is the +$i^{\text{th}}$ bin of the convoluted histogram: $$ c_i = \sum_j k_j s_{i - j} @@ -186,7 +186,7 @@ one. \node [above] at (1.95,0) {$s_{i-3}$}; \node [below] at (1.75,-1) {$k_3$}; \end{tikzpicture} -\caption{Dot product as a step of the convolution between the original signal +\caption{Element wise product as a step of the convolution between the original signal (above) and the kernel (center). The final result is the lower fledging histogram.}\label{fig:dot_conv} } @@ -200,7 +200,7 @@ Fast Fourier Transform. This method is based on the property of the Fourier transform according to which, given two functions $f(x)$ and $g(x)$: $$ - \hat{F}[f*g] = \hat{F}[f] \cdot \hat{F}[g] + \hat{F}[f \otimes g] = \hat{F}[f] \cdot \hat{F}[g] $$ where $\hat{F}[\quad]$ stands for the Fourier transform of its argument. @@ -209,8 +209,8 @@ trasform of the smeared signal and the kernel, the ratio between their transforms and the anti-transformation of the result: $$ - \hat{F}[s*k] = \hat{F}[s] \cdot \hat{F}[k] \thus - \hat{F} [s] = \frac{\hat{F}[s*k]}{\hat{F}[k]} + \hat{F}[s \otimes k] = \hat{F}[s] \cdot \hat{F}[k] \thus + \hat{F} [s] = \frac{\hat{F}[s \otimes k]}{\hat{F}[k]} $$ Being the histogram a discrete set of data, the Discrete Fourier Transform (DFT) @@ -302,10 +302,10 @@ the negative backwards from the end of the array (see @fig:reorder). } \end{figure} -When $\hat{F}[s*k]$ and $\hat{F}[k]$ are computed, their normal format must be -restored in order to use them as standard complex numbers and compute the ratio -between them. Then, the result must return in the half-complex format for the -inverse DFT application. +When $\hat{F}[s \otimes k]$ and $\hat{F}[k]$ are computed, their normal format +must be restored in order to use them as standard complex numbers and compute +the ratio between them. Then, the result must return in the half-complex format +for the inverse DFT application. GSL provides the function `gsl_fft_halfcomplex_unpack` which passes the vectors from half-complex format to standard complex format. The inverse procedure, required to compute the inverse transformation of $\hat{F}[s]$, which is not @@ -330,42 +330,43 @@ image can be represented in terms of a transition matrix $P$ operating on an underlying image: $$ - d_i = \sum_{j} P_{i, j} u_j + d_i = \sum_{j} u_j \, P_{i, j} $$ where $u_j$ is the intensity of the underlying image at pixel $j$ and $d_i$ is -the detected intensity at pixel $i$. In general, a matrix whose elements are -$P_{i,j}$ describes the portion of signal from the source pixel $j$ that is -detected in pixel $i$. -In one dimension, the transfer function -can be expressed in terms of the distance between the source pixel $j$ and the -observed $i$: +the detected intensity at pixel $i$. Hence, the matrix describes the portion of +signal from the source pixel $j$ that is detected in pixel $i$. +In one dimension, the transfer function can be expressed in terms of the +distance between the source pixel $j$ and the observed $i$: $$ - P_{i, j} = \widetilde{P}(i-j) + P_{i, j} = \widetilde{P}(i-j) = P_{i - j} $$ -In order to estimate $u_j$ given the observed $d_i$ and a known $\widetilde{P}$, -the following iterative procedure for the estimate $\hat{u}^t_j$ of $u_j$ can -be applied. The $t^{\text{th}}$ iteration is updated as follows: +In order to estimate $u_j$ given {$d_i$} and $\widetilde{P}$, the following +iterative procedure can be applied for the estimate $\hat{u}^t_j$ of $u_j$, +where $t$ stands for the iteration number. The $t^{\text{th}}$ step is updated +as follows: $$ - \hat{u}^{t+1}_j = \hat{u}^t_j \sum_i \frac{d_i}{c_i} \, P_{ij} - \with c_i = \sum_j P_{ij} {\hat{u^t}}_j. + \hat{u}^{t+1}_j = \hat{u}^t_j \sum_i \frac{d_i}{c_i} \, P_{i - j} + \with c_i = \sum_j \hat{u}^t_j \, P_{i - j} $$ +where $c_i$ is thereby an estimation of the blurred signal obtained with the +previous estimation of the clean signal. It has been shown empirically that if this iteration converges, it converges to -the maximum likelihood solution for $u_j$. -Writing this more generally in terms of convolution with a point spread function -$\tilde{P}$ it becomes: +the maximum likelihood solution for $u_j$. Writing it in terms of convolution, +it becomes: $$ - \hat{u}^{t+1} = \hat {u}^{t} \cdot \left( \frac{d}{{\hat{u}^{t}} \otimes - \widetilde{P}} \otimes \widetilde{P}^{\star} \right) + \hat{u}^{t+1} = \hat {u}^{t} \cdot \left( \frac{d}{{\hat{u}^{t}} \otimes P} + \otimes P^{\star} \right) $$ where the division and multiplication are element wise, and -$\widetilde{P}^{\star}$ is the flipped point spread function. +$P^{\star}$ is the flipped point spread function. + ---