Computer and Robot Vision I

Slides:



Advertisements
Similar presentations
電腦視覺 Computer and Robot Vision I
Advertisements

July 27, 2002 Image Processing for K.R. Precision1 Image Processing Training Lecture 1 by Suthep Madarasmi, Ph.D. Assistant Professor Department of Computer.
1 Video Processing Lecture on the image part (8+9) Automatic Perception Volker Krüger Aalborg Media Lab Aalborg University Copenhagen
Lecture 07 Segmentation Lecture 07 Segmentation Mata kuliah: T Computer Vision Tahun: 2010.
電腦視覺 Computer and Robot Vision I Chapter2: Binary Machine Vision: Thresholding and Segmentation Instructor: Shih-Shinh Huang 1.
Each pixel is 0 or 1, background or foreground Image processing to
September 10, 2013Computer Vision Lecture 3: Binary Image Processing 1Thresholding Here, the right image is created from the left image by thresholding,
CS 376b Introduction to Computer Vision 04 / 08 / 2008 Instructor: Michael Eckmann.
1 Binary Image Analysis Binary image analysis consists of a set of image analysis operations that are used to produce or process binary images, usually.
Objective of Computer Vision
Objective of Computer Vision
Computer Vision Basics Image Terminology Binary Operations Filtering Edge Operators.
A Novel 2D To 3D Image Technique Based On Object- Oriented Conversion.
E.G.M. PetrakisBinary Image Processing1 Binary Image Analysis Segmentation produces homogenous regions –each region has uniform gray-level –each region.
1 Image Processing(IP) 1. Introduction 2. Digital Image Fundamentals 3. Image Enhancement in the spatial Domain 4. Image Enhancement in the Frequency Domain.
Chapter 10: Image Segmentation
1. Binary Image B(r,c) 2 0 represents the background 1 represents the foreground
Digital Camera and Computer Vision Laboratory Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan, R.O.C.
Machine Vision for Robots
Digital Camera and Computer Vision Laboratory Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan, R.O.C.
G52IIP, School of Computer Science, University of Nottingham 1 Edge Detection and Image Segmentation.
Chap 3 : Binary Image Analysis. Counting Foreground Objects.
CS 6825: Binary Image Processing – binary blob metrics
CS 376b Introduction to Computer Vision 02 / 22 / 2008 Instructor: Michael Eckmann.
September 23, 2014Computer Vision Lecture 5: Binary Image Processing 1 Binary Images Binary images are grayscale images with only two possible levels of.
1 Binary Image Analysis Binary image analysis consists of a set of image analysis operations that are used to produce or process binary images, usually.
Digital Camera and Computer Vision Laboratory Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan, R.O.C.
Introduction Image geometry studies rotation, translation, scaling, distortion, etc. Image topology studies, e.g., (i) the number of occurrences.
CS 376b Introduction to Computer Vision 03 / 21 / 2008 Instructor: Michael Eckmann.
Digital Camera and Computer Vision Laboratory Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan, R.O.C.
CS654: Digital Image Analysis
Digital Camera and Computer Vision Laboratory Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan, R.O.C.
Digital Camera and Computer Vision Laboratory Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan, R.O.C.
CS 376b Introduction to Computer Vision 02 / 11 / 2008 Instructor: Michael Eckmann.
Low level Computer Vision 1. Thresholding 2. Convolution 3. Morphological Operations 4. Connected Component Extraction 5. Feature Extraction 1.
Nottingham Image Analysis School, 23 – 25 June NITS Image Segmentation Guoping Qiu School of Computer Science, University of Nottingham
Digital Camera and Computer Vision Laboratory Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan, R.O.C.
Image Segmentation Nitin Rane. Image Segmentation Introduction Thresholding Region Splitting Region Labeling Statistical Region Description Application.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
Digital Camera and Computer Vision Laboratory Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan, R.O.C.
Course 3 Binary Image Binary Images have only two gray levels: “1” and “0”, i.e., black / white. —— save memory —— fast processing —— many features of.
Relationship between pixels Neighbors of a pixel – 4-neighbors (N,S,W,E pixels) == N 4 (p). A pixel p at coordinates (x,y) has four horizontal and vertical.
Digital Image Processing CCS331 Relationships of Pixel 1.
Digital Camera and Computer Vision Laboratory Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan, R.O.C.
April 21, 2016Introduction to Artificial Intelligence Lecture 22: Computer Vision II 1 Canny Edge Detector The Canny edge detector is a good approximation.
Digital Camera and Computer Vision Laboratory Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan, R.O.C.
Course : T Computer Vision
COMP 9517 Computer Vision Binary Image Analysis 4/15/2018
图像处理技术讲座(3) Digital Image Processing (3) Basic Image Operations
Computer and Robot Vision I
CSSE463: Image Recognition Day 21
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
Binary Image Analysis Gokberk Cinbis
Mean Shift Segmentation
Computer Vision Lecture 5: Binary Image Processing
Binary Image Analysis: Part 1 Readings: Chapter 3: 3.1, 3.4, 3.8
CSSE463: Image Recognition Day 23
Binary Image Analysis used in a variety of applications:
Binary Image Analysis: Part 1 Readings: Chapter 3: 3.1, 3.4, 3.8
Computer and Robot Vision I
Computer Vision Chapter 4
Computer and Robot Vision I
Computer and Robot Vision I
Department of Computer Engineering
Chapter 6 Neighborhood Operators
CSSE463: Image Recognition Day 23
Computer and Robot Vision I
Computer and Robot Vision I
Binary Image Analysis used in a variety of applications:
Presentation transcript:

