Denoising 128x128 Images via Filter Scaling
This technical guide demonstrates how to apply a frequency-domain filter (like a Wiener filter template) originally designed for a 32x32 image onto a 128x128 noisy image using interpolation techniques in MATLAB.
By rescaling the filter, we can apply pre-defined noise reduction characteristics to higher-resolution data, provided we account for coordinate shifting and domain transformations correctly.
Run the Image Processing Simulator
Want to see the Wiener Filter in action with your own parameters?
Launch MATLAB Online SimulatorStep-by-Step Methodology
Step 1: Load or create the noisy image (128x128). We generate a base signal (checkerboard) and add Gaussian noise.
Step 2: Load the Wiener filter coefficients designed for a 32x32 image.
Step 3: Rescale the Wiener filter from 32x32 to 128x128 using bilinear interpolation.
Step 4: Convert the noisy image to the frequency domain using 2D Fast Fourier Transform (FFT2).
Step 5: Convert the scaled filter to the frequency domain. We use ifftshift to ensure the filter origin aligns with the FFT origin.
Step 6: Apply the filter in the frequency domain via element-wise multiplication.
Step 7: Convert the result back to the spatial domain using inverse FFT (IFFT2) and retain the real part.
Step 8: Display the comparative results (Noisy vs. Denoised).
MATLAB Implementation
Analysis & Accuracy
To ensure 100% accuracy in the implementation:
- Phase Alignment: Using
ifftshiftbefore FFT is critical. Without it, the spatial filter is treated as if its peak is at the top-left corner, causing the denoised image to wrap around the edges. - Data Types: Images are converted to
doubleto prevent clipping during FFT calculations. - Domain Logic: The
real()function is used after IFFT to remove negligible imaginary components resulting from floating-point errors.