3x3 pixel Gaussian filter with σ=1 pixel after using blockproc?

How do you run a 3x3 pixel Gaussian filter with a σ=1 on the individual blocks after splitting an image with blockproc function in Matlab?
Used blockproc to divide the image into 50x50 pixel blocks but don't know how to run a filter on each block individually.
This was the line of code that I used :
ffts = blockproc(I, [50 50], @(block_struct) fftshift(fft2(block_struct.data)));

Answers (1)

I think you'd use imgaussfilt with a custom function to blockproc. Adapt the attached example.
I also recommend you use odd numbered window sizes. With even numbered ones you'll have a half pixel shift in the output.

Products

Release

R2021a

Asked:

on 12 Jun 2022

Edited:

on 13 Jun 2022

Community Treasure Hunt

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

Start Hunting!