Computer and Robot Vision I Chapter 2 Binary Machine Vision: Thresholding and Segmentation Presented by: 傅楸善 & 翁丞世 0925070510 r04945028@ntu.edu.tw 指導教授: 傅楸善 博士 Digital Camera and Computer Vision Laboratory Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan, R.O.C.

2.1 Introduction To detect the objects, the input image is often simplified. binary value 1: considered part of object binary value 0: background pixel binary machine vision: generation and analysis of binary image DC & CV Lab. CSIE NTU

2.2 Thresholding 𝐵 𝑟,𝑐 =1, 𝑖𝑓 𝐼 𝑟,𝑐 ≥𝑇 𝐵 𝑟,𝑐 =0, 𝑖𝑓 𝐼 𝑟,𝑐 <𝑇 r : row, c: column I: grayscale intensity, B: binary intensity T: intensity threshold DC & CV Lab. CSIE NTU

2.2 Thresholding DC & CV Lab. CSIE NTU

2.2 Thresholding DC & CV Lab. CSIE NTU

2.2 Thresholding DC & CV Lab. CSIE NTU

2.2 Thresholding The question of thresholding is a question of the automatic determination of the threshold value. DC & CV Lab. CSIE NTU

2.2 Thresholding histogram ℎ 𝑚 =#{(𝑟,𝑐)|𝐼 𝑟,𝑐 =𝑚} m spans each gray level value e.g. 0 - 255 #: operator counts the number of elements in a set DC & CV Lab. CSIE NTU

2.2 Thresholding 2 3 1 2-bits source image histogram of left image 2 3 1 2-bits source image histogram of left image DC & CV Lab. CSIE NTU

2.2 Thresholding DC & CV Lab. CSIE NTU

2.2 Thresholding DC & CV Lab. CSIE NTU

2.2 Thresholding DC & CV Lab. CSIE NTU

2.2 Thresholding Bayonet Neill Concelman Connector (BNC) The standard connector used to connect IEEE 802.3 10Base2 coaxial cable to an MAU(媒體附著單元 (Media attachment unit)) DC & CV Lab. CSIE NTU

2.2 Thresholding DC & CV Lab. CSIE NTU

2.2 Thresholding Minimizes a criterion function Minimize the within-group variance (Otsu’s method) Minimize the Kullback information distance DC & CV Lab. CSIE NTU

2.2.1 Minimizing Within-Group Variance 𝑃 1 , …, 𝑃 𝐼 : histogram probabilities of gray values 1 … I 𝑃 𝐼 = # 𝑟,𝑐 𝐼𝑛𝑡𝑒𝑛𝑠𝑖𝑡𝑦 𝑟,𝑐 =𝐼 𝑅×𝐶 𝑅×𝐶: the spatial domain of the image 𝑅: the number of row of the image 𝐶: the number of column of the image DC & CV Lab. CSIE NTU

2.2.1 Minimizing Within-Group Variance Observations A group is a set of pixels with intensity homogeneity. Homogeneity is measured by the use of variance High homogeneity group has low variance Low homogeneity group has high variance Objective Select a dividing score such that the weighted sum of the within-group variances is minimized. DC & CV Lab. CSIE NTU

2.2.1 Minimizing Within-Group Variance Given threshold t, divide histogram into two parts. Part 1 is the left hand side of the histogram. Part 2 is the right hand side of the histogram. DC & CV Lab. CSIE NTU

