CGIP MOD 1
CGIP MOD 1
&
IMAGE PROCESSING
1
COURSE OUTCOMES
Syllabus
MODULE I
• Examples: Bar charts, line graphs, pie charts, surface graphs, time charts,...
Presentation Graphics
Computer Art
• Computer graphics methods are widely used in both fine art and commercial
art applications.
• Includes artist’s paintbrush programs, paint packages, CAD packages and
animation packages
• These packages provides facilities for designing object shapes & specifying
object motions.
• Examples: Cartoon drawings, paintings, product advertisements, logo design,
etc.
Entertainment
Movie industry
Computer graphics methods are now commonly used in
making motion pictures, music videos, and television shows.
Game Industry
Focus on interactivity
Cost effective solutions
Avoiding computations and other tricks
A common graphics method employed in many commercials is
morphing, where one object is transformed into another.
Education and Training
◼ Computer generated models of physical, financial and economic
systems are used as educational aids
◼ Models of physical systems, physiological systems, population
trends, or equipment such as color-coded diagrams help trainees
understand the system’s operation
◼ Specialized systems used for training applications
◼ Simulators for practice sessions and training of :
◼ ship captains
◼ aircraft pilots
◼ heavy equipment operators
◼ air traffic-control personnel
Education and Training
Visualization
Scientific engineers, medical personnel, business analysts, and others often need to
analyse large amounts of information or study the behaviour of certain processes.
Image Processing
In computer graphics, a computer is used to create a picture.
Image processing, on the other hand, applies techniques to modify or interpret existing pictures,
such as photographs and TV scans. Two principal applications of image processing are
improving picture quality and machine perception of visual information as used in robotics.
Pixel
• The picture element is called as Pixel or pel
• 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
and that is also known as gray level.
In the first 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.
Calculation of total number of pixels
• Cathode-Ray Tube(CRT)
• Color CRT Monitor
• Liquid crystal display(LCD)
• Light Emitting Diode(LED)
• Direct View Storage Tubes(DVST)
• Plasma Display
• 3D Display
Cathode-Ray Tube(CRT)
• Because the light emitted by the phosphor fades very rapidly, some
method is needed for maintaining the screen picture.
• In the vacuum inside the CRT envelope, the free, negatively charged
electrons are then accelerated toward the phosphor coating by a
high positive voltage.
• The accelerating voltage can be generated with a positively
charged metal coating on the inside of the CRT envelope near
the phosphor screen, or an accelerating anode can be used.
• Otherwise, the electrons would repel each other, and the beam would
spread out as it approaches the screen.
The refresh rate (or "vertical refresh rate", "vertical scan rate") is the number of times per
second that a raster-based display device redraws images.
Refresh rates for CRT monitors include 60, 75, and 85 Hz.
Raster- Scan Displays….
▪ Electron beam sweeps across the screen one row at a time from top to
bottom referred to as a scan line
▪ At the end of each scan line, the electron beam returns to the left side of
the screen to display the next scan line (horizontal retrace)
▪ At the end of each frame, the electron beam returns to the top-left
corner of the screen to display the next frame (vertical retrace)
Scan line
Horizontal Vertical
retrace retrace
41
Raster Scan System
• Picture definition is stored in a memory area called the refresh
buffer or frame buffer.
• Stored intensity values are then retrieved from the refresh buffer
and "painted" on the screen one row (scan line) at a time .
46
Random Scan Display
• In Random-Scan Display, the electron beam is directed only to the
areas of the screen where a picture has to be drawn.
Raster scan
Random scan 50
▪ Advantages of Vector displays:
• very fine detail of line drawings (sometimes curves),
• Higher resolution
• geometry objects (lines)
• eg. 1000 line plot: vector display computes 2000 endpoints
• raster display computes all pixels on each line
51
RASTER SCAN RANDOM SCAN
While the resolution of raster scan is lesser The resolution of random scan is
or lower than random scan higher than raster scan
While the cost of raster scan is lesser than It is costlier than raster scan .
random scan.
CST 304-CGIP
Answer
Here, resolution = 8 inch X 10 inch
First, we convert it in pixel then Now resolution = 8 X 100 by 10 X
100 pixel = 800 X 1000 pixel
1 pixel can store 6 bits
= 𝟔× 𝟏𝟎5bytes.
Color CRT Monitors
• By combining the emitted light from the different phosphors, a range of colors
can be generated.
• The two basic techniques for producing color displays with a CRT are the
beam- penetration method and the shadow-mask method.
The beam penetration method
• Two layers of phosphor, usually red and green, are coated onto the
inside of the CRT screen, and the displayed color depends on how far
the electron beam penetrates into the phosphor layers.
• A beam of very fast electrons penetrates through the red layer and
excites the inner green layer.
• At intermediate beam speeds, combinations of
red and green light are emitted to show two
additional colors, orange and yellow.
• A shadow mask CRT has three phosphor color dots at each pixel position.
• One phosphor dot emits a red light, another emits a green light, and
the third emits a blue light.
• This type of CRT has three electron guns, one for each color dot, and a
CST 304-CGIP
CST 304-CGIP
• The three electron beams are deflected and focused as a group onto
the shadow mask, which contains a series of holes aligned with the
phosphor dot patterns.
• When the three beams pass through a hole in the shadow mask, they
activate a dot triangle, which appears as a small color spot on the
screen.
• The phosphor dots in the triangles are arranged so that each electron
beam can activate only its corresponding color dot when it passes
through the shadow mask.
• We obtain color variations in a shadow mask CRT by varying the
intensity levels of the three electron beams.
• By turning off the red and green guns, we get only the color
coming from the blue phosphor.
CST 304-CGIP
• The color we see depends on the amount of excitation of the red, green,
and blue phosphors.
• A white area is the result of activating all three dots with equal intensity.
CST 304-CGIP
63
64
Direct-View Storage Tubes
• An alternative method for maintaining a screen image is to store
the picture information inside the CRT instead of refreshing the
screen.
Case 2:
xk +1= xk +1/m
yk+1=yk+1
Namitha Rama chandR a n
The advantages of DDA Algorithm are-
•It is a simple algorithm.
•It is easy to implement.
•It avoids using the multiplication operation which is costly in terms of time
complexity.
then d1=y-yk
= m(xk+1)+b-yk ………………(3)
d2=(yk+1)-y
= yk+1 – m(xk+1)-b ………………(4)
The difference between d1 and d2 is
if(pk >0 ie d1-d2 >0 ,meaning actual line lays closer to yk+1 ,then next pixel
coordinate is (xk+1,yk+1) .
3. Calculate the constants dx, dy, 2dy, and 2dy–2dx and get the first value for the
decision parameter as
p0=2dy−dx
4. At each Xk along the line, starting at k = 0, perform the following test –
If pk < 0, the next point to plot is (xk+1,yk) and Pk+1 =Pk +2dy
Otherwise, the next point to plot is (xk+1,yk+1) and Pk+1=Pk+2dy-2dx
5. Repeat step 4 dx times.
Example : Draw line using Bresenham’s Line Drwaing Algorithm
Endpoints (20,10) and (30,18)
K Pk (Xk+1,yk+1)
Slope= dy/dx → (18-10) /(30-20) → 0.8 <1
0 6 (21,11)
dx=10 dy=8
1 2 (22,12)
P0 =2dy-dx →2x 8 -10 =6
2 -2 (23,12)
2dy=16 3 14 (24,13)
4 10 (25,14)
2dy-2dx=-4
5 6 (26,15)
Initial plot point(x0,y0) =(20,10)
6 2 (27,16)
7 -2 (28,16)
8 14 (29,17)
9 10 (30,18)
Example : Draw line using Bresenham’s Line Drwaing Algorithm
Endpoints (9,18) and (14,22)
dx=5 dy=4
2dy=2 x 4=8
2dy-2dx=8-10=-2
Advantages of Bresenham's Algorithm
•It also does not provide smooth lines though accuracy has been improved.
•Less faster than DDA Algorithm.
CIRCLE DRAWING ALGORITHM
Properties of Circles
• A circle is defined as the set of points that are all at a given
distance r from a center position (xc,yc).
• This distance relationship is expressed by the Pythagorean
theorem in Cartesian coordinates as,
(𝒙 −𝐱c)2 +(𝒚 −𝐲c)2=r2
We can use this equation to calculate the positions of points on a
circle by stepping along the x axis in unit steps and calculating
the corresponding y values at each position as ,
y=yc+-√ r2 -(𝒙 −𝐱c)2
But this is not the best method for getting a circle.
One problem with this approach is that it involves considerable
computation at each step.
• Another method is to calculate the points along the circular
boundary using polar coordinates r and θ.
• Expressing the circle equation in parametric polar form yields the pair of
equation.
x=xc+r cos θ
y=yc+r sin θ