Some Basic Intensity Transformatio❖ Power-Law Gamma Transformations ➢ Contrast enhancement using power-law intensity transform a Magnetic resonance image MRI of a fractured human spine t
Trang 1XỬ LÝ ẢNH TRONG CƠ ĐIỆN
Machine Vision
TRƯỜNG ĐẠI HỌC BÁCH KHOA
Giảng viên: TS Nguyễn Thành Hùn
Đơn vị : Bộ môn Cơ điện tử , Viện Cơ
Trang 2Chapter 3 Intensity Transformations and
❖ Two principal categories of spatial processing are intens spatial filtering.
➢ Intensity transformations operate on single pixels of an
as contrast manipulation and image thresholding.
➢ Spatial filtering performs operations on the neighborhoo
image.
➢ Examples of spatial filtering include image smoothing an
Trang 3Chapter 3 Intensity Transformations and
1 Background
2 Some Basic Intensity Transformation Functions
3 Histogram Processing
4 Fundamentals of Spatial Filtering
5 Smoothing (Lowpass) Spatial Filters
6 Sharpening (Highpass) Spatial Filters
7 Highpass, Bandreject, and Bandpass Filters from
8 Combining Spatial Enhancement Methods
Trang 41 Background
❖ The Basics of Intensity Transformations and Spatial F
➢ The spatial domain processes are based on the expressio
where ( f x , y ) is an input image, ( g x , y ) is th e
output image, and is an operator on de T f fined
over a neighborhood of point (x, y).
A 3x3 neighborhood about a poin
is moved from pixel to pixel in the
Trang 51 Background
❖ The Basics of Intensity Transformations and Spatial F
➢ intensity (also called a gray-level , or mapping ) transformatio
Inte (a) (b)
Trang 6Chapter 3 Intensity Transformations and
1 Background
2 Some Basic Intensity Transformation Functions
3 Histogram Processing
4 Fundamentals of Spatial Filtering
5 Smoothing (Lowpass) Spatial Filters
6 Sharpening (Highpass) Spatial Filters
7 Highpass, Bandreject, and Bandpass Filters from
8 Combining Spatial Enhancement Methods
Trang 7❖ Three basic types of functions
➢ linear (negative and identity transformations)
➢ logarithmic (log and inverse-log transformations)
➢ power-law ( th power and nth root n
transformations)
2 Some Basic Intensity Transformatio
Trang 8❖ Image Negatives
(a) A digital mammogram (b) Negative image obtained using (Image (a) Courtesy of General Electric Medical Systems.)
Trang 92 Some Basic Intensity Transformatio
❖ Log Transformations
where is a co c
Trang 102 Some Basic Intensity Transformatio
❖ Power-Law (Gamma) Transformations
w
Plots of the gamma e
of ( = 1 in all case c
Trang 112 Some Basic Intensity Transformatio
❖ Power-Law (Gamma) Transformations
(a) Image
as it appe setting of Gammac image, a (compare (a) courte NIH)
Trang 122 Some Basic Intensity Transformatio
❖ Power-Law (Gamma) Transformations
➢ Contrast enhancement using power-law intensity transform
a) Magnetic resonance image (MRI) of a fractured human spine (the region of the fracture is e Results of applying the transformation in Eq (3-5) with and and 0.3, respectively (Original ima Department of Radiology and Radiological Sciences, Vanderbilt University Medical Center.)
Trang 132 Some Basic Intensity Transformatio
❖ Power-Law (Gamma) Transformations
➢ Another illustration of power-law transformations.
Trang 142 Some Basic Intensity Transformatio
❖ Piecewise Linear Transformation Functions
➢ Contrast Stretching
where rmin and rmax denote
the minimum and maximum
intensity levels in the input
image, respectively
Trang 152 Some Basic Intensity Transformatio
❖ Piecewise Linear Transformation Functions
➢ Intensity-Level Slicing
Figure 2: (a) Aortic angiogram
Trang 162 Some Basic Intensity Transformatio
❖ Piecewise Linear Transformation Functions
➢ Bit-Plane Slicing
Bit-planes of an 8-bit image.
Trang 172 Some Basic Intensity Transformatio
❖ Piecewise Linear Transformation Functions
➢ Bit-Plane Slicing
Trang 182 Some Basic Intensity Transformatio
❖ Piecewise Linear Transformation Functions
➢ Bit-Plane Slicing
Image reconstructed from bit planes: (a) 8 and 7; (b) 8, 7, and 6; (
Trang 19Chapter 3 Intensity Transformations and
1 Background
2 Some Basic Intensity Transformation Functions
3 Histogram Processing
4 Fundamentals of Spatial Filtering
5 Smoothing (Lowpass) Spatial Filters
6 Sharpening (Highpass) Spatial Filters
7 Highpass, Bandreject, and Bandpass Filters from
8 Combining Spatial Enhancement Methods
Trang 203 Histogram Processing
❖ Histogram
➢ The unnormalized histogram:
where rk is the - intensity level of an -level k th L
digital image ( f x , y n ); k is the number of pixels
in with intensity f rk and the subdivisions of the
intensity scale are called histogram bins.
Trang 213 Histogram Processing
❖ Histogram
➢ The normalized histogram:
where M and N are the number of image rows and columns, respectively.
Trang 223 Histogram Processing
❖ Histogram
Four image types and their corresponding histograms (a) dark; (b) light; The horizontal axis of the histograms are values of rk and the vertical ax
Trang 243 Histogram Processing
❖ Histogram Equalization
➢ Example: Illustration of the mechanics of histogram equali
in Table
Trang 253 Histogram Processing
❖ Histogram Equalization
➢ Example: Illustration of the mechanics of histogram equali
We round them to their nearest integer values in the range
Trang 263 Histogram Processing
❖ Histogram Equalization
➢ Example: Illustration of the mechanics of histogram equali
Histogram equalization (a) Original histogram (b) Transformation function
Trang 273 Histogram Processing
❖ Histogram Equalization
➢ Algorithm for Histogram Equalization
Trang 283 Histogram Processing
❖ Histogram Equalization
equalized images
eq Source images
Trang 293 Histogram Processing
❖ Histogram Equalization
(a) Image fro histogram eq (a) (d) Histog courtesy of N
Trang 30Chapter 3 Intensity Transformations and
1 Background
2 Some Basic Intensity Transformation Functions
3 Histogram Processing
4 Fundamentals of Spatial Filtering
5 Smoothing (Lowpass) Spatial Filters
6 Sharpening (Highpass) Spatial Filters
7 Highpass, Bandreject, and Bandpass Filters from
8 Combining Spatial Enhancement Methods
Trang 314 Fundamentals of Spatial Filt
❖ The Mechanics of Linear Spatial Filtering
➢ Spatial filter kernel: filter kernel, kernel, mask,
template , and window
➢ Linear spatial filtering
Trang 324 Fundamentals of Spatial Filt
❖ Spatial Correlation
and Convolution
➢ 1-D illustration
Trang 334 Fundamentals of Spatial Filt
❖ Spatial Correlation and Convolution
➢ 2-D illustration
➢ Correlation
➢ Convolution
Trang 344 Fundamentals of Spatial Filt
❖ Spatial Correlation and Convolution
Trang 35Chapter 3 Intensity Transformations and
1 Background
2 Some Basic Intensity Transformation Functions
3 Histogram Processing
4 Fundamentals of Spatial Filtering
5 Smoothing (Lowpass) Spatial Filters
6 Sharpening (Highpass) Spatial Filters
7 Highpass, Bandreject, and Bandpass Filters from
8 Combining Spatial Enhancement Methods
Trang 365 Smoothing (Lowpass) Spatial
➢ Smoothing (also called averaging ) spatial filters are used to transitions in intensity.
➢ Application: noise reduction, reduce aliasing, reduce irrele smoothing the false contours, …
➢ Linear spatial filtering
➢ Nonlinear smoothing filters
Trang 375 Smoothing (Lowpass) Spatial
❖ Box Filter Kernels
Trang 385 Smoothing (Lowpass) Spatial
❖ Box Filter Kernels
➢ Example: Lowpass filtering with a box
kernel
(a) Test pattern of size 1024x1024 pixels (b)-(d)
Results of lowpass filtering with box kernels of
sizes 3x3, 11x11, and 21x21 respectively.
Trang 395 Smoothing (Lowpass) Spatial
❖ Lowpass Gaussian Filter Kernels
➢ Gaussian kernels of the form
Trang 405 Smoothing (Lowpass) Spatial
❖ Lowpass Gaussian Filter Kernels
(a) Sampling a Gaussian function to obtain a discrete Gauss The values shown are for = 1 and = 1 (b) Resulting ker K
Trang 415 Smoothing (Lowpass) Spatial
❖ Lowpass Gaussian Filter Kernels
➢ Example: Lowpass filtering with a Gaussian kernel
Trang 425 Smoothing (Lowpass) Spatial
❖ Lowpass Gaussian Filter Kernels
➢ Example: Lowpass filtering with a Gaussian kernel
(a) Result of filtering using a Gaussian kernels of size43x43, with = 7.
a kernel of 85x85, with the same value of (c) Difference image
Trang 435 Smoothing (Lowpass) Spatial
➢ Example: Comparison of Gaussian and box filter smoothi
Trang 445 Smoothing (Lowpass) Spatial
➢ Example: Using lowpass filtering and thresholding for reg
Trang 455 Smoothing (Lowpass) Spatial
❖ Order-Statistic (Nonlinear) Filters
➢ Median filter : replaces the value of the center pixel by the values in the neighborhood of that pixel
→ Effective in the presence of impulse noise salt- - ( and pepper n
→ The 50th percentile of a ranked set of numbers
➢ Max filter :
→ Finding the brightest points in an image or for eroding dar regions
Trang 465 Smoothing (Lowpass) Spatial
❖ Order-Statistic (Nonlinear) Filters
➢ Min filter:
→ used for the opposite purpose
→ The 0th percentile filter
Trang 475 Smoothing (Lowpass) Spatial
❖ Order-Statistic (Nonlinear) Filters
➢ Example: Median filtering
Trang 48Chapter 3 Intensity Transformations and
1 Background
2 Some Basic Intensity Transformation Functions
3 Histogram Processing
4 Fundamentals of Spatial Filtering
5 Smoothing (Lowpass) Spatial Filters
6 Sharpening (Highpass) Spatial Filters
7 Highpass, Bandreject, and Bandpass Filters from
8 Combining Spatial Enhancement Methods
Trang 496 Sharpening (Highpass) Spatia
❖ Foundation
➢ First-order derivative
➢ Second-order derivative
Trang 506 Sharpening (Highpass) Spatia
❖ Image Sharpening the Laplacian —
➢ Laplacian
Trang 516 Sharpening (Highpass) Spatia
❖ Image Sharpening the Laplacian —
➢ Laplacian kernel
Trang 526 Sharpening (Highpass) Spatia
❖ Image Sharpening the Laplacian —
➢ The basic way in which the Laplacian is used for image sh
▪ c = 1 if the center element of the Laplacian kernel is posit
▪ c = -1 if the center element of the Laplacian kernel is nega
Trang 536 Sharpening (Highpass) Spatia
❖ Image Sharpening the Laplacian —
➢ Example: Image sharpening using the Laplacian
Trang 546 Sharpening (Highpass) Spatia
❖ Unsharp Masking and Highboost Filtering
➢ Unsharp masking
Trang 556 Sharpening (Highpass) Spatia
❖ Unsharp Masking and Highboost Filtering
Trang 566 Sharpening (Highpass) Spatia
❖ Unsharp Masking and Highboost Filtering
(a) Unretouched “soft tone” digital image of size 469x600 pixels (b) Image blurred using a 3 filter with = 5 (c) Mask (d) Result of unsharp masking using Eq (3-65) with k = 1 filtering with k = 2 and k = 3 respectively.
Trang 57-6 Sharpening (Highpass) Spatia
❖ Image Sharpening the Gradient —
➢ The gradient of an image f at coordinates (x, y)
➢ The magnitude length ( ) of vector f
Trang 586 Sharpening (Highpass) Spatia
❖ Image Sharpening the Gradient —
➢ Roberts cross-gradient operators
Trang 596 Sharpening (Highpass) Spatia
❖ Image Sharpening the Gradient —
➢ Sobel operators
Trang 606 Sharpening (Highpass) Spatia
❖ Image Sharpening the Gradient —
➢ Filter masks
(a) A 3x3 region of an image, where the zs are intensity values (b) (c) Rob – (d) (e) Sobel operators All the kernel coefficients sum to zero, as expected –
Trang 616 Sharpening (Highpass) Spatia
❖ Image Sharpening the Gradient —
➢ Example: Using the gradient for edge enhancement.
Trang 62Chapter 3 Intensity Transformations and
1 Background
2 Some Basic Intensity Transformation Functions
3 Histogram Processing
4 Fundamentals of Spatial Filtering
5 Smoothing (Lowpass) Spatial Filters
6 Sharpening (Highpass) Spatial Filters
7 Highpass, Bandreject, and Bandpass Filters from
8 Combining Spatial Enhancement Methods
Trang 637 Highpass, Bandreject, and Bandpass Filters f
❖ Transfer functions of ideal 1-D filters
Trang 647 Highpass, Bandreject, and Bandpass Filters f
❖ Transfer functions of ideal 1-D filters
Trang 657 Highpass, Bandreject, and Bandpass Filters f
❖ Transfer functions of ideal 1-D filters
(a) A 1-D spatial lowpass
Trang 667 Highpass, Bandreject, and Bandpass Filters f
❖ Transfer functions of ideal 1-D filters
(a) Zone plate image filtered with a separable lowpass kernel (b filtered with the isotropic lowpass kernel in Fig 3.60(b).
Trang 677 Highpass, Bandreject, and Bandpass Filters f
❖ Transfer functions of ideal 1-D filters
Trang 68Chapter 3 Intensity Transformations and
1 Background
2 Some Basic Intensity Transformation Functions
3 Histogram Processing
4 Fundamentals of Spatial Filtering
5 Smoothing (Lowpass) Spatial Filters
6 Sharpening (Highpass) Spatial Filters
7 Highpass, Bandreject, and Bandpass Filters from
8 Combining Spatial Enhancement Methods
Trang 698 Combining Spatial Enhancemen
Trang 708 Combining Spatial Enhancemen
(e) Sobel image smoothed with a 3x3 box filter (f) Mask image formed by the product of obtained by the adding images (a) and (f) (h) Final result obtained by applying a power- images (g) and (h) with (a) (Original image courtesy of G.E Medical Systems.)