Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

Digital Image Fundamentals

Colorado School of Mines Image and Multidimensional Signal Processing 1


Digital Image Fundamentals (Chapter 2)

Topics
• Image acquisition and formation
• Resolution and size of objects
• Spatial sampling and quantization
• Matlab exercises

Objectives
• Know how to estimate properties of image acquisition and
formation, such as resolution and the size of objects that can
be discerned
• Be familiar with the effects of spatial sampling and
quantization on the quality of an image and its storage size

Colorado School of Mines Image and Multidimensional Signal Processing 2


Notes:
Eyeball is about 20 mm in
diameter
Retina contains both rods
and cones
Fovea is about 1.5 mm in
width, contains about
337,000 cones
Focal length about 17 mm

Colorado School of Mines Image and Multidimensional Signal Processing 3


• Rods sensitive to low light (scotopic vision)
• Cones detect color, work in bright light (photopic vision)

Colorado School of Mines Image and Multidimensional Signal Processing 4


Image Formation

• Treat as pinhole camera – good


approximation H h
– Similar triangles f

• What is the size of the tree on the


retina? 15/100 = h/17 or
h=2.55 mm
• What if the tree were twice as far
away?

Colorado School of Mines Image and Multidimensional Signal Processing 5


Problem 2.1
• Using the background information provided in Section 2.1, and thinking
purely in geometric terms, estimate the diameter of the smallest printed
dot that the eye can discern if the page on which the dot is printed is 0.2
m away from the eyes. Assume for simplicity that the visual system ceases
to detect the dot when the image of the dot on the fovea becomes
smaller than the diameter of one receptor (cone) in that area of the
retina. Assume further that the fovea can be modeled as a square array of
dimensions 1.5x1.5 mm and that the cones and spaces between the cones
are distributed uniformly throughout this array.

• Section 2.1 says:


– Contains 337,000 sensor elements arranged in a square array
– Space between cones is equal to width of cone

Colorado School of Mines Image and Multidimensional Signal Processing 6


Colorado School of Mines Image and Multidimensional Signal Processing 7
Light and the Electromagnetic Spectrum
c
• Wavelength () and frequency () are related by 

• To resolve an object, we must use a wavelength equal to the size of the


object or smaller

Colorado School of Mines Image and Multidimensional Signal Processing 8


Colorado School of Mines Image and Multidimensional Signal Processing 9
CCD (Charge coupled device)

• A 2D array of
photosensitive transistors

• Charge accumulates
during exposure

• Charges are transferred


out to shift registers, read
out sequentially

• Output is an analog signal


(eg. RS‐170, NTSC, PAL
format)

• Can also be digitized and


output in digital (via
Firewire, USB, etc)

Colorado School of Mines Image and Multidimensional Signal Processing 10


Typical CCD cameras
• Example: Panasonic GP‐MF130
• Sensor is 6x5 mm, 768x494 pixels
• Typical lens ~ 6mm focal length

Field of view (see


next slide)?

Colorado School of Mines Image and Multidimensional Signal Processing 11


Field of View

H/2
/2
h/2 D
f
Center of
projection
Object
Image plane
plane being
imaged

• f = focal length
•  = field of view
• h = image plane size

• tan(/2) = (h/2) / f = (H/2) / D • f, h can be in pixels or mm


• Horizontal, vertical fov could be
different

Colorado School of Mines Image and Multidimensional Signal Processing 12


Image Acquisition Using Sensor Strips

• Images can also be formed from


(a) A linear array of sensors that
is swept
(b) A circular array, where the
object is moved

Colorado School of Mines Image and Multidimensional Signal Processing 13


Example – Satellite Camera

• NOAA weather satellite


– KLM series for polar (low
Earth) orbits

Colorado School of Mines Image and Multidimensional Signal Processing 14


• Components Image Formation
– Illumination i(x,y)
– Reflection r(x,y)

f ( x, y)  i( x, y) r( x, y)
0  i( x, y)  
0  r( x, y)  1

Colorado School of Mines Image and Multidimensional Signal Processing 15


Sampling and
Quantization

• N bits per
pixel allows
2^N values

Colorado School of Mines Image and Multidimensional Signal Processing 16


Examples

• An image has 8 bits per pixel


– If unsigned, range of values is?

– If signed (ie., two’s complement), range is?

– Number of bytes in a 3872 x 2592 pixel image?

Colorado School of Mines Image and Multidimensional Signal Processing 17


Colorado School of Mines Image and Multidimensional Signal Processing 18
Image Representation
• Image can be represented by an xy
plane
• Sampling partitions the plane into a
grid of pixels, whose indices are
integers
col (or xim)
• We can also think of it as an MxN (1,1)
matrix of numbers Image
• We can index an element either by row
(row,col) or (x,y) (or
yim)
• We will use the convention
– Top left pixel is (1,1)
– x index (or column) increases to the
right
– y index (or row) increases down

Colorado School of Mines Image and Multidimensional Signal Processing 19


Matlab Image Processing Toolbox

• imread, imshow
• Image representation as a matrix
– Image types: grayscale, RGB
– Numeric types: uint8, double, logical
• Use of contrast stretching (“[ ]”) in imshow
– Example of pout.tif
• Use of imtool, impixelinfo
• Creating a simple synthetic image using “for” statements
• See list of functions in help browser
• Examples of some simple image processing functions
– thresholding
– addition, subtraction

Colorado School of Mines Image and Multidimensional Signal Processing 20


Matlab Example
• imread(‘pout.tif’)
• imshow(I,[]), impixelinfo
– Or use imtool(I, [])
• Find a bright point in the image
• line([x0 x1], [y0 y1], ‘Color’, ‘w’)
• Is the x axis horizontal or vertical?
• In a Matlab program do you access I(x,y) or I(y,x)?

Colorado School of Mines Image and Multidimensional Signal Processing 21


Working with Images in Matlab
• Images are usually read in as type “uint8”
– Range of values: 0..255
– However, you can exceed range with some operations

• Solution: convert to double


– Very large range, but takes 8 bytes per pixel
– D = double(I); % straight conversion
– D = im2double(I); % scales 0..255 to 0..1

• Many Matlab functions (such as imshow) treat a double


image as having range 0..1 by default

• Remember to use “[ ]” with imshow


• figure – opens a new figure window

Colorado School of Mines Image and Multidimensional Signal Processing 22

You might also like