From: Syed on 20 Feb 2010 15:10 Hi All, I have taken 'Computer Vision' course this semester and using MATLAB for the first time. First of all, I'm confused regarding the purpose of convolution. Linear Filtering with correlation made sense to me because nearby pixels would be similar, so smoothing using correlation would resuce noise. Reading the MATLAB manual, I found out that if the filtering kernel is rotated about 180 degrees and then applied to the image, then this is filtering with convolution. What do we actually get by doing this? I tried doing both of them on MATLAB's sample grayscale image 'cameraman.tif' using the kernel '[0.1 0.04 0.004; 0.2 0.07 0.008; 0.4 0.0001 0.1059]'. I found out that using correlation, the smoothing was done but also the image was somewhat shifted (translated) to the right, while using convolution smoothing was done but there was no shifting(translation). Am I right about this? Please give me proper explanation about it. Thank you. Best Regards, Syed Rizvi
From: ImageAnalyst on 20 Feb 2010 16:24 Syed Rizvi : If the kernels are symmetric about the diagonal then they are the same - basically just multiplying pixel by pixel in the window and summing. The resulting image is enlarged with either method. If you don't know what to do about that, then yes, it will appear to shift the image, but not really - it only appears that way because MATLAB can't have negative indexes. If the kernel is not symmetric about its mid line then it can make it look like the image has been shifted. If you use the 'same' option in the conv2() function then it appears not to shift the image but that is just because it chops off the edges. When your window is only partially overlapping your signal, that is a boundary or edge effect and you have to make some decision about what you want to do there since some pixels are missing. There are several common decisions such as assuming missing pixels are zero, or shrinking the window (kernel), etc. Or you can just not go out that far (essentially cropping off any edge effects).
|
Pages: 1 Prev: Visa / Instrument control toolbox. Next: Capture with vcapg2 |