# How to filter a sequence of frames?

I'm have a sequence of 2-dimensional MxN frames. I have concatenated these frames to form a 3-dimensional MxNxT matrix. Now i want to filter this 3D volume by 2 types of filters (a 2D log-Gabor in xy-direction, and a 1D gaussian in z-direction).

Here is my MATLAB implementation:

[yGrid,xGrid] = ndgrid(1:size(D,1),1:size(D,2));
sigmaXY = 0.5;
sigmaT = 1;
numFilts = length(Scales);
w = sqrt(yGrid.^2 + xGrid.^2);
bpFilt = zeros(size(D,1),size(D,2),size(D,3),numFilts);

for sc = 1:numFilts
for t = 1:size(D,3)
w0 = 1.0/Scales(sc);
bpFilt(:,:,t,sc) = exp((-(log(w/w0)).^2) / (2 * log(sigmaXY)^2)) * ...
exp(-t.^2) / (2 * sigmaT^2);
end
end

DF = fftn(D);
DFfilt = bsxfun(@times, DF, bpFilt);


where D is my 3D data. The output DFfilt is fft inverted and plotted then. But all frames look the same in the output!

Where am I mistaken?

Is there any better suggestion to implement the filtering?

• first of all, your filters in spatial and temporal direction are separable. I'd recommend doing the filtering in two separate steps, so that you even get a chance to look at the intermediate results. Does the equality of images happen before or after the temporal filtering? – Marcus Müller May 13 '18 at 11:59
• @MarcusMüller It happens after implementing the combined filter but I think the problem is in the gaussian filter (second part). – M.Jalali May 13 '18 at 14:18