Chapter 2. Image Analysis
Image Analysis Domains Frequency Domain Spatial Domain
Image Algebra Addition Morphing Addition Morphing Subtraction Segmentation Subtraction Segmentation Multiplication by constant brighter Multiplication by constant brighter Division by constant darker Division by constant darker AND mask AND mask OR mask OR mask NOT negative NOT negative
Example
Image Geometry Scaling Scaling Translation Translation Rotation Rotation
How to enlarge an image (Scaling or Sampling) Zero-order hold (expand & duplicate) Zero-order hold (expand & duplicate) First-order hold (linear interpolation) First-order hold (linear interpolation) Two methods 1.Expand rows, then expand columns 2.Extend with zeros, then perform convolution process (support by hardware)
First Method (Method I)
Convolution process Kernel or Mask
Convolution
First Order (method II)
How to reduce # of gray levels (Quantization) Converting the lower bits to 0 via an AND operation. Converting the lower bits to 0 via an AND operation. Converting the lower bits to 1 via an OR operation. Converting the lower bits to 1 via an OR operation. Improved gray-scale (IGS) quantization Improved gray-scale (IGS) quantization remove false contour Variable bin size quantization Variable bin size quantization
Example of IGS
IGS Quantization recognizes the eye’s inherent sensitivity to edges and breaks them up by adding to each pixel a random number, which is generated from the low-order (Least Significant Bits) of neighboring pixels. Improved Gray-Scale (IGS) Quantization
A sum is formed from the current 8-bit gray-level value and the four least significant bits of a previously generated sum. If the four most significant bits of the current value are 1111, however, 0000 is added instead. An Example
IGS Practice Consider an 8-pixel line of gray-scale data, {12, 12, 13, 13, 10, 13, 57, 54}, which has been uniformly quantized with 6-bit accuracy. Construct its 3-bit IGS (Improved Gray-Scale) code.
Smoothing Just like Integration
Image Filtering Linear filter Linear filter Non-linear filter Non-linear filter
Image Smoothing Mean Filtering Gaussian Filtering Median Filtering Smoothing uniform regions Preserve edge structure
Mean Filtering Example
Gaussian Filtering Masks
Properties of smoothing masks The amount of smoothing and noise reduction is proportional to the mask size. Step edges are blurred in proportion to the mask size.
Median Filtering Example
Example
Edge Detection Just like Differentiation
Detecting Edges
Edge Detection Masks
Properties of derivative masks The sum of coordinates of derivative masks is zero so that a zero response is obtained on constant regions. First derivative masks produce high absolute values at point of high contrast. Second derivative masks produce zero-crossings at points of high contrast.
Edge Magnitude & Orientation
Laplacian Of Gaussian (LOG)
Zero crossing detection A zero crossing at a pixel implies that the values of the two opposing neighboring pixels in some direction have different signs. There four cases to test: 1.up/down 2.left/right 3.up-left/down-right 4.up-right/down-left
Two equivalent methods 1.Convolve the image with a Gaussian smoothing filter and compute the Laplacian of the result. 2.Convolve the image with the linear filter that is the Laplacian of the Gaussian filter. 12
Gaussian Equations
Gaussian Plots
Gaussian Properties Symmetry matrix 95% of the total weight is contained within 2 of the center. In the first derivative of 1D Gaussian, extreme points are located at – and + . In the second derivative of 1D Gaussian, zero crossings are located at – and + . The LOG filter responds well to: 1. small blobs coinciding with the center lobe. 2. large step edges very close to the center lobe.
LOG Masks
LOG Example
Frei-Chen Edge Detection Represent any 3x3 subimage as a weighted sum of the nine Frei-Chen masks. Represent any 3x3 subimage as a weighted sum of the nine Frei-Chen masks. Weights are found by projecting a 3x3 subimage onto each of these masks. Weights are found by projecting a 3x3 subimage onto each of these masks. The projection is performed through convolution. The projection is performed through convolution.
Frei- Chen Masks
Projection of vectors Since f 1, f 2, …, f 9 are nine 9D orthonormal vectors
Errors in Edge Detection
Pratt Figure of Merit Rating Factor I N = maximum(I I, I F ) I N = maximum(I I, I F ) I I = # of ideal edge points I I = # of ideal edge points I F = # of found edge points I F = # of found edge points α = a scaling constant to adjust the penalty for offset edges α = a scaling constant to adjust the penalty for offset edges d i = the distance of a found edge point to an ideal edge point d i = the distance of a found edge point to an ideal edge point
Noise Removal
Pepper & Salt Noise Reduction Change a pixel from 0 to 1 if all neighborhood pixels of the pixel is 1 Change a pixel from 1 to 0 if all neighborhood pixels of the pixel is 0
Expanding & Shrinking
Example 1
Example 2
Image Segmentation Region Based Clustering Region Growing Edge based Boundary Detection
Space of Clustering Histogram space Thresholding Histogram space Thresholding Color space K-Means Clustering Color space K-Means Clustering Spatial space Region Growing Spatial space Region Growing
Histogram & Thresholding
P-Tile Thresholding
Mode Thresholding
Mode Algorithm
Iterative Thresholding
Adaptive Thresholding Example
Adaptive Thresholding
Variable Thresholding Example
Double Thresholding Method
Double Thresholding Example
Recursive Histogram Clustering
Clustering
Iterative K-Means Clustering
Example of Region Growing
Region Growing (Split & Merge Algorithm) 1.Split the image into equally sized regions. 2.Calculate the gray level variance for each region 3.If the gray level variance is larger than a threshold, then split the region. Otherwise, an effort is made to merge the region with its neighbors. 4.Repeat Step 2 & 3. Gray level variance :
Boundary Detection 1.Canny Edge Detector 2.Hough Transform
Canney Edge Detector
Canny Edge Detector Example
Hough Transform
Accumulator array for Hough Transform
Hough Transform for Accumulating Straight Lines
Hough Transform Example
Hough Transform for Extracting Straight Lines
Example of Hough Transform
Morphological Filter
Example
Example
Closing & Opening
Opening Example
Morphological Filter Example 1
Structure Element Example 1
Morpho- logical Filter Example 2
Structure Element Example 2
Conditional Dilation
Conditional Dilation Example
Image Transform
Basis Vectors
Transform Coefficients
Fourier Transform 1.Remove high frequency noise 2.Extract texture features 3.Image compression
Discrete Fourier Transform
Magnitude & Phase of Discrete Fourier Transform
Separability of Fourier Transform
Properties of Fourier Transform Translation Brightness Scaling Rotation
Discrete Cosine Transform
Discrete Cosine Transform Basis Images
Walsh-Hadamard Transform
Walsh- Hadamard Basis Images
Construction of Walsh-Hadamard Basis Images
Frequency Domain Image Filtering
Bandpass Filtering
Symmetry of the Fourier Transform
Symmetry of the Discrete Cosine Transform
Ideal Lowpass Filter
Nonideal Lowpass Filter
Highpass Filter
Bandpass & Bandreject Filter
Convolution Theorem 1.Fourier transform the image g(x,y) to obtain its frequency representation G(u,v) 2.Fourier transform the mask h(x,y) to obtain its frequency representation H(u,v) 3.Multiply G(u,v) and H(u,v) pointwise 4.Apply the inverse Fourier transform to obtain the filtered image