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!