Unit1 Lecture.3
Unit1 Lecture.3
Unit1 Lecture.3
A digital image is made up of rows and columns of pixels. A pixel in such an image can be
specified by saying which column and which row contains it. In terms of coordinates, a pixel can
be identified by a pair of integers giving the column number and the row number. For example,
the pixel with coordinates (3,5) would lie in column number 3 and row number 5.
Conventionally, columns are numbered from left to right, starting with zero. Most graphics
systems, including the ones we will study in this chapter, number rows from top to bottom,
starting from zero. Some, including OpenGL, number the rows from bottom to top instead.
When doing 2D graphics, you are given a rectangle in which you want to draw some graphics
primitives. Primitives are specified using some coordinate system on the rectangle. It should be
possible to select a coordinate system that is appropriate for the application. For example, if the
rectangle represents a floor plan for a 15 foot by 12 foot room, then you might want to use a
coordinate system in which the unit of measure is one foot and the coordinates range from 0 to
15 in the horizontal direction and 0 to 12 in the vertical direction. The unit of measure in this
case is feet rather than pixels, and one foot can correspond to many pixels in the image. The
coordinates for a pixel will, in general, be real numbers rather than integers. In fact, it's better to
forget about pixels and just think about points in the image. A point will have a pair of
coordinates given by real numbers.
To specify the coordinate system on a rectangle, you just have to specify the horizontal
coordinates for the left and right edges of the rectangle and the vertical coordinates for the top
and bottom. Let's call these values left, right, top, and bottom. Often, they are thought of
as xmin, xmax, ymin, and ymax, but there is no reason to assume that, for example, top is less
than bottom. We might want a coordinate system in which the vertical coordinate increases from
bottom to top instead of from top to bottom. In that case, top will correspond to the maximum y-
value instead of the minimum value.
To allow programmers to specify the coordinate system that they would like to use, it would be
good to have a subroutine such as
setCoordinateSystem(left,right,bottom,top)
The graphics system would then be responsible for automatically transforming the coordinates
from the specfiied coordinate system into pixel coordinates. Such a subroutine might not be
available, so it's useful to see how the transformation is done by hand. Let's consider the general
case. Given coordinates for a point in one coordinate system, we want to find the coordinates for
the same point in a second coordinate system. (Remember that a coordinate system is just a way
of assigning numbers to points. It's the points that are real!) Suppose that the horizontal and
vertical limits are oldLeft, oldRight, oldTop, and oldBottom for the first coordinate system, and
are newLeft, newRight, newTop, and newBottom for the second. Suppose that a point has
coordinates (oldX,oldY) in the first coordinate system. We want to find the coordinates
(newX,newY) of the point in the second coordinate system
Pixel
Pixel is the smallest element of an image. Each pixel correspond to any one value. In an 8-bit
gray scale image, the value of the pixel between 0 and 255. The value of a pixel at any point
correspond to the intensity of the light photons striking at that point. Each pixel store a value
proportional to the light intensity at that particular location.
PEL
A pixel is also known as PEL. You can have more understanding of the pixel from the pictures
given below.
In the above picture, there may be thousands of pixels, that together make up this image. We will
zoom that image to the extent that we are able to see some pixels division. It is shown in the
image below.
In the above picture, there may be thousands of pixels, that together make up this image. We will
zoom that image to the extent that we are able to see some pixels division. It is shown in the
image below.
0 0 0
0 0 0
0 0 0
Now this image matrix has all filled up with 0. All the pixels have a value of 0. If we were to
calculate the total number of pixels form this matrix , this is how we are going to do it.
Total no of pixels = total no. of rows X total no. of columns
=3X3
= 9.
It means that an image would be formed with 9 pixels, and that image would have a dimension
of 3 rows and 3 column and most importantly that image would be black.
The resulting image that would be made would be something like this
Now why is this image all black. Because all the pixels in the image had a value of 0.
The sampling rate determines the spatial resolution of the digitized image, while the quantization
level determines the number of grey levels in the digitized image. A magnitude of the sampled
image is expressed as a digital value in image processing. The transition between continuous
values of the image function and its digital equivalent is called quantization.
The number of quantization levels should be high enough for human perception of fine shading
details in the image. The occurrence of false contours is the main problem in image which has
been quantized with insufficient brightness levels.
To create a digital image, we need to convert the continuous sensed data into digital form.
To convert a continuous image f(x, y) into digital form, we have to sample the function in both
co-ordinates and amplitude.
Sampling Quantization
Digitization of co-ordinate values. Digitization of amplitude values.