2.2.1 Minimizing Within-Group Variance Within-group variance 𝜎 𝑤 2 : weighted sum of group variances 𝜎 𝑊 2 = 𝑞 1 𝑡 𝜎 1 2 𝑡 + 𝑞 2 𝑡 𝜎 2 2 𝑡 Find 𝑡 ∗ which minimizes 𝜎 𝑊 2 𝑡 𝑡 ∗ =𝑎𝑟𝑔𝑚𝑖𝑛 𝜎 𝑊 2 (𝑡) DC & CV Lab. CSIE NTU

2.2.1 Minimizing Within-Group Variance Implementation For i from 0 to 255: Compute 𝑞 1 𝑡 , 𝑞 2 𝑡 , 𝜎 1 2 𝑡 , 𝜎 2 2 𝑡 Compute 𝜎 𝑤 2 𝑡 = 𝑞 1 𝑡 ∗ 𝜎 1 2 𝑡 + 𝑞 2 𝑡 ∗ 𝜎 2 2 𝑡 If 𝜎 𝑤 2 𝑡 ∗ > 𝜎 𝑤 2 𝑡 : 𝑡 ∗ =𝑡 DC & CV Lab. CSIE NTU

2.2.1 Minimizing Within-Group Variance Speed up 𝜎 2 = 𝑖=0 𝑡 𝑖−𝜇 2 𝑃 𝑖 + 𝑖=𝑡+1 𝐼 𝑖−𝜇 2 𝑃 𝑖 = 𝑖=0 𝑡 𝑖− 𝜇 1 𝑡 + 𝜇 1 𝑡 −𝜇 2 𝑃 𝑖 + 𝑖=𝑡+1 𝐼 𝑖− 𝜇 2 𝑡 + 𝜇 2 𝑡 −𝜇 2 𝑃 𝑖 = 𝑖=0 𝑡 [ 𝑖− 𝜇 1 𝑡 2 + 𝑖− 𝜇 1 𝑡 ∗ 𝜇 1 𝑡 −𝜇 + 𝜇 1 𝑡 −𝜇 2 ]𝑃 𝑖 + 𝑖=𝑡+1 𝐼 [ 𝑖− 𝜇 2 𝑡 2 + 𝑖− 𝜇 2 𝑡 ∗ 𝜇 2 𝑡 −𝜇 + 𝜇 2 𝑡 −𝜇 2 ]𝑃 𝑖 Σ 𝑖− 𝜇 1 𝑡 ∗𝑃 𝑖 =0 Σ 𝑖− 𝜇 2 𝑡 ∗𝑃 𝑖 =0 DC & CV Lab. CSIE NTU

2.2.1 Minimizing Within-Group Variance Speed up 𝜎 2 = 𝑖=0 𝑡 [ 𝑖− 𝜇 1 𝑡 2 + 𝜇 1 𝑡 −𝜇 2 ]𝑃 𝑖 + 𝑖=𝑡+1 𝐼 [ 𝑖− 𝜇 2 𝑡 2 + 𝜇 2 𝑡 −𝜇 2 ]𝑃 𝑖 𝑖=𝑡+1 𝐼 [ 𝑖− 𝜇 2 𝑡 2 + 𝜇 2 𝑡 −𝜇 2 ]𝑃 𝑖 = 𝑖=0 𝑡 𝑖− 𝜇 1 𝑡 2 𝑃 𝑖 + 𝜇 1 𝑡 −𝜇 2 𝑞 1 + 𝑖=𝑡+1 𝐼 𝑖− 𝜇 2 𝑡 2 𝑃 𝑖 + 𝜇 2 𝑡 −𝜇 2 𝑞 2 𝑖=𝑡+1 𝐼 𝑖− 𝜇 2 𝑡 2 𝑃 𝑖 + 𝜇 2 𝑡 −𝜇 2 𝑞 2 = 𝜎 1 2 ∗ 𝑞 1 + 𝜎 2 2 ∗ 𝑞 2 + 𝜇 1 𝑡 −𝜇 2 𝑞 1 + 𝜇 2 𝑡 −𝜇 2 𝑞 2 = 𝜎 𝑤 2 + 𝑞 1 𝑡 1− 𝑞 1 𝑡 [ 𝜇 1 𝑡 − 𝜇 2 𝑡 ] 𝜇= 𝑞 1 (𝑡)∗ 𝜇 1 (𝑡)+ 𝑞 2 (𝑡)∗ 𝜇 2 (𝑡) 𝑞 2 𝑡 =1− 𝑞 1 (𝑡) DC & CV Lab. CSIE NTU

