Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deconvolution Between Matrix and Sub Matrix

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.

like image 231
no_name Avatar asked Jan 17 '23 06:01

no_name


2 Answers

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.

like image 152
Andrey Rubshtein Avatar answered Jan 29 '23 01:01

Andrey Rubshtein


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]

like image 41
Yanai Ankri Avatar answered Jan 28 '23 23:01

Yanai Ankri