Digital Image Processing CSC 331 Digital Image Fundamentals

  • Slides: 32
Download presentation
Digital Image Processing CSC 331 Digital Image Fundamentals and Image Acquisition 12/1/2020 COMSATS University

Digital Image Processing CSC 331 Digital Image Fundamentals and Image Acquisition 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 1

Image Acquisition 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 2

Image Acquisition 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 2

Image description f (x, y): intensity/brightness of the image at spatial coordinates (x, y)

Image description f (x, y): intensity/brightness of the image at spatial coordinates (x, y) 0< f (x, y)<∞ and determined by 2 factors: illumination component i(x, y): amount of source light incident reflectance component r(x, y): amount of light reflected by objects f (x, y) = i(x, y) r(x, y) where 0< i(x, y)<∞: determined by the light source 0< r(x, y)<1: determined by the characteristics of objects 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 3

Sampling and Quantization quantization sampling 12/1/2020 COMSATS University Islamabad, Lahore Campus sampling Digital Image

Sampling and Quantization quantization sampling 12/1/2020 COMSATS University Islamabad, Lahore Campus sampling Digital Image Processing CSC 331 4

Sampling and Quantization Sampling: Digitization of the spatial coordinates (x, y) Quantization: Digitization in

Sampling and Quantization Sampling: Digitization of the spatial coordinates (x, y) Quantization: Digitization in amplitude (also called graylevel quantization) 8 bit quantization: 28 = 256 gray levels (0: black, 255: white) Binary (1 bit quantization): 2 gray levels (0: black, 1: white) Commonly used number of samples (resolution) Digital still cameras: 640 x 480, 1024 x 1024, 4064 x 2704 so on Digital video cameras: 640 x 480 at 30 frames/second 1920 x 1080 at 60 f/s (HDTV) 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 5

Sampling and Quantization An M x N digital image is expressed as Rows Columns

Sampling and Quantization An M x N digital image is expressed as Rows Columns N : No of Columns M : No of Rows 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 6

Sampling and Quantization § Image coordinate convention (not valid for MATLAB!) There is no

Sampling and Quantization § Image coordinate convention (not valid for MATLAB!) There is no universally accepted convention or notation. Always check carefully! 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 7

Sampling and Quantization § MATLAB Representation 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image

Sampling and Quantization § MATLAB Representation 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 8

Digital Images Digital images are 2 D arrays (matrices) of numbers: 12/1/2020 COMSATS University

Digital Images Digital images are 2 D arrays (matrices) of numbers: 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 9

Sampling 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 10

Sampling 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 10

Sampling 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 11

Sampling 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 11

Effect of Sampling and Quantization 250 x 210 samples 256 gray levels 12/1/2020 125

Effect of Sampling and Quantization 250 x 210 samples 256 gray levels 12/1/2020 125 x 105 samples 8 gray levels 50 x 42 samples 4 gray levels COMSATS University Islamabad, Lahore Campus 25 x 21 samples Binary image Digital Image Processing CSC 331 12

Effect of Sampling and Quantization 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing

Effect of Sampling and Quantization 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 13

Effect of Sampling and Quantization 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing

Effect of Sampling and Quantization 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 14

Effect of Sampling and Quantization 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing

Effect of Sampling and Quantization 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 15

Effect of Sampling and Quantization 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing

Effect of Sampling and Quantization 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 16

RGB (color) Images 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331

RGB (color) Images 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 17

Image acquisition Single imaging sensor Line sensor Array sensor 12/1/2020 COMSATS University Islamabad, Lahore

Image acquisition Single imaging sensor Line sensor Array sensor 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 18

Image Sensors § Goal: to convert EM energy into electrical signals that can be

Image Sensors § Goal: to convert EM energy into electrical signals that can be processed, displayed and/or interpreted as images. § Common technologies: – CCDs (charge-coupled devices) – CMOS (complementary metal oxide semiconductor) 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 19

Digital Camera Technologies CCD Array Cameras A CCD sensor is made up of an

Digital Camera Technologies CCD Array Cameras A CCD sensor is made up of an array of light-sensitive cells called photosites, manufactured in silicon, each of which produces a voltage proportional to the intensity of light falling on them. Every element in the array is linked (charge coupled) to other element. Charges are transferred serially out of the array through shifting charges from one element to the other. 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 20

Digital Camera Technologies CMOS Array Cameras Standard semiconductor production line Active pixel architecture Photo-detector

Digital Camera Technologies CMOS Array Cameras Standard semiconductor production line Active pixel architecture Photo-detector and amplifier are both fabricated inside each pixel. 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 21

Digital camera technologies comparison CCD (Charge Coupled Device) – Specialized fabrication techniques are used