2.2.1 Minimizing Within-Group Variance Speed up 𝜎 2 = 𝜎 𝑤 2 + 𝑞 1 𝑡 1− 𝑞 1 𝑡 [ 𝜇 1 𝑡 − 𝜇 2 𝑡 ] 𝑡 ∗ =𝑎𝑟𝑔𝑚𝑎𝑥 𝑞 1 (𝑡)[1− 𝑞 1 𝑡 ][ 𝜇 1 𝑡 − 𝜇 2 𝑡 ] Fortunately, we can calculate 𝑞 1 𝑡 , 𝜇 1 𝑡 , 𝜇 2 𝑡 recursively. constant minimize maximize DC & CV Lab. CSIE NTU

2.2.1 Minimizing Within-Group Variance Speed up Fortunately, we can calculate 𝑞 1 𝑡 , 𝜇 1 𝑡 , 𝜇 2 𝑡 recursively. 𝑞 1 𝑡+1 = 𝑞 1 𝑡 +𝑃 𝑡+1 𝜇 1 𝑡+1 = 𝜇 1 (𝑡)∗ 𝑞 1 𝑡 + 𝑡+1 ∗𝑃 𝑡+1 𝑞 1 (𝑡+1) 𝜇 2 𝑡+1 = 𝜇− 𝜇 1 𝑡+1 ∗ 𝑞 1 𝑡+1 1− 𝑞 1 (𝑡+1) DC & CV Lab. CSIE NTU

2.2.1 Minimizing Within-Group Variance DC & CV Lab. CSIE NTU

2.2.2 Minimizing Kullback Information Distance  Gaussian distribution DC & CV Lab. CSIE NTU

2.2.2 Minimizing Kullback Information Distance Assumption The observations come from a weighted mixture of two Gaussians distributions. Gaussian Distribution of Background Gaussian Distribution of Object DC & CV Lab. CSIE NTU

2.2.2 Minimizing Kullback Information Distance DC & CV Lab. CSIE NTU

2.2.2 Minimizing Kullback Information Distance Objective Formulation Determine a threshold T that results in two Gaussian distributions which minimize Kullback divergence P(I) : observed histogram distribution f(I) : a mixture of Gaussian distributions determined by T DC & CV Lab. CSIE NTU

2.2.2 Minimizing Kullback Information Distance constant minimize     DC & CV Lab. CSIE NTU

2.2.2 Minimizing Kullback Information Distance DC & CV Lab. CSIE NTU

2.2.2 Minimizing Kullback Information Distance DC & CV Lab. CSIE NTU

2.2.2 Minimizing Kullback Information Distance Implementation For i from 0 to 255: Compute 𝑞 1 𝑡 , 𝑞 2 𝑡 , 𝜎 1 2 𝑡 , 𝜎 2 2 𝑡 Compute 𝐻(𝑡) If 𝐻( 𝑡 ∗ )>𝐻(𝑡): 𝑡 ∗ =𝑡 DC & CV Lab. CSIE NTU

2.2.2 Minimizing Kullback Information Distance DC & CV Lab. CSIE NTU

2.2.2 Minimizing Kullback Information Distance Left dark line: Within-Group Variance (Otsu) Right dark line: Kullback Information (Kittler-Illingworth) DC & CV Lab. CSIE NTU

2.3 Connected Components Labeling Description Connected Components labeling is a grouping operation. It performs the unit change from pixel to region or segment. All pixels are given the same identifier Have value binary 1 Connect to each other Definition DC & CV Lab. CSIE NTU

2.3 Connected Components Labeling Terminology label: unique name or index of the region connected components labeling: a grouping operation pixel property: position, gray level or brightness level region property: shape, bounding box, position, intensity statistics Definition DC & CV Lab. CSIE NTU

2.3 Connected Components Labeling Definition of Connected Component Two pixels 𝑝 and 𝑞 belong to the same connected component 𝐶 if there is a sequence of 1-pixels ( 𝑝 0 , 𝑝 1 ,…, 𝑝 𝑛 ), where 𝑝 0 =𝑝 𝑝 𝑛 =𝑞 𝑝 𝑖−1 , 𝑝 𝑖 :𝑖=1,…,𝑛 are neighbor Definition DC & CV Lab. CSIE NTU

2.3.1 Connected Components Operators To explain what neighborhood is DC & CV Lab. CSIE NTU

2.3.1 Connected Components Operators 1 1 2 3 1 2 source binary image example Connected components labeling with 4-adjacency Connected components labeling with 8-adjacency DC & CV Lab. CSIE NTU

2.3.2 Connected Components Algorithms All the algorithms process a row of the image at a time All the algorithms assign new labels to the first pixel of each component and attempt to propagate the label of a pixel to right or below neighbors Principle & stop condition DC & CV Lab. CSIE NTU

