ex-6: rearranged the RL deconvolution description

This commit is contained in:
Giù Marcer 2020-03-27 23:18:17 +01:00 committed by rnhmjoj
parent 7761ca5a4f
commit 4ba6f68a35

View File

@ -107,14 +107,14 @@ The convolution was implemented as follow. Consider the definition of
convolution of two functions $f(x)$ and $g(x)$: 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 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 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 down to an element wise product between $s$ and the reverse histogram of $k$
relative position of the two histograms. Namely, if $c_i$ is the $i^{\text{th}}$ for each relative position of the two histograms. Namely, if $c_i$ is the
bin of the convoluted histogram: $i^{\text{th}}$ bin of the convoluted histogram:
$$ $$
c_i = \sum_j k_j s_{i - j} c_i = \sum_j k_j s_{i - j}
@ -186,7 +186,7 @@ one.
\node [above] at (1.95,0) {$s_{i-3}$}; \node [above] at (1.95,0) {$s_{i-3}$};
\node [below] at (1.75,-1) {$k_3$}; \node [below] at (1.75,-1) {$k_3$};
\end{tikzpicture} \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 (above) and the kernel (center). The final result is the lower
fledging histogram.}\label{fig:dot_conv} 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)$: 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. 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: transforms and the anti-transformation of the result:
$$ $$
\hat{F}[s*k] = \hat{F}[s] \cdot \hat{F}[k] \thus \hat{F}[s \otimes k] = \hat{F}[s] \cdot \hat{F}[k] \thus
\hat{F} [s] = \frac{\hat{F}[s*k]}{\hat{F}[k]} \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) 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} \end{figure}
When $\hat{F}[s*k]$ and $\hat{F}[k]$ are computed, their normal format must be When $\hat{F}[s \otimes k]$ and $\hat{F}[k]$ are computed, their normal format
restored in order to use them as standard complex numbers and compute the ratio must be restored in order to use them as standard complex numbers and compute
between them. Then, the result must return in the half-complex format for the the ratio between them. Then, the result must return in the half-complex format
inverse DFT application. for the inverse DFT application.
GSL provides the function `gsl_fft_halfcomplex_unpack` which passes the vectors GSL provides the function `gsl_fft_halfcomplex_unpack` which passes the vectors
from half-complex format to standard complex format. The inverse procedure, from half-complex format to standard complex format. The inverse procedure,
required to compute the inverse transformation of $\hat{F}[s]$, which is not 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: $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 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 the detected intensity at pixel $i$. Hence, the matrix describes the portion of
$P_{i,j}$ describes the portion of signal from the source pixel $j$ that is signal from the source pixel $j$ that is detected in pixel $i$.
detected in pixel $i$. In one dimension, the transfer function can be expressed in terms of the
In one dimension, the transfer function distance between the source pixel $j$ and the observed $i$:
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}$, In order to estimate $u_j$ given {$d_i$} and $\widetilde{P}$, the following
the following iterative procedure for the estimate $\hat{u}^t_j$ of $u_j$ can iterative procedure can be applied for the estimate $\hat{u}^t_j$ of $u_j$,
be applied. The $t^{\text{th}}$ iteration is updated as follows: 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} \hat{u}^{t+1}_j = \hat{u}^t_j \sum_i \frac{d_i}{c_i} \, P_{i - j}
\with c_i = \sum_j P_{ij} {\hat{u^t}}_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 It has been shown empirically that if this iteration converges, it converges to
the maximum likelihood solution for $u_j$. the maximum likelihood solution for $u_j$. Writing it in terms of convolution,
Writing this more generally in terms of convolution with a point spread function it becomes:
$\tilde{P}$ it becomes:
$$ $$
\hat{u}^{t+1} = \hat {u}^{t} \cdot \left( \frac{d}{{\hat{u}^{t}} \otimes \hat{u}^{t+1} = \hat {u}^{t} \cdot \left( \frac{d}{{\hat{u}^{t}} \otimes P}
\widetilde{P}} \otimes \widetilde{P}^{\star} \right) \otimes P^{\star} \right)
$$ $$
where the division and multiplication are element wise, and 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.
--- ---