IP Fundamentals
IP Fundamentals
CS491E/791E
Color images
Image formation
There are two parts to the image formation process:
The geometry of image formation, which determines where
in the image plane the projection of a point in the scene will
be located.
The physics of light, which determines the brightness of a
point in the image plane as a function of illumination and
surface properties.
Pinhole camera
This is the simplest device to form an image of a 3D scene
on a 2D surface.
Straight rays of light pass through a pinhole and form an
inverted image of the object on the image plane.
fX
x
Z
fY
y
Z
Camera optics
In practice, the aperture must be larger to admit more light.
Lenses are placed to in the aperture to focus the bundle of rays
from each scene point onto the corresponding point in the image
plane
Photometric parameters
type, intensity, and direction of illumination
reflectance properties of the viewed surfaces
Geometric parameters
type of projections
position and orientation of camera in space
perspective distortions introduced by the imaging process
Image distortion
What is light?
The visible portion of the electromagnetic (EM)
spectrum.
It occurs between wavelengths of approximately 400 and
700 nanometers.
Short wavelengths
Different wavelengths of radiation have different
properties.
The x-ray region of the spectrum, it carries sufficient
energy to penetrate a significant volume or material.
Long wavelengths
Copious quantities of infrared (IR) radiation are emitted
from warm objects (e.g., locate people in total darkness).
Range images
An array of distances to the objects in the scene.
They can be produced by sonar or by using laser
rangefinders.
Sonic images
Produced by the reflection of sound waves off an object.
High sound frequencies are used to improve resolution.
Frame grabber
Usually, a CCD camera plugs into a computer board
(frame grabber).
The frame grabber digitizes the signal and stores it in its
memory (frame buffer).
Image digitization
Image quantization(example)
sampled by a factor of 4
sampled by a factor of 2
sampled by a factor of 8
Digital image
An image is represented by a rectangular array of integers.
An integer represents the brightness or darkness of the image at
that point.
N: # of rows, M: # of columns, Q: # of gray levels
N=
,M=
2n
,Q=
2m
(q is the # of bits/pixel)
2q
f (0,0)
f (0,1)
...
f (0, M 1)
f (1,0)
f (1,1)
...
f (1, M 1)
...
f ( N 1,0)
...
...
f ( N 1,1) ...
...
f ( N 1, M 1)
PGM format
A popular format for grayscale images (8 bits/pixel)
Closely-related formats are:
PBM (Portable Bitmap), for binary images (1 bit/pixel)
PPM (Portable Pixelmap), for color images (24 bits/pixel)
Image Class
class ImageType {
public:
ImageType();
~ImageType();
// more functions ...
private:
int N, M, Q; //N: # rows, M: # columns
int **pixelValue;
};
An example - Threshold.cpp
void readImageHeader(char[], int&, int&, int&, bool&);
void readImage(char[], ImageType&);
void writeImage(char[], ImageType&);
void main(int argc, char *argv[])
{
int i, j;
int M, N, Q;
bool type;
int val;
int thresh;
// read image header
readImageHeader(argv[1], N, M, Q, type);
// allocate memory for the image array
ImageType image(N, M, Q);
// read image
readImage(argv[1], image);
Threshold.cpp (contd)
cout << "Enter threshold: ";
cin >> thresh;
// threshold image
for(i=0; i<N; i++)
for(j=0; j<M; j++) {
image.getVal(i, j, val);
if(val < thresh)
image.setVal(i, j, 255);
else
image.setVal(i, j, 0);
}
// write image
writeImage(argv[2], image);
}