This notes explain well the image enhancement as used in computer vision
Size: 3.57 MB
Language: en
Added: Oct 26, 2025
Slides: 23 pages
Slide Content
Image Enhancement and Spatial Filtering Techniques for improving visual interpretability throughintensity transformations, histogram processing, and spatial filtering Digital Image Processing Presenter: GROUP 1 | 2025-09-18
Introduction Image Enhancement Goals Improves visual interpretability for human or machine analysis Does not increase intrinsic information, only enhances visual representation Techniques are problem-oriented: application-specific solutions Evaluation is subjective: human viewer often serves as final judge Performed in two domains: Spatial (pixel manipulation) and Frequency (Fourier transform) Domain-Specific Applications Medical Imaging Enhancing mammograms and X-rays for better feature detection Satellite Images Improving contrast for better geographical feature identification Low-Light Photography Enhancing details in underexposed or noisy conditions Scientific Visualization Highlighting subtle patterns in complex datasets Image Enhancement and Spatial Filtering
Spatial vs Frequency Domain Spatial Domain Direct manipulation of pixel values g(x,y) = T[f(x,y)] T is an operator that acts on pixels at location (x,y) and surrounding neighborhood Works directly with individual pixels of an image Transformation result VS Frequency Domain Modify the Fourier transform of the image Original Image Fourier Transform Modify Inverse Transform Manipulates frequency components that represent how pixel values change across space More efficient for certain operations like filtering, convolution, and correlation Transformation result Key Distinction: Spatial Domain: Works directly on individual pixels of an image Frequency Domain: Operates on frequency components that represent how pixel values change Image Enhancement and Spatial Filtering
Basic Intensity Transformation Functions Point operations are fundamental spatial domain techniques where the new pixel value depends solely on the original intensity value. s = T(r) where r is input intensity and s is output intensity Negatives s = L - 1 - r Reverses intensity levels (dark ↔ light) Log Transformations s = c log(1 + r) Expands dark values, compresses bright ones Power-Law (Gamma) s = c rγ γ < 1: brightens; γ > 1: darkens Piecewise-Linear Contrast Stretching Intensity Slicing Bit-Plane Slicing Image Enhancement and Spatial Filtering
Image Negatives Negative Transformation Formula: s = L - 1 - r L = Maximum intensity level (e.g., 256 for 8-bit) r = Original pixel intensity s = Output (negative) intensity How It Works: Reverses intensity levels: dark areas become light and light areas become dark Enhances subtle features hidden in dark regions Expands the dynamic range of darker areas Medical Imaging Application Commonly used in mammograms to make subtle features more apparent Visual Representation Original Image Negative Transform Benefits: Reveals Hidden Details Enhances subtle features in dark regions Improves Contrast Stretches the visible dynamic range Image Enhancement and Spatial Filtering
Log Transformations Key Characteristics s = c log(1 + r) Expands the range of dark pixel values while compressing the range of bright pixel values Particularly effective for images with a wide dynamic range, such as Fourier spectra The constant c controls the degree of expansion and compression Visual Impact Dark Image Values Compressed Log Transformed Dynamic Range Expanded Transformation Visualization Value Distribution Example Input Values 64 128 192 255 Log Transformation Output Values 32 64 96 128 Key Benefit: Reveals subtle details in images with wide dynamic range that would otherwise be imperceptible Image Enhancement and Spatial Filtering
Power-Law (Gamma) Transformations s = c · r γ Gamma Correction γ < 1: Brightens dark images, making darker areas more visible γ > 1: Darkens bright images, enhancing details in brighter regions Common application: Display devices and printing to correct illumination differences Purpose: Ensures consistent visual quality across various mediums Gamma Curve Examples γ < 1 (Brightens) γ = 1 (Linear) γ > 1 (Darkens) Common Applications Display Calibration Printing Correction Digital Photography Image Enhancement and Spatial Filtering
Piecewise-Linear Transformations Contrast Stretching Increases dynamic range of pixel intensities, making images more vibrant. Controlled by: Two points (r, s) and (r, s) Maps input intensity ranges to desired outputs Specifically useful for enhancing dark/gray details Intensity-Level Slicing Highlights specific range of gray levels within an image. Application: 医学影像中的ROI(Region of Interest)突出 Can isolate or brighten range of interest Makes features of interest stand out Bit-Plane Slicing Separates image into individual bit planes. Characteristics: Higher-order planes carry more significant information 7 最高有效位 6 5 4 3 2 1 最低有效位 Useful for image compression Examines contribution of each bit to image Image Enhancement and Spatial Filtering
Histogram Processing Histogram Fundamentals Graphical representation of pixel intensity distribution Plots number of pixels for each intensity value Normalized histogram approximates probability distribution Histogram Shapes Reveal: Dark image: skewed towards lower intensity values Bright image: skewed towards higher intensity values Low contrast: narrow range of intensities High contrast: broad distribution of intensities Histogram Shape Examples Dark Image: Low intensity values dominate Bright Image: High intensity values dominate Low Contrast: Narrow distribution High Contrast: Broad distribution Image Enhancement and Spatial Filtering
Histogram Equalization What is Histogram Equalization? Produces an output image with uniform intensity distribution Increases global contrast automatically Transformation function: s= T(r) = (L-1) ∑p(r) Maps input intensity levels to new values based on their cumulative distribution Histogram Transformation Applications and Example Original Image Low contrast Equalized Image Enhanced contrast Key Applications Medical Imaging Enhances subtle features in X-rays and other medical scans Satellite Imaging Improves contrast for better geographical feature identification Scientific Visualization Highlights subtle patterns in complex datasets Image Enhancement and Spatial Filtering
Adaptive Histogram Equalization (CLAHE) CLAHE: Enhanced Local Processing Local approach: Operates on neighborhoods rather than the entire image Detail preservation: Enhances small areas where global equalization fails Histogram clipping: Limits contrast amplification to prevent noise over-amplification Contrast control: Controls slope of transformation function Applications: Medical scans and low-light photography Advantages over Global HE: Preserves local image structure Controls noise amplification Better for images with mixed contrast CLAHE Process 1. Divide image into small regions (neighborhoods) Global CLAHE 2. Compute histograms for each region 3. Apply contrast enhancement to each region 4. Combine regions to form final image 5. Limit contrast amplification to avoid noise Image Enhancement and Spatial Filtering
Histogram Matching (Specification) The Histogram Matching Process 1 Equalize Input Image Transform the input image to have a uniform intensity distribution 2 Compute Target Function Derive transformation function from specified target histogram 3 Map Intensity Levels Map equalized levels to target levels, preserving visual characteristics Key Advantage More flexible than simple equalization, allowing precise control over output image's tonal characteristics Input Image Equalized Target Histogram Target Function Output Image Matched Applications Improving dark Mars moon images Controlling brightness and contrast precisely Image Enhancement and Spatial Filtering
Histogram Statistics Enhancement Using Statistical Properties Histogram Statistics Uses statistical properties of image intensity distributions for selective enhancement Global Statistics Applies statistical operations to the entire image Adjusts overall brightness and contrast Based on mean and standard deviation Local Statistics Applies statistics to specific image regions Enhances details in neighborhoods Adapts to local intensity variations Applications Highlights features hidden in dark or noisy regions Medical imaging Low-light photography Global vs Local Statistics Global Statistics Uniform brightness/contrast adjustment Enhanced Improved overall visibility Local Statistics Selective adaptation Enhanced Preserves local features Key Differences Global: Single contrast/brightness for all pixels Local: Adaptive processing preserves neighborhood characteristics Image Enhancement and Spatial Filtering
Fundamentals of Spatial Filtering Spatial Filtering Process Modifies pixel values based on neighboring pixel intensities Uses a small matrix (kernel/mask) to determine modification Kernel slides systematically across the entire image Mathematical operation between kernel and image pixels Common applications: smoothing, sharpening, noise reduction Key Characteristics: Direct manipulation of pixel values in spatial domain Uses neighborhood information to modify individual pixels Can be linear or non-linear depending on operation Spatial Filtering Visualization Filter Kernel -1 -1 + 4 + -1 -1 Input Image 120 100 90 80 70 150 200 180 160 130 100 80 Operation Element-wise multiplication -1 -1 × 200 = -200 Sum of products Output Image 120 100 90 80 70 150 130 180 160 130 100 80 Common Applications 1/9 Smoothing -1 Sharpening -1 -1 -1 Edge Detection Image Enhancement and Spatial Filtering
Correlation vs Convolution Correlation A Image Result Direct application: Filter kernel is directly applied to the image neighborhood Operation: Sum of products between kernel and image pixels Computation: Simple element-wise multiplication and summation VS Convolution A 180° Image Result Kernel rotation: Filter kernel is rotated by 180 degrees before application Operation: Similar to correlation but with rotated kernel Computation: Element-wise multiplication with rotated kernel Key Insight: For symmetric kernels: Correlation and convolution yield identical results . Convolution is the standard operation in image processing due to its mathematical properties and broader applicability in linear system theory. Image Enhancement and Spatial Filtering
Linear vs Non-linear Filters Linear Filters Weighted Sums w 1 w 2 w 3 New pixel = w 1 ×p 1 + w 2 ×p 2 + w 3 ×p 3 Examples: Box Filter (Mean) Equal weights, simple averaging Weighted Average (Gaussian) Higher weights to center pixels Characteristics: Predictable behavior Edges may blur during smoothing Effective for reducing noise Non-linear Filters Rank/Order Statistics 1st 2nd 3rd New pixel = f(p 1 , p 2 , p 3 ) Examples: Median Filter Replaces with middle value Max Filter Replaces with maximum value Key Advantage: Preserves edges while reducing noise Effective for salt-and-pepper noise Image Enhancement and Spatial Filtering
Smoothing Filters (Linear) Overview Purpose: Reduce noise and blur images by averaging pixel intensities within a local neighborhood Box Filter (Mean Filter): • Simplest linear filter where each pixel is replaced by the average of all pixels within the kernel • All coefficients equal (typically 1) • Sum of kernel elements normalized to 1 to maintain image brightness Weighted Average Filter (Gaussian): • Assigns different weights to pixels based on distance from center • Higher weights given to pixels closer to the center • Weights determined by a Gaussian distribution • Produces smoother blur and better edge preservation than box filter Effect: Larger kernels result in stronger blurring effects Kernel Examples Kernel Size Effect 3×3 Kernel Light Blurring 5×5 Kernel Medium Blurring 7×7 Kernel Strong Blurring Kernel Shape Comparison Box Filter Uniform weights Gaussian Filter Weighted average Gaussian filter produces smoother blur and preserves edges better than box filter Image Enhancement and Spatial Filtering
Smoothing Filters (Non-linear) Non-linear filters replace the central pixel with a function of neighboring pixels, preserving edges while reducing noise. Median Filter 1 2 3 4 5 6 7 8 9 5 → Median Replaces central pixel with median value, removing salt-and-pepper noise without blurring edges. Max Filter 1 2 3 4 5 6 7 8 9 9 → Max Replaces central pixel with maximum intensity value, highlighting brightest features. Min Filter 1 2 3 4 5 6 7 8 9 1 → Min Replaces central pixel with minimum intensity value, emphasizing darkest features. Common application: salt-and-pepper noise removal in medical imaging. Image Enhancement and Spatial Filtering
Sharpening Filters (Highpass) Concept Emphasizes edges and fine details in an image Acts as the inverse of smoothing filters Highlights boundaries between regions of different intensities Enhances rapid intensity changes (edges) Types of Derivatives First-Order Derivatives Measures intensity changes in one direction [-1 0 +1] Highlights gradient magnitude Second-Order Derivatives Measures rate of change of intensity gradient [0 -1 0-1 +4 -10 -1 0] Zero-crossing detection Common kernels: Roberts, Prewitt, Sobel Image Enhancement and Spatial Filtering
Laplacian Filter Concept & Application Isotropic Operator: Uses second-order derivatives to detect rapid intensity changes Edge Detection: Highlights edges by detecting discontinuities in intensity Sharpening: Add Laplacian result back to original image to emphasize edges Common Kernel: -1 -1 4 -1 -1 The Laplacian filter is a key component in many edge detection algorithms Visual Process Original Image -1 -1 4 -1 -1 Laplacian Result + Original Sharpened Image Edges enhanced through addition Image Enhancement and Spatial Filtering
Unsharp Masking & High-Boost Filtering Original Image Blur Image Create Mask (Original - Blurred) Enhanced Image (Original + Weighted Mask) Unsharp Masking Reduces blur by enhancing edges Process: Blur original image Subtract from original to get mask Add mask back to original Weight typically between 0.5-1.5 Balance between sharpening and noise High-Boost Filtering Enhanced version of unsharp masking Uses higher weight (>1) for mask Formula: g(x,y) = f(x,y) + k·[f(x,y)−h(x,y)] Where: f(x,y) = original image h(x,y) = blurred image k = boost factor (>1) Advantage: stronger edge emphasis Disadvantage: more noise amplification Image Enhancement and Spatial Filtering
Gradient-Based Sharpening First Derivative Approach Gradient-based sharpening methods utilize first derivatives to detect edges: ∇f = [g, g] M(x,y) ≈ |g| + |g| The gradient vector indicates direction of most rapid intensity change. Gradient Magnitude Visualization Common Gradient Operators Roberts Operator 1 Simple 2×2 cross-gradient Prewitt Operator 1 1 1 3×3 kernels for horizontal/vertical gradients Sobel Operator -1 1 -2 2 -1 1 Most popular due to built-in smoothing Key Advantage: Gradient-based sharpening effectively detects edges while reducing noise. Image Enhancement and Spatial Filtering
Conclusion Key Enhancement Techniques Intensity Transformations Direct pixel value adjustments Histogram Techniques Adaptive contrast control Spatial Filtering Neighborhood operations Combining Enhancement Methods Problem-Oriented Approach Methods selected based on specific application Brightness/Contrast Adaptive Contrast Edge Enhancement Best results: Combine methods thoughtfully for specific applications Image Enhancement and Spatial Filtering