Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
A question of Gaussian Smooth

Subject: A question of Gaussian Smooth

From: dai zhengguo

Date: 4 Apr, 2010 07:26:02

Message: 1 of 1

My problem is why I can not get the same result since it is well known that the Gaussian filter is separable.
The following is to convolve along rows and then columns.
  width = 4 ; ssq = 1 ;
  t = (-width:width);
  gau = exp(-(t.*t)/(2*ssq))/(2*pi*ssq); % the gaussian 1D filter
  aSmooth=imfilter(a,gau,'conv','replicate'); % run the filter across rows
  aSmooth1=imfilter(aSmooth,gau','conv','replicate'); % and then across columns

And we construct a 2D gaussian Filter:
G2D = fspecial('gaussian',9,1) ;
aSmooth2= imfilter(a,Gaussianfilter,'conv','replicate');

But the result of aSmooth2 is not the same as aSmooth1, can anybody tell me why ?
Thanks a lot.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us