convolution
1 view (last 30 days)
Show older comments
Would anyone be able to explain what this command does to an image?
fx =conv2(image1,[-1 1;1 1],'same');
0 Comments
Answers (1)
Wayne King
on 9 Dec 2011
Hi Priya, this implements bandpass filtering on an image.
If you have the Image Processing Toolbox, do:
h = [-1 1; 1 1];
freqz2(h);
You'll see that this is a bandpass filter (and as David Young correctly points out in his comment -- I incorrectly labeled it as highpass initially).
Contrast it with a lowpass filter:
Lo =[ -0.0106 0.0329 0.0308 -0.1870 -0.0280 0.6309 0.7148 0.2304];
Lo = Lo'*Lo;
freqz2(Lo);
Or a highpass filter
hi = [-0.2304 0.7148 -0.6309 -0.0280 0.1870 0.0308 -0.0329 -0.0106];
hi = hi'*hi;
freqz2(hi);
Thanks to David for his correction.
1 Comment
David Young
on 9 Dec 2011
Doesn't it let through a lot of the DC component for a highpass filter? It's equal to 0.5 + [-1.5 0.5; 0.5 0.5] and while the second part of this is indeed highpass (but with a rather unusual asymmetrical form), having half the local mean added in surely makes it a kind of anisotropic bandpass, no?
See Also
Categories
Find more on Digital Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!