EECS490: Digital Image Processing Lecture #2 • Image acquisition • Images in the spatial domain – Digital representation – Sampling – Quantization – Spatial resolution – Gray scale resolution – Resampling • MATLAB ® image processing – Reading and writing images – MATLAB ® classes: uint8 and double – Adding and multiplying images
47
Embed
Lecture #2 - Case Western Reserve Universityengr.case.edu/merat_francis/eecs490f07/Lectures/Lecture2.pdf · 2012-02-16 · EECS490: Digital Image Processing Comparing CCD and CID
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
EECS490: Digital Image Processing
Lecture #2
• Image acquisition
• Images in the spatial domain– Digital representation
– Sampling
– Quantization
– Spatial resolution
– Gray scale resolution
– Resampling
• MATLAB® image processing– Reading and writing images
– MATLAB® classes: uint8 and double
– Adding and multiplying images
EECS490: Digital Image Processing
Image acquisition
• vidicons and other “tube”sensors
• CCD arrays
• CID arrays
• photodiode arrays
• specialized sensors, i.e., infrared,
document scanning
EECS490: Digital Image Processing
Chapter 2: Digital Image Fundamentals
We usually idealize sensors assquare but, in reality, they are notand manufacturers data needs to bechecked for critical applications.
Solid-state sensors require wiring(interconnects) to read out imagedata. The arrangement of thesensors and the manner and order inwhich they are read out can varyconsiderably among differentsensors.
EECS490: Digital Image Processing
Digitial arrays come in manyarrangements and sizes
You can get imaging sensors in many sizesand shapes for specializedapplications.
EECS490: Digital Image Processing
Comparing CCD and CID image sensors
• They are sensitive over a wide spectral range, from 450 to 1,600nanometers (corresponding to the range from blue light throughthe visible spectrum to the near infrared region)
• They operate on low voltages and consume only a small amountof power.
• They do not exhibit lag or memory, so that the traces of movingobjects are not smeared.
• They are not damaged by intense light. Present devices willoversaturate and “bloom” under intense light but are notpermanently damaged (as a vidicon tube might be, forexample).
• Their positioning accuracy and therefore measurement accuracyare very good because of the accurate photolithography processused to form them.
EECS490: Digital Image Processing
Camera/image sensor
EECS490: Digital Image Processing
Analog RS-170 video signals
EECS490: Digital Image Processing
Film
• Once dominating image recording,
digital techniques have replaced film for
most applications
EECS490: Digital Image Processing
Images in the spatial domain
EECS490: Digital Image Processing
Digital Image
a grid of squares,
each of which
contains a single
color
each square is
called a pixel (for
picture element)
Color images have 3 values per pixel; monochrome images
have 1 value per pixel.
1999-2007 by Richard Alan Peters II
EECS490: Digital Image Processing
• A digital image, I, is a mapping from a 2D gridof uniformly spaced discrete points, {p = (r,c)},into a set of positive integer values, {I( p)}, or aset of vector values, e.g., {[R G B]T(p)}.
• At each column location in each row of I thereis a value.
• The pair ( p, I( p) ) is called a “pixel” (forpicture element).
1999-2007 by Richard Alan Peters II
Pixels
EECS490: Digital Image Processing
• p = (r,c) is the pixel location indexed byrow, r, and column, c.
• I( p) = I(r,c) is the value of the pixel atlocation p.
• If I( p) is a single number then I ismonochrome.
• If I( p) is a vector (ordered list ofnumbers) then I has multiple bands (e.g.,a color image).
1999-2007 by Richard Alan Peters II
Digital Image
EECS490: Digital Image Processing
Pixel Location: p = (r , c)
Pixel Value: I(p) = I(r , c) Pixel : [ p, I(p)]
1999-2007 by Richard Alan Peters II
Pixels
EECS490: Digital Image Processing
==
61
43
12
blue
green
red
)( pI
( )
( )
( )277,272
col,row
,
=
=
=
##
crp
Pixel : [ p, I(p)]
1999-2007 by Richard Alan Peters II
Digital Image
EECS490: Digital Image Processing
sampledreal image quantized sampled &
quantized
1999-2007 by Richard Alan Peters II
Sampling & Quantization
p, space I(p), space
EECS490: Digital Image Processing
sampledreal image quantized sampled &
quantized
pixel gridcolumn index
row
ind
ex
1999-2007 by Richard Alan Peters II
Sampling & Quantization
EECS490: Digital Image Processing
),( crIS
( ),C
I
continuous image sampled image
1999-2007 by Richard Alan Peters II
Sampling
EECS490: Digital Image Processing
),( crIS
( ),C
I
continuous image sampled image
1999-2007 by Richard Alan Peters II
SamplingTake the averagewithin each squareis the most commonmethod of sampling.
EECS490: Digital Image Processing
),( crIS
( ),C
I
continuous image sampled image
A common assumption is that is the same for r and c. This is notalways true.
1999-2007 by Richard Alan Peters II
Sampling
EECS490: Digital Image Processing
Spatial Resolution
1024x1024
N=512
N=16
16x16
EECS490: Digital Image Processing
Gray Scale Resolution
N=256
N=2
EECS490: Digital Image Processing
Gray Scale Resolution
m=1 bit
m=8 bits
EECS490: Digital Image Processing
Subsampling
EECS490: Digital Image Processing
Resampling
EECS490: Digital Image Processing
Subsampling128x128 64x64 32x32
Nearest
neighbor
Bilinear
interpolation
1024x1024
1024x1024
EECS490: Digital Image Processing
8 16
nearest neighbor nearest neighbor
bicubic interpolation bicubic interpolation
(resizing)
1999-2007 by Richard Alan Peters II
Resampling
EECS490: Digital Image Processing
MATLAB® Image Types
indexed
intensity
RGBbinary
General matrix
rgb2ind
rgb2gray
mat2gray
ind2graygray2ind
ind2rgb
bw2ind
im2bw
im2bw
im2bw
EECS490: Digital Image Processing
Read a Truecolor Image into Matlab
A true color image does not use acolormap like an indexed colorimage; instead, the color values foreach pixel are stored directly asRGB triplets. In MATLAB , theCData property of a truecolor imageobject is a three-dimensional (m-by-n-by-3) array. This array consists ofthree m-by-n matrices(representing the red, green, andblue color planes) concatenatedalong the third dimension.
1999-2007 by Richard Alan Peters II
EECS490: Digital Image Processing
1999-2007 by Richard Alan Peters II
Read a Truecolor Image into Matlab
EECS490: Digital Image Processing
1999-2007 by Richard Alan Peters II
Read a Truecolor Image into Matlab
EECS490: Digital Image Processing
Mark Frauenfelder
Cory DoctorowDavid Pescovitz
John Battelle Xeni Jardin
http://boingboing.net/
1999-2007 by Richard Alan Peters II
Read a Truecolor Image into Matlab
EECS490: Digital Image Processing
Crop the Image
First, select aregion usingthe magnifier.
left click here and hold
drag to here and release
Cut out a region
from the image
1999-2007 by Richard Alan Peters II
Read a Truecolor Image into Matlab
EECS490: Digital Image Processing
Crop the Image
From this close-upwe can estimatethe coordinates ofthe region:
rows: about 125 to 425cols: about 700 to 1050
1999-2007 by Richard Alan Peters II
Read a Truecolor Image into Matlab
EECS490: Digital Image Processing
Crop the Image
Here it is:
Now close theother image
1999-2007 by Richard Alan Peters II
Read a Truecolor Image into Matlab
EECS490: Digital Image Processing
Crop the Image
Bring it to thefront using thefigure command,
1999-2007 by Richard Alan Peters II
Read a Truecolor Image into Matlab
EECS490: Digital Image Processing
then type ‘close’at the prompt.
1999-2007 by Richard Alan Peters II
Crop the image
EECS490: Digital Image Processing
Jim Woodring - Bumperillo
Mark Rayden – The Ecstasy of Cecelia
Rayden Woodring – The Ecstasy of Bumperillo (?)
1999-2007 by Richard Alan Peters II
Double exposure: adding two images
EECS490: Digital Image Processing
>> cd 'D:\Classes\EECE253\Fall 2006\Graphics\matlab intro'