Date post: | 16-Jan-2016 |
Category: |
Documents |
Upload: | eric-dorsey |
View: | 213 times |
Download: | 0 times |
© 1999 Rochester Institute of Technology
Introduction to Digital Introduction to Digital ImagingImaging
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
What is a Digital Image?What is a Digital Image?
Just an array of numbers!
50 44 23 31 38 52 75 5229 09 15 08 38 98 53 5208 07 12 15 24 30 51 5210 31 14 38 32 36 53 6714 33 38 45 53 70 69 4036 44 58 63 47 53 35 2668 76 74 76 55 47 38 3569 68 63 74 50 42 35 32
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
PixelPixel
Each picture element in the array is called a pixel. Each pixel is represented by a number.
50 44 23 31 38 52 75 5229 09 15 08 38 98 53 5208 07 12 15 24 30 51 5210 31 14 38 32 36 53 6714 33 38 45 53 70 69 4036 44 58 63 47 53 35 2668 76 74 76 55 47 38 3569 68 63 74 50 42 35 32
3232The “32” could represent a color, or a gray level
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Capturing ImagesCapturing Images
How do we capture images digitally?
010
1
0
101
01
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Traditional Traditional vs.vs. Digital Photography Digital Photography
Chemical processing
Detector: Photographic film
Digitalprocessing
Detector: Electronic sensor (CCD)
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Goal of Charge Coupled Device (CCD)Goal of Charge Coupled Device (CCD)
Capture electrons formed by interaction of photons with the silicon Measure the electrons from each picture element as a voltage
CCDPhotons Electronic Signal
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Charge Coupled Device (CCD)Charge Coupled Device (CCD)
CCD chip replaces silver halide film
No wet chemistry processing
Image available for immediate feedback
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Magnified View of a CCD ArrayMagnified View of a CCD Array
Individual pixel element
Close-up of a CCD Imaging ArrayClose-up of a CCD Imaging Array
CCD
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Charge Coupled Device (CCD)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
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Spatial SamplingSpatial Sampling
When a scene is imaged onto the CCD by the lens, the continuous image is ‘sampled’ and divided into discrete picture elements, or ‘pixels’
Scene Grid over scene Spatially sampled scene
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
QuantizationQuantization
The spatially sampled image is then converted into an ordered set of integers (0, 1, 2, 3, …) according to how much light fell on each element
Spatially sampled scene
0
0
0
0
0
0
0
0
0
0
0
0
0
0
25
40
0
0
25
40
40
25 25
2540 40
40 40 40
25 2540 40 40
40 40 25
40
40
40
64
64
64
64
64
64
64 64 64
64 64 64
97
97
97
97
97
150
97
97
97
0 0 0 0 0 0
0 0 0 0 0 0
0
0
0
0
0 0
0
0
Numerical representation
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Basic structure of CCDBasic structure of CCD
Divided into small elements called pixels (picture elements).
preamplifier
Image Image Capture Capture AreaArea
Shift Register
Voltageout
Columns
Rows
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Fundamentals: Digital ImagesFundamentals: Digital Images
A digital image is an ordered collection of numbers
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
1 0 0 0 1 1 0 0 1 0 1 0 1 0 0 0 1 0 1 0 1 1 1 0 1 1 1 0 0 0 0 1 0 1 0 1 1 1 0 1 1 0 1 0 1 0 0 0 1 1 0
Introductiontodigitalimagingforgearupstudentsfromnewyork
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Fundamentals: Digital ImagesFundamentals: Digital Images
There is no ‘universal rule’ to decode the string of 0s and 1s in a digital file into an image
1 0 0 0 1 1 0 0 1 0 1 0 1 0 0 0 1 0 1 0 1 1 1 0 1 1 1 0 0 0 0 1 0 1 0 1 1 1 0 1 1 0 1 0 1 0 0 0 1 1 0
Image Formats provide the definitions that allow a string of numbers to be understood as an image
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Fundamentals: Digital ImagesFundamentals: 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 0 0 0 0 1 0 1 0 1 1 1 0 1 1 1 0 0 0 1 1 0
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Image quality factorsImage quality factors
Two major factors which determine image quality are: Bit depth -- controlled by number of colors or grey
levels allocated for each pixel Spatial resolution -- controlled by spatial sampling.
Increasing either of these factors results in a larger image file size, which requires more storage space and more processing/display time.
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Fundamentals: Digital ImagesFundamentals: Digital Images
The simplest kind of digital image is known as a “binary image” because the image contains only two ‘colors’ - white and black
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Binary ImagesBinary Images
Because binary images contain only two colors, we can encode the image using just two numbers, for example:
0 = black 1 = white
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 1 0 0 0 0 0 0
1 1 1 1 1 1 1 1 1 1 1 0 0 0 0
1 1 1 1 1 1 1 1 1 1 1 0 0 0 0
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT2 shades of gray
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT4 shades of gray
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT8 shades of gray
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT16 shades of gray
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT32 shades of gray
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT256 shades of gray
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Bit depth: bits per pixelBit 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 levelsgray levels
22
44
88
1616
3232
6464
128128
256256
Bit depth; bits/pixel
1
2
3
4
5
6
7
8
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Digital images: FundamentalsDigital images: Fundamentals
39
56
45
75
62
99
64
101
228 178 106 193
183 143 84 162
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., 0 = black 255 = white)
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Color ImagesColor Images
In most cases, we also want to capture color information
The way that we capture, store, view, and print color digital images is based on the way that humans perceive color
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Color PerceptionColor Perception
The eyes have three different kinds of color receptors (‘cones’); one type each for blue, green, and red light.
Color perception is based on how much light is detected by each of the three ‘primary’ cone types (red, green, and blue)
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Color PerceptionColor Perception
Because we have three kinds of cones, every color that we can see can be made up by combining red, green, and blue light - the three “additive primaries”
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Additive Color Mixing:Additive Color Mixing:
Mixing the three additive primaries together is known as “additive mixing” to distinguish it from mixing paints or dyes (“subtractive mixing”)
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Additive Color Mixing:Additive Color Mixing:
Remember that we are discussing “additive color mixing.” The mixing happens in the visual system, not on the screen.
You can verify this by examining a TV or computer screen at high magnification. Color monitors and LCD displays only make red, green, and blue light. All other colors are synthesized in the visual system.
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Additive Color Mixing:Additive Color Mixing:
By recording and playing back the amount of Red, Green, and Blue at each pixel, a digital camera can capture the colors in a scene.
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
RGB Color ImagesRGB Color Images
Each one of the color images (‘planes’) is like a grayscale image, but is displayed in R, G, or B
=
The most straightforward way to capture a color image is to capture three images; one to record how much red is at each point, another for the green, and a third for the blue.
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
RGB Color ImagesRGB Color Images
To capture a color image we record how much red, green, and blue light there is at each pixel.
To view the image, we use a display (monitor or print) to reproduce the color mixture we captured.
Q) How many different colors can a display produce? A) It depends on how many bits per pixel we’ve got.
For a system with 8 bits/pixel in each of the red, green, and blue (a ‘24-bit image’):
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
RGB Color Images: 24-bit colorRGB Color Images: 24-bit color
Every pixel in each of the three 8-bit color planes can have 256 different values (0-255)
If we start with just the blue image plane, we can make 256 different “colors of blue”
0
255
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
RGB Color Images: 24-bit colorRGB Color Images: 24-bit color
Every pixel in each of the three 8-bit color planes can have 256 different values (0-255)
If we start with just the blue image plane, we can make 256 different “colors of blue”
If we add red (which alone gives us 256 different reds): 0 255
0
255
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
RGB Color Images: 24-bit colorRGB Color Images: 24-bit color
Every pixel in each of the three 8-bit color planes can have 256 different values (0-255)
If we start with just the blue image plane, we can make 256 different “colors of blue”
If we add red (which alone gives us 256 different reds):
We can make 256 x 256 = 65,536 combination colors because for every one of the 256 reds, we can have 256 blues.
0 255
0
255
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
RGB Color Images: 24-bit colorRGB Color Images: 24-bit color
When we have all three colors together, there are 256 possible values of green for each onefor each one of the 65,536 combinations of red and blue:
256 x 256 x 256 = 16,777,216 (“> 16.7 million colors”)
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
RGB Color Images: 24-bit colorRGB Color Images: 24-bit color
The numbers stored for each pixel in a color image contain the color of that pixel
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Color Image = Red + Green + BlueColor Image = Red + Green + Blue
=
In a 24-bit image, each pixel has R, G, & B values When viewed on a color display, the three images are
combined to make the color image.
212100139196
16375113149
37446372
95118155170
189
162
38
41608278
182
161
50
43576863
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Bit Depth: ReviewBit 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
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Image quality factorsImage quality factors
Two major factors which determine image quality are: Bit depth -- controlled by number of colors or grey levels
allocated for each pixel Spatial resolution -- controlled by spatial sampling.
Increasing either of these factors results in a larger image file size, which requires more storage space and more processing/display time.
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
25
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
49
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
64
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
100
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
169
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
400
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
841
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
1600
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
2500
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
10,000
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
1,000,000
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
File Size CalculationFile Size Calculation
100 pixels
100 pixels
Bit depth = 8 bits per pixel (256 gray levels)
File size (in bits) = Height x Width x Bit Depth
100 x 100 x 8 bits/pixel = 80,000 bits/image80,000 bits or 10,000 bytes
How much memory is necessary to store an image that is 100 x 100 pixels with 8 bits/pixel?
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
File Size CalculationFile Size Calculation
1280 pixels
960 pixels
Bit depth = 24 bits per pixel (RGB color)
File size (in bits) = Height x Width x Bit Depth
960 x 1280 x 8 bits/pixel = 29,491,200 bits/image29,491,200 bits = 3,686,400 bytes = 3.5 MB
How much memory is necessary to store an image that is 1280 x 960 pixels with 24 bits/pixel?
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Computer Memory & StorageComputer Memory & Storage
Unlike analog instruments (and people) that work with continuously variable signals, computers are inherently binary systems
Instead of ten distinct values (a decimal system), computers use only two values, e.g.,
RAM memory: 0 or +5 volts Disk drives: N or S magnetization CD/DVD-ROM: ‘land’ or ‘pit’
By convention, binary digits (bits) are labeled ‘0’ & ‘1’
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Binary ArithmeticBinary Arithmetic
In binary arithmetic, we can only count from 0 to 1 with a single bit, giving two different values.
0
1
0
1
binary decimal
1 bit
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Binary ArithmeticBinary Arithmetic
In binary arithmetic, we can only count from 0 to 1 with a single bit, giving two different values.
To get more than two values, we have to increase the number of bits. With two bits it is possible to count from 0 through 3 (decimal), giving four different values.
0
1
0
1
binary decimal
00
01
10
11
0
1
2
3
1 bit
2 bits
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Binary ArithmeticBinary 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 2Nbits
e.g., 4 bits provides 24 = 16 different values
A bit is a value, a position, and an amount of information
0
1
10
11
100
101
110
111
1000
1001
1010
1011
1100
1101
1110
1111
10000...
binary
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16...
decimal
1 bit
2 bits
3 bits
4 bits
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Computer Memory & StorageComputer 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 (28 = 256) different values;
00000000 11111111 (binary) 0 255 (decimal)
Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT
Computer Memory & StorageComputer Memory & Storage
1 bit (‘binary digit’)
1 byte = 8 bits
1 kilobyte (KB) = 1,024 bytes (210 = 1024) (1,000 bytes)
1 megabyte (MB) = 1,048,576 bytes ( 220)
(1,000,000 bytes)
1 gigabyte (GB) = 1,073,741,824 bytes ( 230)
(1,000,000,000 bytes)