Digital camera technologies comparison CCD (Charge Coupled Device) – Specialized fabrication techniques are used so expensive technology – Larger size – Higher power consumption because of the capacitive architecture – Always have to read out the whole image – Resolution is limited by sensor elements size – Less on-chip circuitry so lesser dark currents and noise 12/1/2020 CMOS (Complementary Metal Oxide Semiconductor) – Cheaper technology – Smaller size – Low power consumption – Readout for selective area of an image is possible – Amplifier and additional circuitry can be fabricated inside each pixel. – Higher resolution possible – Stronger noise due to higher dark currents because of more on-chip circuitry COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 22

Acquisition of color images Single sensor assembly For still scenes Three sensors with prisms

Acquisition of color images Single sensor assembly For still scenes Three sensors with prisms Sensor arrays 12/1/2020 COMSATS University Islamabad, Lahore Campus a. Stripe filter pattern b. Bayers filter pattern Digital Image Processing CSC 331 23

Foveon X 3 imager § This sensor uses 3 layers of CMOS imagers. §

Foveon X 3 imager § This sensor uses 3 layers of CMOS imagers. § Each layer absorbs different colours of light at different depths. § Single shot camera for three colors 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 24

Various commercial sensor sizes Aspect Ratio Width (mm) Height (mm) 1/3. 6" 4: 3

Various commercial sensor sizes Aspect Ratio Width (mm) Height (mm) 1/3. 6" 4: 3 4. 0 3. 0 1/3. 2" 4: 3 4. 5 3. 4 1/3" 4: 3 4. 8 3. 6 1/2. 7" 4: 3 5. 3 4. 0 1/2" 4: 3 6. 4 4. 8 1/1. 8" 4: 3 7. 2 5. 3 2/3" 4: 3 8. 8 6. 6 1" 4: 3 12. 8 9. 6 4/3" 4: 3 18. 0 13. 5 EOS 10 D 3: 2 22. 0 15. 0 "Name" Relative size of various digital camera sensors 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 25

Pixel Neighborhood • The pixels surrounding a given pixel. Most neighborhoods used in image

Pixel Neighborhood • The pixels surrounding a given pixel. Most neighborhoods used in image processing algorithms are small square arrays with an odd number of pixels. 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 26

Basic relationships between pixels Arrangement of pixels: 0 1 1 0 0 0 1

Basic relationships between pixels Arrangement of pixels: 0 1 1 0 0 0 1 4 neighbours N 4(p): 1 0 0 Diagonal neighbours ND(p): 0 0 8 neighbours N 8 (p) = ND(p) U N 4(p) : 12/1/2020 COMSATS University Islamabad, Lahore Campus 1 1 1 0 1 0 0 0 1 Digital Image Processing CSC 331 27

Basic relationships between Pixels § Connectivity between pixels: An important concept used in establishing

Basic relationships between Pixels § Connectivity between pixels: An important concept used in establishing boundaries of objects and components of regions Two pixels p and q are connected if – They are adjacent in some sense – If their gray levels satisfy a specified criterion of similarity V: Set of gray level values used to define the criterion of similarity 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 28

Basic relationships between Pixels 4 -connectivity: If gray-level p , q V, and q

Basic relationships between Pixels 4 -connectivity: If gray-level p , q V, and q N 4(p) 8 -connectivity: If gray-level p , q V, and q N 8(p) m-connectivity (mixed connectivity): Gray-level p , q V, and q satisfies one of the following: 1) q N 4(p), 2) q ND(p) and N 4(p)∩ N 4(q) has no values from V 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 29

Basic relationships between pixels Mixed Connectivity: Note: Mixed connectivity can eliminate the multiple path

Basic relationships between pixels Mixed Connectivity: Note: Mixed connectivity can eliminate the multiple path connections that often occurs in 8 -connectivity Pixel arrangement 12/1/2020 8 -adjacent to the center pixel COMSATS University Islamabad, Lahore Campus m-adjacency Digital Image Processing CSC 331 30

Basic relationships between pixels Path Let coordinates of pixel p: (x, y), and of

Basic relationships between pixels Path Let coordinates of pixel p: (x, y), and of pixel q: (s, t) A path from p to q is a sequence of distinct pixels with coordinates: (x 0, y 0), (x 1, y 1), . . . , (xn, yn) where (x 0, y 0) = (x, y) & (xn, yn) = (s, t), and (xi, yi) is adjacent to (xi-1, yi-1) 1 i n Regions A set of pixels in an image where all component pixels are connected Boundary of a region A set of pixels of a region R that have one of more neighbors that are not in R 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 31

Distance Measures Given coordinates of pixels p and q: (x, y) and (s, t)

Distance Measures Given coordinates of pixels p and q: (x, y) and (s, t) Euclidean distance between p and q: – De distance r from (x, y) define a disk of radius r centered at (x, y) City-block distance between p and q: – The pixels with D 4 distance r from (x, y) form a diamond centered at (x, y) – the pixels with D 4=1 are the 4 -neighbors of (x, y) Chessboard distance between p and q: – The pixels with D 8 distance r from (x, y) form a square centered at (x, y) – The pixels with D 8=1 are the 8 -neighbors of (x, y) 12/1/2020 COMSATS University Islamabad, Lahore Campus Digital Image Processing CSC 331 32