I will try to address @Hilmar answer and answer the general question.
Hilmar Answer
Deconvolution is in the general case not possible, so it needs to be
approximated with application specific constraints and requirements.
Let's look at a simple 1-dimensional example that illustrates the
problem. Assume you have an impulse response like your kernel, i.e. h
= [1 1 1]
. Then let's look at the output of a signal (which you can think of a line of pixels), x = [2 -1 -1 2 -1 -1 2 -1 -1 2 -1 -1 2 -1
-1]
. The result of the convolution is
2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 -2 -1
The case above is simply wrong. Specifically if one looks on my comment:
The result being zero doesn't mean data is lost. It has the same information as any other number.
Let's do the following example:
% Input Signal
vX = [2; -1; -1; 2; -1; -1; 2; -1; -1; 2; -1; -1; 2; -1; -1];
% Convolution Kernel
vH = [1; 1; 1];
% Convolution Result
vC = conv(vX, vH, 'full');
% Convolution Operator - Matrix Form
mH = CreateConvMtx1D(vH, length(vX), 1);
% Deconvolution
vXR = mH \ vC;
Where CreateConvMtx1D()
is given in my GitHub Code.
The result is given by:
vXR.'
ans =
2.0000 -1.0000 -1.0000 2.0000 -1.0000 -1.0000 2.0000 -1.0000 -1.0000 2.0000 -1.0000 -1.0000 2.0000 -1.0000 -1.0000
Which is a perfect reconstruction of the input signal.
General Case
Indeed the properties of Deconvolution in 1D and 2D are similar.
The ability to reconstruct the signal are basically a function of 2 parameters:
- The SNR of the data (Added noise).
- The Condition Number of the Convolution Operator of the problem.
Let us assume there is no added noise in the problem.
Then we're only limited by the Condition Number.
In theory, for any bounded Condition Number one would be able to perfectly reconstruct the signal. Yet since we use finite and quantized representation of numbers (Let's say Float64
) we are limited with the condition number we're able to tackle.
For more details see - 1D Deconvolution with Gaussian Kernel (MATLAB).