Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 44

Chapter Two

Digital image fundamentals

Computer Vision
2-Image formation
goal

 Be familiar with the electromagnetic energy spectrum, including basic


properties of light.
 Know how digital images are generated and represented.
 Understand the basics of image sampling and quantization.
 Be familiar with spatial and intensity resolution and their effects on image
appearance.
 Have an understanding of basic geometric relationships between image
pixels.

Computer Vision
2-Image formation
The Electromagnetic Spectrum

Computer Vision
2-Image formation
Image formation
 The two parts of the image formation process
The physics of light (radiometric):
 Which determines the brightness of a point in
the image plane as a function of illumination
and surface properties.
The geometry of image formation:
 Which determines where the projection of a
point in the scene will be located in the image
plane .

Computer Vision
2-Image formation
Image formation
 A simple model
 The scene is illuminated by a single source.
 The scene reflects radiation towards the camera.
 The camera senses it via chemicals on film.

Computer Vision
2-Image formation
Pinhole Camera
 The simplest device to form an image of a 3D scene
on a 2D surface is the "pinhole“ camera.
 Pinhole Camera:
Can be designed by placing a barrier with a small
opening between the 3D object and a
photographic film or sensor.
 The opening known as the aperture.
Rays of light pass through a "pinhole" and form
an inverted image of the object on the image
plane.
 Only one (or a few) of rays of light passes through the
aperture and hit the film.

Computer Vision
2-Image formation
Pinhole Camera
 An approximated 1-to-1 mapping can be established
between the 3D object and the film.
 This simple camera model is called Pinhole camera.

Computer Vision
2-Image formation
Pinhole Camera

Computer Vision
2-Image formation
Pinhole camera
 The film is commonly called image or retinal plane.
 The aperture is called pinhole O or center of the camera.
 The distance between the image plane and O is the focal
length f.
 The line from the camera centre perpendicular to the
image plane is called the principal axis or principal ray
of the camera.
 the point where the principal axis meets the image plane is
called the principal point.
 Sometimes, the retinal plane is placed between O and
the 3D object at a distance f from O.
 In this case it is called virtual image or virtual retinal plane.

Computer Vision
2-Image formation
How does the aperture size affect the image?
 The larger is the size of the aperture, the greater is the
number of rays of lights that pass through the
aperture.
 Thus, each point on the film may corresponds to multiple
points on the object.
 As a result, the image of the object becomes blurred.

Computer Vision
2-Image formation
How does the aperture size affect the image?
 Shrinking the aperture

 As the aperture goes from 2mm to 0.35mm, the letters


look more focused.
Computer Vision
2-Image formation
How does the aperture size affect the image?
 Why not we make the aperture as small as possible?
 When light passes through a small hole, it does not travel in
a straight line and is scattered in many directions (i.e.,
diffraction)

Computer Vision
2-Image formation
Problems with pinhole cameras
 Generally, pinhole cameras produce dark images,
because a very small set of rays from a particular
point hits the screen.
 Pinhole size (aperture) must be very small to obtain a
clear image.
 However, as pinhole size is made smaller, less light is
received by image plane.
 If pinhole is comparable to wavelength of incoming light,
diffraction effects blur the image.
 To overcome this problem we can replace the aperture
with lenses.

Computer Vision
2-Image formation
Lenses
 If a lens is properly placed and has proper size, it
satisfies the following property:
 All rays of light that are emitted by a point P are refracted
by the lens such that they converge to a single point P’ in the
image plane.
 Therefore, the problem of the majority of the light rays
blocked due to a small aperture is removed.

Computer Vision
2-Image formation
Cameras and lenses
 The above property is true for all the points on the object
that are equidistant from the image plane.
 This no longer true for points that are closer or further to
the image plane than P.
 The corresponding projection into the image is now blurred
or out of focus (the blue lines).

Circle of
Confusion

Computer Vision
2-Image formation
Lenses
 Lenses have a specific distance for which objects are in
focus.
 Other points project to a “circle of confusion” in the image
 This property is also related to a photography and
computer graphics concept known as depth of field,
which is the effective range at which cameras can take
clear photos.

Computer Vision
2-Image formation
Rules of ray diagrams for lenses
1) An incident ray parallel to the principal axis will
refract through the focus.
2) An incident ray through the center of the lens will go
straight through the lens.

