1 Introduction (contd.) 1 ECE 178: Introduction (contd.) Lecture Notes #2: more basics Section 2.4 –sampling and quantization Section 2.5 –relationship between pixels, connectivity analysis Introduction (contd.) 2 Light and the EM Spectrum2 Introduction (contd.) 3 Digial Image Acquisition Introduction (contd.) 4 Sampling and Quantization3 Introduction (contd.) 5 Sampling & Quantization (contd.) Introduction (contd.) 6 Digital Image: Representation4 Introduction (contd.) 7 Image Dimension: NxN; k bits per pixel. Storage Requirement Introduction (contd.) 8 Spatial Resolution5 Introduction (contd.) 9 Re-sampling… Introduction (contd.) 10 Quantization: Gray-scale resolution6 Introduction (contd.) 11 …false contouring Introduction (contd.) 12 Sampling and Aliasing7 Introduction (contd.) 13 Additional Reading Chapter 1, Introduction Chapter 2, Sections 2.1-2.4 – We will discuss sampling and quantization in detail later Next: – some basic relationships between pixels (Section 2.5) Introduction (contd.) 14 Relationship between pixels Neighbors of a pixel – 4-neighbors (N,S,W,E pixels) == N4(p). A pixel p at coordinates (x,y) has four horizontal and four vertical neighbors: • (x+1,y), (x-1, y), (x,y+1), (x, y-1) – You can add the four diagonal neighbors to give the 8-neighbor set. Diagonal neighbors == ND(p). – 8-neighbors: include diagonal pixels == N8(p).8 Introduction (contd.) 15 Pixel Connectivity Connectivity -> to trace contours, define object boundaries, segmentation. In order for two pixels to be connected, they must be “neighbors” sharing a common property—satisfy some similarity criterion. For example, in a binary image with pixel values “0” and “1”, two neighboring pixels are said to be connected if they have the same value. Let V: Set of gray level values used to define connectivity; e.g., V={1}. Introduction (contd.) 16 Connectivity-contd. 4-adjacency: Two pixels p and q with values in V are 4-adjacent if q is in the set N4(p). 8-adjacency: q is in the set N8(p). m-adjacency: Modification of 8-A to eliminate multiple connections. – q is in N4(p) or – q in ND(p) and N4(p) ∩ N4(q) is empty.9 Introduction (contd.) 17 Connected components Let S represent a subset of pixels in an image. If p and q are in S, p is connected to q in S if there is a path from p to q entirely in S. Connected component: Set of pixels in S that are connected; There can be more than one such set within a given S. Introduction (contd.) 18 4-connected components – both r and t = 0; assign new label to p; – only one of r and t is a 1. assign that label to p; – both r and t are 1. • same label => assign it to p; • different label=> assign one of them to p and establish equivalence between labels (they are the same.) p r t p=0: no action; p=1: check r and t. Second pass over the image to merge equivalent labels.10 Introduction (contd.) 19 Exercise Develop a similar algorithm for 8-connectivity. Introduction (contd.) 20 Problems with 4- and 8-connectivity Neither method is satisfactory. – Why? A simple closed curve divides a plane into two simply connected regions. – However, neither 4-connectivity nor 8-connectivity can achieve this for discrete labelled components. – Give some examples..11 Introduction (contd.) 21 Related questions Can you “tile” a plane with a pentagon? Introduction (contd.) 22 Distance Measures What is a Distance Metric? For pixels p,q, and z, with coordinates (x,y), (s,t), and (u,v), respectively: D p q D p q p qD p q D q pD p z D p q D q z( , ) ( ( , ) )( , ) ( , )( , ) ( , ) ( , )≥ = ==≤ +0 0 iff12 Introduction (contd.) 23 Distance Measures Euclidean City Block Chessboard D p q x s y te( , ) ( ) ( )= − + −2 2D p q x s y t4( , ) = − + −D p q x s y t8( , ) max( , )= − −2 2 2 2 22 1 1 1 22 1 0 1 22 1 1 1 22 2 2 2
View Full Document