Can I get matrix operator for imfilter?
Mostrar comentarios más antiguos
For example, I can get x-direction gradient of image through u_x = imfilter(u, [1 -1], 'corr','symmetric','same');
But I want to get the matrix operator corresponding to the above such that D*u = u_x Is it possible? (For example, in one dimension, D*u := [1 -1 0; 0 1 -1; 0 0 1] * [u1; u2; u3];)
(Additional question) Actually, what I want to do is to get transpose of D, i.e., D'. Is there a way to directly apply D' through imfilter?
Respuesta aceptada
Más respuestas (1)
Image Analyst
el 26 de Sept. de 2015
0 votos
I don't know what all those dollar signs mean. And I have no idea what D is.
You know the filter because you pass it in. You passed in [1, -1] so that is your filter matrix - what you I guess you call "matrix operator".
4 comentarios
jakeoung koo
el 26 de Sept. de 2015
Editada: jakeoung koo
el 26 de Sept. de 2015
Image Analyst
el 26 de Sept. de 2015
And why do you think that you can get the same thing as a convolution by doing a matrix multiplication of a single matrix times the whole image?
jakeoung koo
el 27 de Sept. de 2015
Image Analyst
el 27 de Sept. de 2015
No, it can't. Think of it like this, in a matrix multiplication, the upper left element is the sum of the products of the first row of one matrix times the first row of the second matrix. So, that upper left element has "information" about all those pixels. In a convolution with a 3x3 window, the first element has information about every element in the 3x3 window, and information about the upper left 3x3 window of the second, larger matrix. Totally different pixels are going into the result, so they are not the same.
Perhaps you were thinking of something like convolution in the spatial or time domain is equivalent to multiplication in the frequency domain (which is true), and just got confused.
Categorías
Más información sobre Image Filtering en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!