I have a matrix a=[[1 2 3]; [4 5 6]; [7 8 9]]
and a submatrix b=[[5 6];[8 9]]
.
Is there a method in matlab for deconvolving (a,b)
?
I am looking for a method fo recognize the presence of a submatrix in a possible giant matrix. By a sort of deconvolution I expect to obtain something like a matrix with zeros all around and 1
in the place where the submatrix is present.
In the above example, a 1
in the right-down corner.
There is a better explanation here.
Let's talk about 1D deconvolution for simplicity sake.
Your signal can be represented as a vector, and convolution is multiplication with a tridiagonal matrix.
For example:
Your vector/signal is:
V1
V2
...
Vn
Your filter (convolving element) is:
[b1 b2 b3];
So the matrix is nxn
: (Let it be called A
):
[b2 b3 0 0 0 0.... 0]
[b1 b2 b3 0 0 0.... 0]
[0 b1 b2 b3 0 0.... 0]
.....
[0 0 0 0 0 0...b2 b3]
Convolution is:
A*v;
And de-convolution is
A^(-1) * ( A) * v;
Obviously, in some cases de-convolution is not possible. Then you will have singular A
.
But if A^-1
exists, you need to compute it, and apply it on the result.
For 2D case, it is a bit more complex, but the idea is the same.
If you want to find the presence, or the likelihood of presence, of small matrix inside another, then you're looking for correlation, not deconvolution.
The simplest method would be to use normxcorr2
, which return a matrix of values [-1..1], where 1 means the pixel where the small matrix is found.
The drawback/benefit is that normxcorr2 is not sensitive to gain, meaning if you're looking for [1 2 3 4] then you'll also find [2 4 6 8]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With