Digital Imaging 1999 Rochester Institute of Technology
So Far... camera AgX film processing image AgX photographic film captures image formed by the optical elements (lens). Unfortunately, the processing for film is slow (among other disadvantages). Can we use something else to capture the image?
What is a Digital Image? 5 44 23 31 38 52 75 52 29 9 15 8 38 98 53 52 8 7 12 15 24 3 51 52 1 31 14 38 32 36 53 67 14 33 38 45 53 7 69 4 36 44 58 63 47 53 35 26 68 76 74 76 55 47 38 35 69 68 63 74 5 42 35 32 Just an array of numbers!
Pixel 5 44 23 31 38 52 75 52 29 9 15 8 38 98 53 52 8 7 12 15 24 3 51 52 1 31 14 38 32 36 53 67 14 33 38 45 53 7 69 4 36 44 58 63 47 53 35 26 68 76 74 76 55 47 38 35 69 68 63 74 5 42 35 32 32 Each picture element in the array is called a pixel. Each pixel is represented by a number. The 32 could represent a color, or a gray level
Binary Arithmetic In binary arithmetic, we can only count from to 1 with a single bit, giving two different values. binary decimal 1 1 1 bit
Binary Arithmetic In binary arithmetic, we can only count from to 1 with a single bit, giving two different values. binary decimal 1 1 1 bit To get more than two values, we have to increase the number of bits. With two bits it is possible to count from through 3 (decimal), giving four different values. 1 1 11 1 2 3 2 bits
Binary Arithmetic Each added bit allows us to double the number of values we can represent with a binary number. The number of values that can be represented is given by 2 N bits e.g., 4 bits provides 2 4 = 16 different values A bit is a value, a position, and an amount of information binary 1 1 11 1 11 11 111 1 11 11 111 11 111 111 1111 1... decimal 1 2 3 4 5 6 7 8 9 1 11 12 13 14 15 16... 1 bit 2 bits 3 bits 4 bits
Decimal & Binary Arithmetic The value of a symbol is given by its place When any place gets beyond 1 we carry into the next higher place 1s 1s 1s 1 2.. 9 1 1 1 1 2.. 9 9 1 8s 4s 2s 1s 1 1 1 1 1 1 1 1 1 1 1 1 1
Computer Memory & Storage Because of the internal design of early computers, 8 bits were grouped together and called a byte 8 bits 1 byte One byte can represent any one of (2 8 = 256) different values; 11111111 (binary) 255 (decimal)
Computer Memory & Storage 1 bit ( binary digit ) 1 byte = 8 bits 1 kilobyte (KB) = 1,24 bytes (2 1 = 124) ( 1, bytes) 1 megabyte (MB) = 1,48,576 bytes ( 2 2 ) ( 1,, bytes) 1 gigabyte (GB) = 1,73,741,824 bytes ( 2 3 ) ( 1,,, bytes)
Computer Memory & Storage Page of Text: Floppy disk ZIP disk: Laptop Disk Drive: 3 KB 1.44 MB 1-25 MB 2.1 GB DC-12 *.kdc raw image: DC-12 Hi-Res Image: DCS-46 Image: 1 MB 3.6 MB 18 MB
Digital vs.traditional Photography Digital imaging relies on many of the same principles as traditional film-based photography Light source Object Lens Aperture Shutter Detector Processing
Traditional vs. Digital Photography Detector: Photographic film Chemical processing Detector: Electronic sensor (CCD) Digital processing
Charge Coupled Device (CCD) CCD chip replaces silver halide film No wet chemistry processing Image available for immediate feedback
Response of CCD The response of CCD is linear (i.e., if 1, captured photons corresponds to a digital count of 4, then 2, photons captured yields a digital count of 8) Linearity is critical for scientific uses of CCD Response of photographic negative Response of CCD Density Digital Count Log H Exposure
Basic structure of CCD Divided into small elements called pixels (picture elements). Shift Register Rows Image Capture Area Columns preamplifier Voltage out
CCDs as Semiconductors Insulator Conductor Conductors allow electricity to pass through. (Metals like copper and gold are conductors.) Insulators do not allow electricity to pass through. (Plastic, wood, and paper are insulators.) Some materials are halfway in between, called semiconductors.
Basic structure of a pixel in a CCD Metal gate Silicon base Oxide Layer Silicon is a semiconductor. One pixel Oxide layer is an insulator. Metal gates are conductors. Made with microlithographic process. One pixel may be made up of two or more metal gates.
Photon/Silicon Interaction e - Silicon Photon knocks off one of the electrons from the silicon matrix. Electron wanders around randomly through the matrix. Electron gets absorbed into the silicon matrix after some period.
Spectral Response (sensitivity) of a typical CCD UV Visible Light IR Relative Response 3 4 5 6 7 8 9 1 Incident Wavelength [nm] Response is large in visible region, falls off for ultraviolet (UV) and infrared (IR)
Goal of CCD Photons CCD Electronic Signal Capture electrons formed by interaction of photons with the silicon Measure the electrons from each picture element as a voltage
Collection stage Voltage e - e - Electron formed in the silicon matrix by a photon. Electron wanders around the matrix. If the electron wanders into the depletion region, the electron is captured, never recombining with the silicon matrix.
Collection Light e -e- e -e- e e- ē - e - e- e - e - The number of electrons accumulated is proportional to the amount of light that hit the pixel. There is a maximum number of electron that these wells can hold.
Readout Now that the electrons are collected in the individual pixels, how do we get the information out? Alright! How do we get the electrons out?!
Bucket Brigade By alternating the voltage applied to the metal gates, collected electrons may be moved across the columns. e - e e- -e- e -e- e e- ē - e- - e -e- e e- ē e- - e - e - e - - e - - e - e e - - e e - e - e -eē- - ē - e - e - e - e -
Bucket Brigade Charge is marched across the columns into the shift register, then read out 1 pixel at a time. 2 transfers 1 transfers Shift Register 1 pixels 1 transfers 1 pixels 1 transfer
Converting Analog Voltages to Digital Analog voltage is converted to a digital count using an Analog-to-Digital Converter (ADC) Also called a digitizer The input voltage is quantized: Assigned to one of a set of discrete steps Steps are labeled by integers Number of steps determined by the number of available bits Decimal Integer is converted to a binary number for computation 6.18 volts ADC 1111 (117)
Bits and Bytes In the digital domain, there are only two possible numbers in a digit: or 1. This numbering system is called a binary system. Each digit is called a bit (Binary digit). Byte is 8 bits Decimal 1 2 3 4 5 Binary 1 1 11 1 11
Bits Bits dictate how fine the quantization levels are. An n bit system can represent 2 n numbers. 1 bit system = 2 1 = 2 levels ( Black or White ) 8 bit system = 2 8 = 256 levels 12 bit system = 2 12 = 496 levels
Quantization 6.8 volts ADC Volts DC 1v 6.8v 175 174.8 v 255 176 174 173 172 6.8 volts/.39625 volts per DC = 174.8 Let s say our 8 bit ADC accepts input voltage range of to 1v. Since there are 256 discrete levels in an 8 bit system, each level will be 1v/256 or.39625 volts per analog-todigital unit (ADU). So, if the input voltage was 6.8 volts... Since ADU are stored as binary integers, the decimal must be truncated (to 174). Binary equivalent of 174 is 11111.
Quantization Spatially sampled scene 25 4 4 4 25 25 4 64 64 64 4 25 4 64 97 97 97 64 4 4 64 97 15 97 64 4 4 64 97 97 97 64 4 25 4 4 25 64 64 64 25 4 4 4 25 Numerical representation Spatially sampled image can now be turned into numbers according to the brightness of each pixel.
Charge Coupled Device (CCD) Lens projects image onto the CCD CCD samples the image, creating different voltages based on the amount of light at each pixel Voltages are converted to digital signals and stored
Spatial Sampling Scene Grid over scene Spatially sampled scene When a scene is imaged onto the CCD by the lens, the continuous image is sampled and divided into discrete picture elements, or pixels
Quantization Spatially sampled scene 25 4 4 4 25 25 4 4 4 25 4 64 64 64 4 25 64 97 97 97 64 4 64 97 15 97 64 4 64 97 97 97 64 4 4 64 64 64 4 25 25 4 4 4 25 Numerical representation The spatially sampled image is then converted into an ordered set of integers (, 1, 2, 3, ) according to how much light fell on each element
Fundamentals: Digital Images A digital image is an ordered collection of numbers 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 To be useful, the collection of numbers must be in a known, pre-defined format. The rules of English let us parse letters into words introductiontodigitalimagingforlawenforcementandpublicsafety
Fundamentals: Digital Images There is no universal rule to decode the string of s and 1s in a digital file into an image 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Image Formats provide the definitions that allow a string of numbers to be understood as an image
Fundamentals: Digital Images Once we know the format, each number can be read and used to describe the lightness or color of a specific picture element ( pixel ) 1 1 1 1 1 1 1 1 1 1 1 1 1
Fundamentals: Digital Images The simplest kind of digital image is known as a binary image because the image contains only two colors - white and black
Binary Images Because binary images contain only two colors, we can encode the image using just two numbers, for example: = black 1 = white 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Computer Memory & Storage Regardless of the particular method, they are all binary - only two different values can be stored Computers only work with binary numbers. Before any calculations are done, decimal numbers are converted internally to their binary equivalents.
Digital Image Formats The smallest unit of measurement in a computer is the bit (binary digit) - or 1 1 bit is the amount of storage needed to store 1 pixel of a binary image because each pixel can only be black or white.
Digital Image Formats If we want an image that has more than two gray levels, we have to increase the number of bits per pixel binary: just white or black grayscale: many shades of gray
Digital Image Formats 1 bit/pixel 1 2 bits/pixel 2 gray levels 1 1 1 1 2 x 2 = 4 gray levels
Digital Image Formats 3 bits/pixel 1 1 1 1 1 1 1 1 1 1 1 1 2 x 2 x 2 = 8 gray levels false contours
Digital Image Formats We started to look at the bits as tokens to represent different values, but we ended up with a binary counting system. The largest number we can count to (and the number of different gray levels we can have) depends on how many bits we use. = 1 = 1 1 = 2 1 1 = 3 1 = 4 1 1 = 5 1 1 = 6 1 1 1 = 7... =.
Digital Image Formats 3 bits/pixel: 8 gray levels 111 ( 7) 4 bits/pixel: 16 gray levels 1111 ( 15)
Digital Image Formats... 5 bits/pixel: 32 gray levels 11111 ( 31) 8 bits/pixel: 256 gray levels 11111111 ( 255)
Bit depth: bits per pixel The number of possible gray levels is controlled by the number of bits/pixel, or the bit depth of the image gray levels 2 4 8 16 32 64 128 256 Bit depth; bits/pixel 1 2 3 4 5 6 7 8
Memory requirements: Bit depth Grayscale Values vs. Bit Depth 256 192 gray levels 128 64 1 2 3 4 5 6 7 8 bits per pixel Adding more gray levels is cheap in terms of memory requirements. Every added bit doubles the number of gray levels
Digital images: Fundamentals 228 178 16 193 183 143 84 162 64 62 45 39 11 99 75 56 A digital image is an ordered array of numbers Each pixel (picture element) in a grayscale digital image is a number that describe the pixel s lightness (e.g., = black 255 = white)
Digital images: Fundamentals A digital camera converts each pixel into a number 113 143 2 98 87 34 12 56 121 124... 128 15 221 17 98 56 21 87 133 143... 134 155 191 97 88 73 3 11 127 131... 113 143 2 98 87 34 12 56 121 124... 128 15 221 17 98 56 21 87 133 143... 134 155 191 97 88 73 3 11 127 131............................. The output display (computer screen or printer) interprets the array of numbers as an image 113 143 2 98 87 34 12 56 121 124... 128 15 221 17 98 56 21 87 133 143... 134 155 191 97 88 73 3 11 127 131... 113 143 2 98 87 34 12 56 121 124... 128 15 221 17 98 56 21 87 133 143... 134 155 191 97 88 73 3 11 127 131.............................
Digital images: Fundamentals A digital camera converts each pixel into a number 113 143 2 98 87 34 12 56 121 124... 128 15 221 17 98 56 21 87 133 143... 134 155 191 97 88 73 3 11 127 131... 113 143 2 98 87 34 12 56 121 124... 128 15 221 17 98 56 21 87 133 143... 134 155 191 97 88 73 3 11 127 131............................. The output display (computer screen or printer) interprets the array of numbers as an image 113 143 2 98 87 34 12 56 121 124... 128 15 221 17 98 56 21 87 133 143... 134 155 191 97 88 73 3 11 127 131... 113 143 2 98 87 34 12 56 121 124... 128 15 221 17 98 56 21 87 133 143... 134 155 191 97 88 73 3 11 127 131.............................
Grayscale Images Grayscale images commonly have 256 different gray values, numbered - 255. Each pixel can then be stored in 8 bits, or 1 byte. [ 11111111] = black 255 = white Grayscale pixels are sometimes stored with as many as 124 gray values (1 bits) or 496 gray values (12 bits) Because of limitations of the visual system, this doesn t make the images look better but it increases the amount of information, and the range of tones that can be captured
Image quality factors Two major factors which determine image quality are: Spatial resolution -- controlled by spatial sampling. Color depth -- controlled by number of colors or grey levels allocated for each pixel Increasing either of these factors results in a larger image file size, which requires more storage space and more processing/display time.
Image Resolution: 4 x 3 Pixels
Image Resolution: 8 x 6 Pixels
Image Resolution: 16 x 12 Pixels
Image Resolution: 32 x 24 Pixels
Image Resolution: 64 x 48 Pixels
Image Resolution: 128 x 96 Pixels
Image Resolution: 16 x 12 Pixels
Image Resolution: 32 x 24 Pixels
Image Resolution: 64 x 48 Pixels
Image Resolution: 128 x 96 Pixels*
Image resolution: Pixels per image
Bit Depth: Review The color, or value of each pixel in an image is specified by a string of binary digits, or bits The more bits available for each pixel, the greater the number of possible values each pixel can show: bits/pixel values 1 2 8 256 24 16,777,216
File Size Calculation 1 pixels 1 pixels How much memory is necessary to store an image that is 1 x 1 pixels with 8 bits/pixel? Bit depth = 8 bits per pixel (256 gray levels) File size (in bits) = Height x Width x Bit Depth 1 x 1 x 8 bits/pixel = 8, bits/image 8, bits or 1, bytes
File Size Calculation 96 pixels 128 pixels How much memory is necessary to store an image that is 128 x 96 pixels with 24 bits/pixel? Bit depth = 24 bits per pixel (RGB color) File size (in bits) = Height x Width x Bit Depth 96 x 128 x 8 bits/pixel = 29,491,2 bits/image 29,491,2 bits = 3,686,4 bytes = 3.5 MB
Spatial Sampling Scene Grid over scene Spatially sampled scene When a continuous scene is imaged on the array (grid) formed by a CCD, the continuous image is divided into discrete elements. The picture elements (pixels) thus captured represent a spatially sampled version of the image.