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

8 次查看(过去 30 天)
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 个评论
awa
awa 2016-6-30
And I prefer the suggested solution is not using any built-in function so that I could understand more clearly.
Thank you.

请先登录,再进行评论。

回答(1 个)

J Weijs
J Weijs 2016-6-30
编辑:J Weijs 2016-6-30
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 个评论
awa
awa 2016-6-30
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.

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by