How to apply Gaussian filter for multiple frames/images instead of only one ?

7 views (last 30 days)
I want trying to apply a Gaussian filter between 200 images in MATLAB. I understand that for a spatial Gaussian filter, it filters on only one image/frame, how could I apply the Gaussian filter for multiple images/frames and for every pixels?
I thought out to define the images like this, but I'm not sure and I don't know what to do next.
img_array(:,:,1) = img1;
Could anyone give any suggestions on this problem ?
Thanks a lot.
  1 Comment
awa
awa on 30 Jun 2016
And I prefer the suggested solution is not using any built-in function so that I could understand more clearly.
Thank you.

Sign in to comment.

Answers (1)

J Weijs
J Weijs on 30 Jun 2016
Edited: J Weijs on 30 Jun 2016
Simply
img_array_filtered=imfilter(img_array,filter);
should work if your filter is 2D, in which case the filter will be applied to each image seperately. If you don't want to use built-in functions, you would have to write your own spatial convolution function, which isn't difficult starting from the mathematical definition of a convolution. It will be hard to produce a function that is as effcient as Matlab's built-in function though.
  1 Comment
awa
awa on 30 Jun 2016
Thanks for your answer.
What I meant is not to filter multiple images,but to filter multiple frames.
e.g. calculate the average mean value of the pixels that appears in the same location for the 1st frame, 2nd frame and 3rd frame simultaneously.
Currently the gaussian filter is only done only for all the pixels for one image, then done for other images.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!