Can I get matrix operator for imfilter?
이전 댓글 표시
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?
채택된 답변
추가 답변 (1개)
Image Analyst
2015년 9월 26일
0 개 추천
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
jakeoung koo
2015년 9월 26일
편집: jakeoung koo
2015년 9월 26일
Image Analyst
2015년 9월 26일
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
2015년 9월 27일
Image Analyst
2015년 9월 27일
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.
카테고리
도움말 센터 및 File Exchange에서 Image Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!