Image Processing and Pattern RecognitionUnit 411 min read
Image Restoration: Noise Removal, Blur Correction & Artifact Recovery
Unit 4 of Image Processing and Pattern Recognition covers techniques to reverse degradation in digital images caused by noise, blur, or sensor defects, including filtering methods, inverse filtering, Wiener filtering, and geometric corrections—essential for medical imaging, satellite photos, and surveillance systems.
TAKEAWAYS:
- Image restoration reverses degradation (noise, blur, or distortion) to recover the original image using mathematical models like inverse filtering or Wiener filtering.
- Noise models (Gaussian, salt-and-pepper, Poisson) dictate the restoration approach—e.g., median filters for salt-and-pepper noise.
- Blind deconvolution estimates both the blur kernel and original image when the degradation process is unknown (common in astronomy).
- Geometric corrections (e.g., affine transformations) fix distortions from camera motion or lens defects.
- Regularization (e.g., Tikhonov) prevents overfitting in ill-posed restoration problems.
- Real-world applications include medical imaging (MRI/CT artifact removal), satellite imagery (cloud/atmospheric correction), and facial recognition (low-light enhancement).
1. Why Image Restoration?
Digital images degrade due to:
- Noise: Random variations (e.g., sensor thermal noise, transmission errors).
- Blur: Motion, defocus, or atmospheric turbulence.
- Defects: Sensor malfunctions (e.g., "dead pixels") or compression artifacts.
Goal: Recover the original (latent) image from the degraded observation , where:
- : Degeneration operator (e.g., blur kernel).
- : Noise.
2. Noise Models and Filters
Noise types and their restoration strategies:
| Noise Type | Cause | Restoration Method | Example Filter |
|---|---|---|---|
| Gaussian | Sensor thermal noise | Linear smoothing (Gaussian, mean) | Mean filter |
| Salt-and-Pepper | Transmission errors, bit errors | Nonlinear median filtering | Median filter |
| Poisson | Low-light imaging (photon counting) | Anscombe transform + Wiener filter | Adaptive median filter |
| Speckle | Ultrasound/SAR radar | Multiplicative noise models | Lee filter |
Worked Example: Median Filter for Salt-and-Pepper Noise
Scenario: A corrupted image from a Nepalese traffic camera (e.g., NTC surveillance) has 20% salt-and-pepper noise. Restore it using a 3×3 median filter.
Steps:
- Input: Degraded image with noise.
- Window: Slide a 3×3 window over .
- Median: Replace center pixel with the median of the 9 values.
- Output: Restored image .
Visual:
Result: Sharpens edges (e.g., license plates) while removing noise spikes.
3. Blur Models and Deconvolution
Blur arises from:
- Motion blur: Camera/object movement (e.g., Pathao driver’s phone camera).
- Defocus blur: Out-of-focus lens (e.g., Nepalese smartphone photos).
- Atmospheric blur: Haze in outdoor images (e.g., mountain photos from Pokhara).
Mathematical Model:
- : Point Spread Function (PSF) or blur kernel.
- : Convolution operator.
Deconvolution Methods
| Method | When to Use | Formula | Limitation |
|---|---|---|---|
| Inverse Filtering | Known , no noise | Amplifies noise if | |
| Wiener Filter | Noise present, known | Requires noise variance | |
| Blind Deconvolution | Unknown (e.g., astronomy) | Iterative estimation of and | Computationally expensive |
Worked Example: Wiener Filter for Motion Blur Scenario: A Daraz delivery photo is blurred due to camera shake. The blur kernel is a linear motion blur of length 5 pixels. Noise variance .
Steps:
- Compute Fourier transforms:
- Apply Wiener filter:
- Inverse Fourier transform to get .
Visual:
graph TD
A["Blurred Image\n(g(x,y))"] -->|"Fourier Transform"| B["Frequency Domain\nG(u,v), H(u,v)"]
B -->|"Wiener Filter"| C["Restored Frequency\nŶ(u,v)"]
C -->|"Inverse FT"| D["Deblurred Image\n(ŷ(x,y))"]Output: Sharper edges (e.g., product details in the Daraz image).
4. Geometric Distortions and Corrections
Caused by:
- Lens distortion: Barrel/pincushion (e.g., GoPro cameras).
- Camera motion: Rotation/scaling (e.g., drone footage).
- Perspective: Vanishing points (e.g., Kathmandu street photos).
Correction Methods:
| Distortion | Model | Correction Technique |
|---|---|---|
| Radial (lens) | Polynomial fitting + remapping | |
| Affine | Homography matrix estimation | |
| Perspective | 3D → 2D projection | Direct Linear Transform (DLT) |
Worked Example: Affine Correction for Drone Imagery Scenario: A Ncell drone survey image of a Pokhara field is skewed due to tilt. Estimate the affine transform: Steps:
- Identify 4+ control points (e.g., road intersections).
- Solve for and using least squares.
- Apply inverse transform to warp the image.
Visual:
graph LR
A["Distorted Drone\nImage"] -->|"Affine Transform"| B["Control Points\n(4+ corners)"]
B -->|"Solve for A,b"| C["Corrected Ortho-\nImage"]Output: Rectified image for accurate land measurement.
5. Regularization and Ill-Posed Problems
Problem: Restoration is ill-posed (no unique solution) due to:
- Noise amplification (inverse filtering).
- Missing high-frequency details.
Solution: Add a regularization term to constrain the solution:
- : Regularization operator (e.g., Laplacian for smoothness).
- : Trade-off parameter.
Example: Tikhonov Regularization (for blur + noise):
6. Real-World Applications
In the Real World
Medical Imaging (Nepal Health Hospitals)
- MRI/CT Artifact Removal: Wiener filtering removes streaking artifacts from Nepal’s Patan Hospital scans, improving diagnosis.
- Noise Reduction: Median filters clean ultrasound images (e.g., fetal scans) by removing speckle noise.
Satellite and Remote Sensing (Nepal’s Department of Survey)
- Cloud Correction: Blind deconvolution removes atmospheric blur from Nepal’s satellite images (e.g., landslide monitoring).
- Geometric Correction: Affine transforms align drone maps for accurate disaster response (e.g., floods in Chitwan).
Facial Recognition (eSewa/Khalti Biometrics)
- Low-Light Enhancement: Wiener filters sharpen nighttime ID photos in Khalti’s facial recognition, reducing false rejects.
Autonomous Vehicles (Pathao/Nepal’s EV Startups)
- Motion Deblurring: Inverse filtering sharpens dashboard camera feeds for real-time obstacle detection.
Worked Example: Restoring a Blurry NEPSE Stock Chart
Scenario: A NEPSE daily closing price chart is blurred due to poor resolution. The blur kernel is a Gaussian with σ=2.
Steps:
- Model: , where is Gaussian.
- Wiener Filter: Compute , with .
- Result: Smoother price trends (e.g., clearer support/resistance levels).
Visual:
7. Exam Tip
What Examiners Look For:
- Mathematical Rigor:
- Derive the Wiener filter formula from scratch (show steps).
- Explain why inverse filtering fails for noisy images (amplification of high frequencies).
- Practical Scenarios:
- Link restoration to real applications (e.g., "How would you restore a blurry Ncell drone image?").
- Compare filters (e.g., "When to use median vs. Gaussian filter?").
- Visuals:
- Draw before/after restoration (e.g., noisy → denoised image).
- Sketch frequency domain plots (e.g., for blur).
- Common Pitfalls:
- Forgetting to normalize the blur kernel in deconvolution.
- Ignoring noise variance in Wiener filtering.
- Shortcut for Full Marks:
- For theory questions, use the degradation model as your framework.
- For numerical questions, always show:
- Fourier transform steps (if frequency domain).
- Median/mode calculations (if spatial domain).
- Control point selection (for geometric corrections).
Sample Exam Question: "A 256×256 image is corrupted by salt-and-pepper noise with density 0.1. Design a restoration pipeline using spatial filters. Justify your choice."
Model Answer Structure:
- Noise Type: Salt-and-pepper → nonlinear filter needed.
- Filter Choice: Median filter (3×3 or adaptive).
- Steps:
- Apply median filter iteratively (2–3 passes).
- Compare with mean filter (show why median preserves edges).
- Visual: Before/after images with PSNR/SSIM metrics.
- Real Tie-In: "This is used in NTC traffic cameras to clean license plate images for automated toll collection."
8. Summary Table
| Degradation | Restoration Method | Key Formula | When to Avoid |
|---|---|---|---|
| Gaussian Noise | Mean/Gaussian filter | Edge preservation needed | |
| Salt-and-Pepper | Median filter | Median of 3×3 window | Smooth regions (blurs edges) |
| Motion Blur | Wiener filter | Unknown blur kernel | |
| Lens Distortion | Polynomial remapping | Non-radial distortions | |
| Unknown Blur | Blind deconvolution | Iterative and estimation | High computational cost |
9. Key Formulas to Memorize
- Degradation Model:
- Inverse Filtering (Frequency Domain):
- Wiener Filter:
- Median Filter (Spatial Domain):
- Affine Transform:
Based on the PU BE Computer (PU) syllabus for Image Processing and Pattern Recognition (CMP362), unit 4.
Discussion
Loading…