Sie sind auf Seite 1von 38

COMPUTER

VISION

LECTURE 03
IMAGE
• An image is a projection of 3D objects on 2D surface.
• An image is a 2D light intensity function of form f(x,y).
• Where x and y denotes the spatial co-ordinates and the
values of f @ (x,y) is brightness of the image at that point.
DIGITAL IMAGE
• A digital image is an image f(x,y) that has been “discretized” both in
spatial & in brightness.
• An image is an array, or a matrix, of square pixels (picture elements)
arranged in columns and rows.
• A 2D matrix whose rows & columns identify a
unique point in the image.
• The corresponding matrix element value
identifies the brightness level at that point.
• The element of such a digital array are called
image elements, picture elements, pixels or pel.
DIGITAL IMAGE
IMAGE
• An image is light Intensity function, so
0<f(x,y)< ∞
Light Energy cannot be negative
Light Energy cannot be Infinite

• An image consists of two components, namely illumination


and Reflectance.
f(x,y)=i(x,y) * r(x,y)
where
0< i(x,y)< ∞
0< r(x,y)<1
IMAGE
• Illumination is the amount of light falling on the object, and,
this is property of light source.
• Reflectance is the light reflected back from object and this
remains between 0 & 1.

Reflectance = 0 (Transparent Objects)


Reflectance = 1 (Opaque Objects)
REFLECTION R(X,Y) VALUES
• Typical values of reflection r(x,y) are:

0.01 for black velvet


0.65 for stainless steel
0.80 for flat-white wall paint
0.90 for silver-plated metal
0.93 for snow
GRAY SCALE
• The intensity value of any Pixel is called as Gray Level value,
and it is denoted by ‘L’.
• The value of ‘L’ lies in a certain range, and this is called as
Gray Scale.
• [Lmin , Lmax] is the Gray Scale, such that Lmin < L <Lmax

• For Binary images, the gray scale used is [0,1].


• For color images, the gray scale is [0, 255].
GRAY SCALE
• The interval between the Lmin and Lmax is usually taken from 0
to 1 (for binary images).
• We generally have the following conventions:
[0, 7] 8-levels
[0, 15] 16-levels
[0, 31] 32 levels
[0, 255] 256 levels

• The Low value represents BLACK


• The high value represent WHITE
• Intermediate Values gives different shades
TYPES OF DIGITAL IMAGES
1. Binary
• Each pixel is just black or white.
• Since there are only two possible values for each pixel, we
only need one bit per pixel.
• Such images can therefore be very efficient in terms of
storage.
• Images for which a binary representation may be suitable
include text (printed or handwriting), fingerprints, or
architectural plans.
BINARY IMAGE
TYPES OF DIGITAL IMAGES
2. Grayscale
• Each pixel is a shade of grey, normally from 0 (black) to 255
(white).
• This range means that each pixel can be represented by eight
bits, or exactly one byte.
• Other greyscale ranges are used, but generally they are a
power of 2.
• Such images arise in medicine (X-rays), images of printed
works, and indeed 256 different grey levels is sufficient for the
recognition of most natural objects.
GRAYSCALE IMAGES
TYPES OF DIGITAL IMAGES
3. True Color or RGB
• Here each pixel has a particular color; that color being
described by the amount of red, green and blue in it. If each of
these components has a range 0– 255, this gives
• a total of 2553 = 16,777,216 different possible colors in the
image. This is enough colors for any image. Since the total
number of bits required for each pixel is 24, such images are
also called 24-bit color images.
• Such an image may be considered as consisting of a “stack” of
three matrices; representing the red, green and blue values for
each pixel. This means that for every pixel there correspond
three values.
A TRUE COLOR IMAGE
TYPES OF DIGITAL IMAGES
4. Indexed
• Most color images only have a small subset of the more than
sixteen million possible colors.
• For convenience of storage and file handling, the image has an
associated color map, or color palette, which is simply a list of
all the colors used in that image.
• Each pixel has a value which does not give its color (as for an
RGB image), but an index to the color in the map.
• It is convenient if an image has 256 colors or less, for then the
index values will only require one byte each to store.
• Some image file formats (for example, Compuserve GIF), allow
only 256 colors or fewer in each image, for precisely this
reason.
INDEX IMAGE
IMAGE DIGITIZATION
• A process of converting Analog Images in to Digital.
• An image captured by a sensor is expressed as a continuous
function f(x,y) of two co-ordinates in the plane.
• Image digitization means that the function f(x,y)
is sampled into a matrix with M rows and N columns.
• Constitutes of Two Steps.
1. Sampling
2. Quantization

• Sampling: Digitization of Spatial coordinates.


• Quantization: Digitization of Amplitude Values.
SAMPLING
• First step, data is sampled at regular intervals, such as the grid
of pixels used to represent a digital image. Or
• Digitization of spatial coordinates (x,y) referred to as Image
Sampling.
• The frequency of sampling is referred to as resolution of the
image.
• Sampling turns continuous data (analog) into discrete (digital)
data.
Original image of Golden Gate
Bridge

Image resampled at half the original


resolution
QUANTIZATION
• Second, each sample is quantified, i.e. assigned a numerical
value drawn from a defined range (such as 0-255 in the case
of a 8-bit gray scale image).
• Amplitude Digitization is called Gray-level Quantization.
• The transition between continuous values of the image
function (brightness) and its digital equivalent is
called quantitation.
• The number of quantitation levels should be high enough for
human perception of fine shading details in the image.
• If b bits are used ... the number of brightness levels is k=2b.
DIGITAL IMAGE APPROXIMATION
Suppose that a continuous Image f(x,y) is approximated by
equally spaced samples to form a N*N array, such that:
DIGITIZATION
IMAGE REPRESENTATION
A Binary Image stored in computer can be shown as:
RESOLUTION
• It may be defined as the degree of discrete detail of an image
which is strongly dependent on both n and m.

