computer vision - Gaussian smoothing filter -
they have asked me implement 2d gaussian smoothing using separable filter in python. don't know how that... in fact don't know difference 1d , 2d gaussian smoothing. find more info it?
thanks lot
about 2d filtering:
the gaussian smoothing operator 2-d convolution operator used `blur' images , remove detail , noise.
when working images - convolution operation calculates new values of given pixel, takes business relationship value of surrounding neighboring pixels. main element convolution kernel.
Сonvolution kernel - matrix (of arbitrary size, used square matrix (by default, 3x3)
[ ][ ][ ] [ ][k][ ] [ ][ ][ ]
convolution works simply: when calculating new value of selected pixel, convolution kernel applied center pixel. neighboring pixels covered same kernel. next, calculate sum of product of pixels in image values of convolution kernel, covered given pixel. resulting sum new value of selected pixel. now, if apply convolution each pixel in image, effect, depends on chosen convolution kernel.
for illustration have next image:
[47][48][49][ ][ ][ ][ ][ ][ ][ ][ ][ ] [47][50][42][ ][ ][ ][ ][ ][ ][ ][ ][ ] [47][48][42][ ][ ][ ][ ][ ][ ][ ][ ][ ] [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
and have convolution kernel:
[0][1][0] [0][0][0] [0][0][0]
result calculated in followinf way:
result = 47*0 + 48*1 + 49*0 + 47*0 + 50*0 + 42*0 + 47*0 + 48*0 + 42*0 = 48
the result of applying our kernel pixel value of 50:
[ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ] [ ][48][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ] [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ] [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
here explanation of gaussian smoothing. 1d , 2d gaussian smoothing:
"the convolution can in fact performed since equation 2-d isotropic gaussian shown above separable x , y components. 2-d convolution can performed first convolving 1-d gaussian in x direction, , convolving 1-d gaussian in y direction. "
you can seek appling convolution filter in site.
hope helpful you.
computer-vision
No comments:
Post a Comment