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)));

Réponses (1)

Image Analyst
Image Analyst le 13 Juin 2022
Modifié(e) : Image Analyst le 13 Juin 2022
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.

Produits

Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by