Image Enhancement
Total Page:16
File Type:pdf, Size:1020Kb
Image Enhancement Introduction to Signal and Image Processing Prof. Dr. Philippe Cattin MIAC, University of Basel April 5th/12th, 2016 Introduction to Signal and Image Processing April 5th/12th, 2016 1 of 188 22.02.2016 09:18 Ph. Cattin: Image Enhancement Contents Contents Abstract 2 1 Geometrical Image Corrections 1.1 Geometrical Image Transformations Introduction 5 Geometrical Image Transformations 6 Basic Steps of a Geometric Transform 7 The Hierarchy of Geometric Transformations 8 Class I: Isometries 9 Class I: Isometries (2) 10 Class I: Isometries Example 11 Class I: Practical Issues 12 Class II: Similarity Transformations 13 Class II: Similarity Transformations (2) 14 Class II: Similarity Transformations Example 15 Class II: Practical Issues 16 Class III: Affine Transformations 17 Class III: Affine Transformations (2) 18 Class III: Affine Transformation Example 19 Class III: Practical Issues 20 Class IV: Projective Transformations 21 Class IV: Projective Transformations (2) 22 Class IV: Projective Transformation Example 23 Practical Issues and Common Pitfalls 24 Determination of the Matrix Coefficients 25 Determination of the Matrix Coefficients (2) 26 1.2 Pixel Interpolation Methods Applying Spatial Transformations to Images 28 Introduction to Signal and Image Processing April 5th/12th, 2016 2 of 188 22.02.2016 09:18 Forward Mapping 29 Forward Mapping Example 30 Backward Mapping 31 Interpolation Methods 32 Nearest Neighbour Interpolation 33 Nearest Neighbour Interpolation Example 34 Bilinear Interpolation 35 Bilinear Interpolation Example 36 Cubic Convolution Interpolation 37 Cubic Convolution Interpolation (2) 38 Cubic Convolution Interpolation Principle 39 What Interpolation Kernels are There? 40 Conditions for Cubic Convolution 41 Interpolation Cubic Convolution Kernel with Order L=3 42 Cubic Convolution Kernel with Order L=4 43 Bi-Cubic Convolution Interpolation 44 Bi-Cubic Convolution Interpolation Example 45 Summary Cubic Convolution Interpolation 46 Comparison of NN, Bilinear, and Bi-Cubic 47 Interpol Comparison Bilinear vs Bi-Cubic Convolution48 Comparison NN, BL, CC & Sinc 49 Interpolation References 50 1.3 Camera Calibration Camera Calibration 52 The Camera Model 53 The Camera Model (2) 54 The Camera Model (3) 55 The Camera Model (4) 56 The Camera Model (5) 57 Introduction to SignalExtrinsic and Image Camera Processing Parameters April 5th/12th, 201658 3 of 188 22.02.2016 09:18 Intrinsic Camera Parameters 59 How-To Determine the Camera Parameters 60 Camera Calibration Example 61 References 62 2 Filtering in the Spatial Domain 2.1 Fundamentals of Spatial Filtering Background 65 Spatial Domain Methods 66 Spatial Domain Methods (2) 67 Spatial Filtering 68 Linear Spatial Filter 69 Non-Linear Spatial Filter 70 Solutions to the Border Problem 71 2.2 Basic Grey-Level Transformations Intensity Transformation Functions 73 Image Negatives 74 Gamma Correction 75 Gamma Correction of Displays 76 Gamma Correction Example 77 Gamma Correction Example (2) 78 Contrast Stretching Problem 79 Contrast Stretching 80 Contrast Stretching Example 81 Thresholding 82 General Thresholding 83 General Thresholding Example 84 Dynamic Range Compression 85 2.3 Histogram Processing Histogram Equalisation 87 Histogram Equalisation (2) 88 89 Introduction to SignalHistogram and Image Equalisation Processing (4) April 5th/12th, 201690 4 of 188 22.02.2016 09:18 Histogram Equalisation (5) 91 Histogram Equalisation Example 92 Histogram Equalisation Example (2) 93 Histogram Equalisation vs. Homomorphic 94 Filtering Histogram Specification 95 Local Histogram Enhancement 96 Local Histogram Enhancement (2) 97 But Beware... 98 2.4 Image Averaging Image Averaging 100 Image Averaging Example 101 2.5 Smoothing Spatial Filters Smoothing Spatial Filters 103 2.5.1 General Properties General Properties of Smoothing 105 Filters Zero Shift 106 Preservation of the Mean 107 Isotropy 108 Monotonically Decreasing Transfer 109 Function 2.5.2 Box Filter Box Filter (1) 111 Box Filter Example 112 What is the Problem with the Box 113 Filter? Where do these Phase Reversals 114 come from?? 2.5.3 Lowpass Gauss Filter Lowpass Gauss Filter 116 Lowpass Gauss Filter Example 117 Introduction to Signal andGauss Image FilterProcessing on the Conic AprilCircle 5th/12th, 2016118 5 of 188 22.02.2016 09:18 Example Problem with Linear Spatial Filtering 119 2.6 Sharpening Spatial Filters Foundation for Sharpening Spatial Filters 121 Foundation for Sharpening Spatial Filters 122 (2) Using the 2nd Derivative (Laplacian) for 123 Sharpening Other Reasoning for Sharpening Spatial 124 Filters Basic Highpass Spatial Filtering 125 Unsharp Masking and High-boost Filtering 126 High-boost Filtering Example 127 2.7 Mean Filters Mean Filters 129 Arithmetic Mean Filter 130 Geometric Mean Filter 131 Arithmetic vs. Geometric Mean Filter 132 Arithmetic vs. Geometric Mean Filter (2) 133 Harmonic Mean Filter 134 Contraharmonic Mean Filter 135 Contraharmonic Mean Filter Example (1) 136 Contraharmonic Mean Filter Example (2) 137 Contraharmonic Mean Filter Example (3) 138 Mean Filter Discussion 139 2.8 Order-Statistics Filters Order-Statistics Filter 141 Median Filter 142 Median Filter (2) 143 Median Filter (3) 144 Median vs Arithmetic Mean vs Geometric 145 Mean Filter Introduction to SignalMedian and Image Filter Processing Example April 5th/12th, 2016146 6 of 188 22.02.2016 09:18 Min and Max Filters 147 Min and Max Filter Example 148 Midpoint Filter 149 Midpoint Filter Example 150 Alpha-Trimmed Mean Filter 151 Alpha-Trimmed Mean vs Arith. Mean vs. 152 Median Filter 2.9 Adaptive Filters Adaptive Filters 154 Adaptive, Local Noise Reduction Filters 155 Adaptive, Local Noise Reduction Filters (2) 156 Remarks 157 Adaptive, Local Noise Reduction Filter 158 Example Adaptive Median Filter 159 Adaptive Median Filter Algorithm 160 Adaptive Median Filter Example 161 3 Filtering in the Frequency Domain Background 163 3.1 Introduction Frequency Domain Methods Principle of Frequency Domain Methods 165 3.2 Smoothing Frequency Domain Filters Smoothing Frequency Domain Filters 167 (Lowpass) Ideal Lowpass Filter 168 Ideal Lowpass Filter Example 169 Ideal Lowpass Filter Discussion 170 ILPF Transfer Function in the Spatial 171 Domain A Simple ILPF Example 172 Butterworth Lowpass Filter 173 Butterworth Lowpass Filter Example 174 Introduction to SignalGaussian and Image Lowpass Processing Filter April 5th/12th, 2016175 7 of 188 22.02.2016 09:18 Gaussian Lowpass Filter Example 176 3.3 Sharpening Frequency Domain Filters Sharpening Frequency Domain Filters 178 Ideal Highpass Filter 179 Ideal Highpass Filter Example 180 Butterworth Highpass Filter 181 Butterworth Highpass Filter Example 182 Gaussian Highpass Filter 183 Gaussian Highpass Filter Example 184 The Laplacian in the Frequency Domain 185 Laplacian Example 186 Laplacian Highboost Filter Example 187 Unsharp Masking and High-boost Filtering 188 Unsharp Masking and Highboost Filtering 189 Example 3.4 Homomorphic Filtering Homomorphic Filtering 191 Homomorphic Filtering (2) 192 Homomorphic Filtering Example 193 Homomorphic Filtering Example (2) 194 Introduction to Signal and Image Processing April 5th/12th, 2016 8 of 188 22.02.2016 09:18 Ph. Cattin: Image Enhancement Abstract (2) The principal objective of the enhancements techniques is to process the images so that the results are more suitable than the original images for a specific application. The approaches discussed in this chapter fall mainly the categoriy of geometrical image corrections. Introduction to Signal and Image Processing April 5th/12th, 2016 9 of 188 22.02.2016 09:18 Geometrical Image Corrections Geometrical Image Transformations Introduction (5) Almost all capturing processes involve unwanted geometric transforms. They are caused by Perspective distortions Optical distortions due to lens errors or aberration Capturing process inherent limitations and so forth Geometric transforms permit to eliminate, to a large extent, these distortions. Only after correcting these errors it would be possible to Derive accurate metric measurements from the images Compare the same or similar objects in different images Introduction to Signal and Image Processing April 5th/12th, 2016 10 of 188 22.02.2016 09:18 Ph. Cattin: Image Enhancement Geometrical Image Transformations Geometrical Image (6) Transformations Definition: A geometric transform is a vector function that maps all the pixels in the source image to a new Fig 5.1: Geometrical position in the transform rectified coordinate system with . The transformation is either known in advance or can be determined from several known pixel correspondences in an original and transformed image pair. Depending on the geometrical distortion one has to select the most appropriate geometrical transformation from a class of transformations. Introduction to Signal and Image Processing April 5th/12th, 2016 11 of 188 22.02.2016 09:18 Ph. Cattin: Image Enhancement Geometrical Image Transformations Basic Steps of a Geometric (7) Transform Such geometric transforms consist of two basic steps 1. Determining the pixel coordinates in the transformed image Mapping of the coordinates in the input image to Fig 5.2: Geometrical the point in the output transform image The output coordinates generally don't fall onto exact pixel coordinates 2. Determining the point in the digital raster which matches the transformed point and determining its brightness/colour Brightness/colour is usually computed as an interpolation of several points in the neighbourhood Introduction to Signal and Image Processing April