Unit1 Lecture.3

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Pixel Coordinates

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.

Real-number Coordinate Systems

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.

Relation ship with CCD array


We have seen that how an image is formed in the CCD array. So a pixel can also be defined as
The smallest division the CCD array is also known as pixel.
Each division of CCD array contains the value against the intensity of the photon striking to it.
This value can also be called as a pixel

Calculation of total number of pixels


We have define an image as a two dimensional signal or matrix. Then in that case the number of
PEL would be equal to the number of rows multiply with number of columns.
This can be mathematically represented as below:
Total number of pixels = number of rows ( X ) number of columns
Or we can say that the number of (x,y) coordinate pairs make up the total number of pixels.
We will look in more detail in the tutorial of image types , that how do we calculate the pixels in
a color image.
Gray level
The value of the pixel at any point denotes the intensity of image at that location , and that is also
known as gray level.
We will see in more detail about the value of the pixels in the image storage and bits per pixel
tutorial, but for now we will just look at the concept of only one pixel value.
Pixel value.(0)
As it has already been define in the beginning of this tutorial , that each pixel can have only one
value and each value denotes the intensity of light at that point of the image.
We will now look at a very unique value 0. The value 0 means absence of light. It means that 0
denotes dark, and it further means that when ever a pixel has a value of 0, it means at that point ,
black color would be formed.
Have a look at this image matrix

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.

Sampling and quantization


In order to become suitable for digital processing, an image function f(x,y) must be digitized
both spatially and in amplitude. Typically, a frame grabber or digitizer is used to sample and
quantize the analogue video signal. Hence in order to create an image which is digital, we need
to covert continuous data into digital form. There are two steps in which it is done:
 Sampling
 Quantization

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.

This process includes 2 processes:

Sampling: Digitizing the co-ordinate value is called sampling.

Quantization: Digitizing the amplitude value is called quantization.

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.

x-axis(time) – discretized. x-axis(time) – continuous.

y-axis(amplitude) – continuous. y-axis(amplitude) – discretized.

Sampling is done prior to the Quantizatin is done after the sampling


quantization process. process.

It determines the spatial resolution of It determines the number of grey levels


the digitized images. in the digitized images.
It reduces c.c. to a series of tent poles It reduces c.c. to a continuous series of
over a time. stair steps.

You might also like