• The more these parameters are increased, the closer the


digitized array will approximate the original image.

• By reducing the number of samples an image is distorted (less


information is available).

• By decreasing the number of gray levels we get imperceptible


image and is called False Contouring.
PIXEL COUNT RESOLUTION SPATIAL RESOLUTION
• Pixel Count Resolution is simply the amount • Spatial Resolution relates to the number of
of pixels a digital image contains, or is made pixels in a spatial measurement of a
up of. It is expressed in physical image - pixels per inch. Spatial
either megapixels or pixel dimensions. resolution does not apply to an image file
• The term Megapixels simply means millions (except as a temporary/variable
of pixels. One megapixel equals 1 million specification thereof), only to a physical
pixels. A six megapixel image is an image image. An image literally can not have a
made up of 6 million pixels, or some rough spatial resolution if it doesn't take a
approximation thereof. physical form - it can't have any given
• Pixel Dimensions represent another, more number of pixels per inch if it doesn't have
descriptive method of designating pixel physical dimensions.
count resolution. By stating the pixel • The spatial resolution of an image is
dimensions of a digital image, the pixel commonly referred to in terms of "dpi."
count is inferred. In addition, the aspect What is being specified is pixels per inch,
ratio of the image is revealed, as are the however "dots" per inch has gained a
exact dimensions. foothold in common terminology.
• Pixel Count Resolution is a fixed property of • Spatial Resolution is a variable property of
an image. Unless the image is resampled or an image file - it only becomes a fixed
cropped the image remains the same property of an image once it is output in
number of pixels. permanent form, i.e. printed. As this
resolution is conditional upon output, this
resolution is commonly called output
resolution or print resolution.
STORAGE REQUIREMENTS
The formula used for calculating “bits” required, is given by:
B= M*N*k
Where
• M= Number of Rows
• N= Number of Columns
• K= Bits required to encode the used Gray Level

• For encoding a gray scale of [0, 7], that is 8 different gray


values, we need 3 bits.
• In case of square images (M=N), it becomes:
B= N2*k
ASPECT RATIO
• Another important concept with the pixel resolution is aspect
ratio.
• Aspect ratio is the ratio between width of an image and the
height of an image. It is commonly explained as two numbers
separated by a colon (8:9). This ratio differs in different images,
and in different screens.
• The common aspect ratios are: 1.33:1, 1.37:1, 1.43:1, 1.50:1,
1.56:1, 1.66:1, 1.75:1, 1.78:1, 1.85:1, 2.00:1, e.t.c
• Advantage
• Aspect ratio maintains a balance between the appearance
of an image on the screen, means it maintains a ratio
between horizontal and vertical pixels. It does not let the
image to get distorted when aspect ratio is increased.
EXAMPLE
Find bits required to store a 4*4 digital Image, when we are using
64 different gray levels?
Solution:
Resolution = 4*4
Gray Scale = [0,63]
Encoded bits = 6 (since 26 = 64)
So bits required are:
B = M*N*k
B= 4*4*6
B= 96 bits
EXAMPLE
Consider an image with aspect ratio of 6:2 with pixel resolution of
480,000 pixels given the image is an gray scale. Find its size and
calculate its dimensions.
Solution:
Given:
Aspect ratio: c:r = 6:2
Pixel resolution: c * r = 480000
Bits per pixel: grayscale image = 8bpp
Find:
Number of rows = ?
Number of cols = ?
EXAMPLE
Solving first part:
6𝑟
Equation 1. c:r = 6:2 → c=
2
480000
Equation 2. c=
𝑟
6𝑟 480000
Comparing both equations → =
2 𝑟

𝑟2 = 480000 ∗ 2/6
That gives r= 400.
Put r in equation 1, we get → c= 1200.
So rows = 400 and cols = 1200.
EXAMPLE
Solving Second part:

Size = rows * cols * bpp

Size of image in bits = 400 * 1200 * 8 = 3840000 bits

Size of image in bytes = 480000 bytes

Size of image in kilo bytes = 48 kb (approx).


STORAGE REQUIREMENTS

Table showing Bits required for some typical values of N (N2k)


COORDINATE SYSTEMS
• You can specify locations in images using various coordinate
systems.
• Coordinate systems are used to place elements in relation to
each other.
• Coordinates in pixel and spatial coordinate systems relate to
locations in an image.
• Coordinates in 3-D coordinate systems describe the 3-D
positioning and origin of the system.
PIXEL INDICES
• In the pixel coordinate system, the image is treated as a grid of
discrete elements, ordered from top to bottom and left to right.

• For pixel coordinates, the number of rows, r, downward, while the


number of columns, c, increase to the right.
• Pixel coordinates are integer values and range from 1 to the
length of the row or column.
SPATIAL COORDINATES
• Spatial coordinates enable you to specify a location in an image
with greater granularity than pixel coordinates.

• Such as, in the pixel coordinate system, a pixel is treated as a


discrete unit, uniquely identified by an integer row and column
pair, such as (3,4).
• In the spatial coordinate system, locations in an image are
represented in terms of partial pixels, such as (3.3, 4.7).
VISION AND GRAPHICS
APPLICATION AREAS
• Law enforcement
• Nuclear medicine and defense
• Automatic character recognition
• Industrial applications (machine vision)
• Satellite imagery for weather prediction
• Solving problems with machine perception
• Enhance the contrast or code the intensity levels into color for
easier interpretation
• Interpretation of X-rays and other images used in industry,
medicine and biological sciences
• Remote sensing

Das könnte Ihnen auch gefallen