Computer Vision
2-Image formation
Thin lenses

 Thin lens equation:

 Any object point satisfying this equation is in focus.

Computer Vision
2-Image formation
Thin lens equation
 Assume an object & its image are at distance u and v
from the lens plane respectively.

Computer Vision
2-Image formation
Thin lens equation

Computer Vision
2-Image formation
Thin lens equation

Computer Vision
2-Image formation
Thin lens equation

Computer Vision
2-Image formation
Imaging Geometry

Four Coordinate Frames

Computer Vision
2-Image formation
Four Coordinates Projection
 We want a mathematical model to describe
how 3D World points get projected into 2D
Pixel coordinates.
That is we want to describe this sequence of
transformations by a matrix equation.

Computer Vision
2-Image formation
 Assignment one

Computer Vision
2-Image formation
World to Camera Coordinate

 The transformation that allows to relate points from


the world reference system to the camera reference
system is regulated by Rigid Transformation
(Translation T and Rotation R) in 3D.

Computer Vision
2-Image formation
Transformations
 Use both 2D and 3D
Translation
Scaling
Rotation

Computer Vision
2-Image formation
Image representation
 Images are actually spatial data (data which is
indexed by two spatial co-ordinates).
The camera senses the brightness at a point.
The brightness sensed by the camera is transformed to
a signal which is then fed to the A/D converter and
stored as a value within the computer, referenced to the
co-ordinates x, y in the image.
Accordingly, a computer image is a matrix of points.
These points are the picture elements, or pixels.
There are different types of images: Binary images,
Grayscale images and Color images.

Computer Vision
2-Image formation
Image Types
 Binary Images:
 contain pixels that are either black (0) or white (1).
 Usually applicable where the only information required is
general shape and outline.
 Grayscale Images:
 have a wider range of intensity than black and white.
 Each pixel is a shade of gray with pixel values ranging
between 0 (black) and 255 (white).
 Grayscale image contains 8bits/pixel.
 Color Images:
 have multiple color channels;
 each color image can be represented in different color models
(color spaces).
Computer Vision
2-Image formation
Types of images

Computer Vision
2-Image formation
Color space
 A color space describes the range of colors that a
camera can see.
 Each pixel in an image has a color that is described in
the color space.
 There are different ways to describe all colors, so there
are also different color spaces.
 RGB-space

Computer Vision
2-Image formation
RGB color space
 In the RGB color space
each color is described as a combination of three
main colors, namely Red, Green and Blue.
color space can be visualized as a 3D matrix with
the main colors set out on the axis.
image on a computer is thus transformed into 3
matrices with values per pixel for the representing
main color.

Computer Vision
2-Image formation
RGB color space

Computer Vision
2-Image formation
Images as functions
 We think of an image as a function, 𝑓:
 𝑓(x,y) gives the intensity value at position (x,y)
 Practically define the image over a rectangle, with a
finite range:
 In the case of color images , an image can be
considered as a multi-valued function.
 The multiple values may correspond to different color
intensities.
 An RGB image is just three functions “stacked” together.

Computer Vision
2-Image formation
Digital images
 In computer vision we typically operate on digital
(discrete) images.
 Digitalization of an image involves two operations:
 Sampling
 Quantization
 Both operations correspond to a discretization of a
quantity, but in different domains.
 Sampling corresponds to a discretization of the space
(That is, of the domain of the function) into a regular
grid.

Computer Vision
2-Image formation
Sampling
 After sampling, the image can be seen as matrix.

 The smallest element resulting from the discretization


of the space is called a pixel (picture element).

Computer Vision
2-Image formation
Quantization
 Quantization corresponds to a discretization of the
intensity values.

 After sampling and quantization, we get

Computer Vision
2-Image formation
Computer Vision
2-Image formation
Digital images
 Image thus represented as a matrix of integer values.

Computer Vision
2-Image formation
Binary image representation

Computer Vision
2-Image formation
Grayscale image representation

Computer Vision
2-Image formation
Color image representation

Computer Vision
2-Image formation
Color image representation

Original RGB colour image (upper left), and its decomposition into the
three contributing channels: Red (upper right), Green (lower left), and
Blue (lower right). For example, red is shown with high intensity in the
red channel, but in low intensity in the green and blue channel

Computer Vision
2-Image formation
Thank you!
?

Computer Vision
2-Image formation

You might also like