Chapter 2: Digital Image Fundamentals Fall 2003, 劉震昌
Outline Elements of Visual Perception Image sensing and acquisition Image sampling and quantization Relationships between pixels
Understanding visual perception Most image processing operations are based on math. and probability Why understanding visual perception? Human intuition plays an important role in the choice of processing technique
Structure of the Human eye 角膜 虹膜 網膜 水晶體 Diameter:20mm
2 class of receptors: cones and rods Distribution of cones and rods 1 cone -> 1 nerve Many rods -> 1 nerve
Discrete nature of human vision Area of cones 15mm Cone density: 150,000 per mm
Image formation in the Eye
Image Sensing and Acquisition
Images? Illumination source scene reflection
Image sensors Incoming energy is transformed into a voltage by the combination of input electrical power and sensor material (continuous)
Single sensor with motion
Sensor strips Flat-bed scanner aircraft
Sensor arrays CCD arrays in digital camera
Image sampling and quantization
continuous data digital data Sampling: digitize the coordinate values Quantization: digitize the amplitude values Why? Limited representation power in digital computers discretize
Image sampling and quantization (cont.) Sometimes, the sampling and quantization are done mechanically Limitation on the sensing equipment sensor array
Sampling rule How to determine the sampling rate? Nyquist sampling theorem If input is a band-limited signal with maximum frequency Ω N The input can be uniquely determined if sampling rate Ω S > 2Ω N Nyquist frequency : Ω N Nyquist rate : Ω S
Sampling rule (cont.)
Representing digital images
Representing digital images (cont.) Matrix form f(0,0) f(0,1) … f(0,N-1) f(1,0) f(0,1) … f(1,N-1) … f(M-1,0) f(M-1,1) … f(M-1,N-1) MxN bits to store the image = M x N x k gray level = 2 k
Representing digital images (cont.) L = 2 k gray levels, gray scales [0, …,L-1] The dynamic range of an image [min(image) max(image)] If the dynamic range of an image spans a significant portion of the gray scale -> high contrast Otherwise, low dynamic range results in a dull, washed out gray look
Spatial and gray-level resolution L-level digital image of size MxN = digital image having a spatial resolution MxN pixels a gray-level resolution of L levels Spatial resolution in real-world space line width=W cm space width=W cm Resolution = 1/2W (line/cm)
Spatial and gray-level resolution (cont.) Resolution of printer or screen dpi(dot per inch) pixel/unit of distance When an digital image of size MxN is to be printed or viewed using devices with resolution k dpi, how large will be the output image?
Multi-rate image processing Down-sampling Up-sampling neighboring pixel duplication interpolation 2 2
Down-sampling operations
See the information loss due to down-sampling
Gray-level reduction
false contouring
Empirical study of resolutions 2 k -level digital image of size NxN How K and N affect the image quality Increased details
Empirical study of resolutions (cont.) iso-preference curses *shift up and right *A detailed image may need less gray levels
Zoom and Shrink Operations applied to digital images Zoom: up-sampling Pixel duplication Bi-linear interpolation Shrink: down-sampling
Zoom and shrink: idea Idea: adjust the grid size over the original image
Zooming: example pixel duplication bilinear interpolation
Relationships Between Pixels
Neighbors of a pixel 4-neighbors of p: N 4 (p) Diagonal neighbors: N D (p) 8-neighbors = 4-neighbors+diagonal neighbors : N 8 (p) p p
Adjacency, connectivity, regions, and boundaries Connectivity of pixels They are neighbors Their gray levels satisfy a specified criterion of similarity Concept about regions and boundaries Adjacency 4-adjacency: p and q with intensity from V and q is in N 4 (p) 8-adjacency: p and q with intensity from V and q is in N 8 (p)
Connectivity and adjacency (cont.) m-adjacency(mixed adjacency): p and q having intensity from V and q is in N 4 (p), or q is in N D (p) and N 4 (p) N 4 (q) has no pixels whose values are from V
Path A path from p: (x,y) to q: (s,t) is a sequence of pixels: Length = n It ’ s a k-path if it is 4-, 8-, and m- adjacency (x,y), (x 1,y 1 ), (x 2,y 2 ), …,, (x n-1,y n-1 ),(s,t) consecutive pixels are adjacency
Growth of definitions adjacency path connected component connected set (region) S S S boundary
Summary We need solid mathematical definitions to let the algorithm run on a computer
Distance measure p: (x,y), q: (s,t) Euclidean distance D e (p,q)=[(x-s) 2 +(y-t) 2 ] 1/2 D 4 distance D 4 (p,q)=|x-s|+|y-t| D 8 distance D 8 (p,q)=max(|x-s|,|y-t|) r
Pixel-wise operation For example, how does image I divided by image M? Division is carried out between corresponding pixels in the two images Matlab: Q = I./M
Linear and non-linear operations H be an operator whose input and output are images H is linear if H(af+bg) = aH(f)+bH(g) Otherwise non-linear We have well-understood theoretical and practical results about linear operators
Announcement !!! There are solutions to the marked problems in the textbook utions.htm utions.htm HW#1