2.3.2 Connected Components Algorithms What label should be assigned to pixel A? How to keep track of the equivalence of two or more labels? How to use the equivalence information to complete processing? Issue A應該放什麼標籤 怎麼保持追蹤等價的標籤 怎麼使用等價訊息去完成處理 DC & CV Lab. CSIE NTU

2.3.2 Connected Components Algorithms An Iterative Algorithm The Classical Algorithm *A Space-Efficient Two-Pass Algorithm with a Local Equivalence Table *An Efficient Run-Length Implementation of the Local Table Method DC & CV Lab. CSIE NTU

2.3.3 An Iterative Algorithm Implementation Initialize each pixel with an unique label Changed = True While Changed == True iteration of top-down followed by bottom-up passes Changed = check is any label changed DC & CV Lab. CSIE NTU

2.3.3 An Iterative Algorithm Why can’t just one iterative Jump to 35(ori) 36(after top-down)=>12與7的交界處 DC & CV Lab. CSIE NTU

2.3.4 The Classical Algorithm performs label propagation as above when two different labels propagate to the same pixel, the smaller label propagates and equivalence entered into table resolve equivalence classes by DFS (Depth-First Search) second pass performs a translation Two top-down phase First phase: assign label and establish equ_table mid-phase: find equivalence classes Second phase: chx label according to equ_label DC & CV Lab. CSIE NTU

2.3.4 The Classical Algorithm Example Two top-down phase First phase: assign label and establish equ_table mid-phase: find equivalence classes Second phase: chx label according to equ_label {2=4} {3=5} {1=5} DC & CV Lab. CSIE NTU

2.3.4 The Classical Algorithm Example Resolve equivalence {2=4} {3=5} {1=5} {2=4} {1=3=5} Two top-down phase First phase: assign label and establish equ_table mid-phase: find equivalence classes Second phase: chx label according to equ_label DC & CV Lab. CSIE NTU

2.3.4 The Classical Algorithm Pros More efficient, only two passes Cons Need more memory to store equivalence table Two top-down phase First phase: assign label and establish equ_table mid-phase: find equivalence classes Second phase: chx label according to equ_label DC & CV Lab. CSIE NTU

2.3.5 A Space-Efficient Two-Pass Algorithm That Uses a Local Equivalence Table Small table stores only equivalences from current preceding line Relabel each line with equivalence labels when equivalence detected Point2. alternation DC & CV Lab. CSIE NTU

2.3.5 A Space-Efficient Two-Pass Algorithm That Uses a Local Equivalence Table DC & CV Lab. CSIE NTU

2.4 Signature Segmentation and Analysis Signature analysis perform a unit change from the pixel to the region or segment. It was firstly used in character recognition. The signature, which is a projection, is the histogram of the non-zero pixels of the masked image. projections can be vertical, horizontal, diagonal, circular… DC & CV Lab. CSIE NTU

DC & CV Lab. CSIE NTU

2.4 Signature Segmentation and Analysis General Signatures Vertical Projection Horizontal Projection Diagonal Projection ℎ 𝑟 =⋕# 𝑥,𝑦 𝑥,𝑦 =1,𝑥=𝑟 𝑣 𝑟 =⋕{ 𝑥,𝑦 | 𝑥,𝑦 =1,𝑦=𝑐} DC & CV Lab. CSIE NTU

2.4 Signature Segmentation and Analysis Steps Thresholding: generate the binary image. Projection Computation: compute the vertical, horizontal, or diagonal projections. Projection Segmentation: divide the image into several segments or regions according to the signatures. DC & CV Lab. CSIE NTU

2.4 Signature Segmentation and Analysis DC & CV Lab. CSIE NTU

2.4 Signature Segmentation and Analysis DC & CV Lab. CSIE NTU

2.4 Signature Segmentation and Analysis segment the vertical and horizontal projections treat each rectangular subimage as the image DC & CV Lab. CSIE NTU

2.4 Signature Segmentation and Analysis Magnetic ink character recognition 光學字母辨識 磁性墨水辨識 OCR: Optical Character Recognition MICR: Magnetic Ink Character Recognition DC & CV Lab. CSIE NTU

2.4 Signature Segmentation and Analysis Diagonal projections: : from upper left to lower right : from upper right to lower left object area: sum of all the projections values in the segment DC & CV Lab. CSIE NTU

2.4 Signature Segmentation and Analysis DC & CV Lab. CSIE NTU

DC & CV Lab. CSIE NTU

2.5 Summary Create binary image by thresholding. Find out connected component on binary image. Generate signature segmentation by projection. DC & CV Lab. CSIE NTU

Project due Oct. 4 Write a program to generate: a binary image (threshold at 128) a histogram connected components (regions with + at centroid, bounding box) DC & CV Lab. CSIE NTU