Bài giảng Nhập môn thị giác máy tính - Chapter 5: Binary image analysis - Lê Thanh Hải
Chapter 5 – Binary Image
5-1
Chapter 5
Binary Image Analysis
Bastian Leibe, RWTH Aachen University
Department of Mechatronics
Chapter 5 – Binary Image
5-2
Binary Images
• Just two pixel values
• Foreground and background
• Regions of interest (ROI)
Department of Mechatronics
Chapter 5 – Binary Image
5-3
Uses: Industrial Inspection
R. Nagarajan et al. “A real time marking inspection scheme
for semiconductor industries“, 2006
Department of Mechatronics
Chapter 5 – Binary Image
5-4
Uses: Document Analysis, Text Recognition
Handwritten digits
Natural text (after detection)
Scanned documents
4
Department of Mechatronics
Source: Till Quack, Martin Renold
Chapter 5 – Binary Image
5-5
Uses: Medical/Bio Data
Source: D. Kim et al., Cytometry 35(1), 1999
Department of Mechatronics
Chapter 5 – Binary Image
5-6
Uses: Blob Tracking & Motion Analysis
Frame Differencing
-
=
Source: Kristen Grauman
Background Subtraction
=
-
Source: Tobias Jäggli
Department of Mechatronics
Chapter 5 – Binary Image
5-7
Uses: Shape Analysis, Free-Viewpoint
Video
h
Medial axis
Department of Mechatronics
Chapter 5 – Binary Image
5-8
Uses: Intensity Based Detection
• Looking for dark pixels…
fg_pix = find(im < 65);
Department of Mechatronics
Chapter 5 – Binary Image
5-9
Uses: Color Based Detection
• Looking for pixels within a certain color range…
fg_pix = find(hue > t1 & hue < t2);
Department of Mechatronics
Chapter 5 – Binary Image
5-10
Issues
• How to demarcate multiple
regions of interest?
Count objects
Compute further features per object
• What to do with “noisy”
binary outputs?
Holes
Extra small fragments
Department of Mechatronics
Chapter 5 – Binary Image
5-11
Outline of Today’s Lecture
• Convert the image into binary form
Thresholding
• Clean up the thresholded image
Morphological operators
• Extract individual objects
Connected Components Labeling
Department of Mechatronics
Chapter 5 – Binary Image
5-12
Thresholding
• Grayscale image ⇒ Binary mask
• Different variants
One-sided
ꢄ, ꢂꢅ ꢀ ꢂ, ꢃ ≥ ꢁ
ꢆ, ꢇꢈꢉꢊꢋꢌꢂꢍꢊ
ꢀꢁ ꢂ, ꢃ = �
Two-sided
ꢄ, ꢂꢅ ꢁꢄ ≤ ꢀ ꢂ, ꢃ ≤ ꢁꢎ
ꢆ, ꢇꢈꢉꢊꢋꢌꢂꢍꢊ
ꢀꢁ ꢂ, ꢃ = �
Set membership
ꢄ, ꢂꢅ ꢀ ꢂ, ꢃ ∈ ꢏ
ꢆ, ꢇꢈꢉꢊꢋꢌꢂꢍꢊ
ꢀꢁ ꢂ, ꢃ = �
Image Source: http://homepages.inf.ed.ac.uk/rbf/HIPR2/
Department of Mechatronics
Chapter 5 – Binary Image
5-13
Thresholding
Department of Mechatronics
Chapter 5 – Binary Image
5-14
Thresholding
• Load trees
• Binary_Image = Gray_Image.ThresholdBinary(new Gray(120), new
Gray(255));
Department of Mechatronics
Chapter 5 – Binary Image
5-15
Selecting Thresholds
• Typical scenario
Separate an object from a distinct background
• Try to separate the different grayvalue distributions
Partition a bimodal histogram
Fit a parametric distribution (e.g. Mixture of Gaussians)
Dynamic or local thresholds
• In the following, I will present some simple methods.
Department of Mechatronics
Chapter 5 – Binary Image
5-16
A Nice Case: Bimodal Intensity Histograms
Ideal histogram, light object
on dark background
Actual observed
histogram with noise
Department of Mechatronics
Chapter 5 – Binary Image
5-17
Not so Nice Cases…
• How to separate those?
Two distinct modes Overlapping modes
Multiple modes
• Threshold selection is difficult in the general case
Domain knowledge often helps
E.g. Fraction of text on a document page (histogram quantile)
E.g. Size of objects/structure elements
Department of Mechatronics
Chapter 5 – Binary Image
5-18
Global Binarization [Otsu’79]
• Search for the threshold T that minimizes the within- class
variance σwithin of the two classes separated by T
• This is the same as maximizing the between-class variance
σbetween
Department of Mechatronics
Chapter 5 – Binary Image
5-19
Algorithm
• Precompute a cumulative grayvalue histogram h.
For each potential threshold T
1.) Separate the pixels into two clusters according to T
2.) Look up n1, n2 in h and compute both cluster means
2
3.) Compute σbetween
Source code
Department of Mechatronics
Chapter 5 – Binary Image
5-20
Effects
graythresh - Global image threshold using Otsu's method
Department of Mechatronics
Tải về để xem bản đầy đủ
Bạn đang xem 20 trang mẫu của tài liệu "Bài giảng Nhập môn thị giác máy tính - Chapter 5: Binary image analysis - Lê Thanh Hải", để tải tài liệu gốc về máy hãy click vào nút Download ở trên
File đính kèm:
bai_giang_nhap_mon_thi_giac_may_tinh_chapter_5_binary_image.pdf

