Anzeige

# module 1.pdf

21. Mar 2023
Anzeige

### module 1.pdf

1. COMPUTER GRAPHICS AND IMAGE PROCESSING MODULE I
2. Module – 1(Basics of Computer graphics and Algorithms) • Basics of Computer Graphics and its applications. Video Display devices- Refresh Cathode Ray Tubes, Random Scan Displays and systems, Raster scan displays and systems. • Line drawing algorithms- DDA, Bresenham’s algorithm. Circle drawing algorithms- Midpoint Circle generation algorithm, Bresenham’s algorithm.
3. • Business visualization- Data sets related to commerce, industry etc
4. VIDEO DISPLAY DEVICES
5. Electron Gun
6. RASTER AND RANDOM SCAN DEVICES
7. RASTER SCAN SYSTEMS
8. • 1. Beam Penetration Method : Beam Penetration Method is quite similar to the normal CRT and it uses only one electron gun. In this, different colors of multi-layered are coated on inner surface of screen, normally the two layers of phosphorus i.e., red and green are coated. It is a method used for displaying color pictures that has been used with random scan monitors. • 2. Shadow Mask Method : Shadow Mask Method is the method which is used in raster scan system which includes color TVs. In this the pixel is made up of three -colors. So due to three colors it uses three electron guns one for producing each color. The colors are red, green and blue. In this the important consideration for a color monitor is the setting of electron guns and the phosphor dots forming a pixel.
9. Line drawing algorithms • The Line drawing algorithm is a graphical algorithm which is used to represent the line segment on discrete graphical media, i.e., printer and pixel-based media. • A line contains two points. The point is an important element of a line Equation of the straight line We can define a straight line with the help of the following equation. y= mx + a • Where,
10. 3 cases m=1, m< 1, m>1
11. DDA (Digital Differential Analyzer) • Simplest line drawing algorithm. • Digital Differential Analyzer algorithm is also known as an incremental method of scan conversion. Previous step results are used in the next step. • Digital Differential Analyzer algorithm is used to perform rasterization on polygons, lines, and triangles etc
12. Algorithm of Digital Differential Analyzer (DDA) Line Drawing Step 1: Start. Step 2: We consider Starting point as (x1, y1), and ending point (x2, y2). Step 3: Now, we have to calculate Δx and Δy. Δx = x2-x1 Δy = y2-y1 m = Δy/Δx
13. Step 4: Now, we calculate three cases. If m < 1 Then x change in Unit Interval y moves with deviation (xk+1, yk+1) = (xk+1, yk+m) If m > 1 Then x moves with deviation y change in Unit Interval (xk+1, yk+1) = (xk+1/m, yk+1) If m = 1 Then x moves in Unit Interval y moves in Unit Interval (xk+1, yk+1) = (xk+1, yk+1) Step 5: We will repeat step 4 until we find the ending point of the line. Step 6: Stop.
14. Problems • There is a system with resolution 640 X 480. Calculate the size of the frame buffer to store 12 bits per pixel? Solution Resolution = 640 X 480 Number of bits/pixel = N = 12 Required Frame Buffer Memory = N X Resolution = 12 X 640 X 480 Memory in bytes = (12 x 640 X 480) / 8 = 460800 Bytes Memory in KB = 460800/1024 = 450 KB
15. There is a system with resolution 1280 X 1024. Find out the size of frame buffer in bytes and kilobytes, if 9 bits per pixel are stored. Also find out how many colors can be displayed? Solution Resolution = 1280 X 1024 Number of bits/pixel = N = 9 Required Frame Buffer Memory = N X Resolution = 9 X 1280 X 1024 Memory in bytes = (9 X 1280 X 1024) / 8 = 1474560 Bytes Memory in KB = 1474560/1024 = 1440 KB • If there are n bits per pixel then we can have a total of 2n colors. Here we have 9 bits per pixel, so, Total number of colors = 2n = 29= 512 colors
16. There are two raster systems with resolutions of 1280×1024, and 2560×2048. a) Tell the size of the frame buffer (in bytes) for each of these systems to store 12 bits/pixel? b) How much storage is required for each system if we store 24 bits per pixel? 1280 x 1024 x 12 bits / 8 = 1920KB 2560 x 2048 x 12 bits / 8 = 7680KB
17. Consider two raster systems with the resolutions of 640 x 480 and 1280 x 1024. a) How many pixels could be accessed per second in each of these systems by a display controller that refreshes the screen at a rate of 60 frames per second? Solution Since 60 frames are refreshed per second and each frame consists of 640 x 480 pixels, the access rate of such a system is (640 x 480) * 60 = 1.8432 x 107 pixels/second. Likewise, for the 1280 x 1024 system, the access rate is (1280 x 1024) * 60 = 7.86432 x 107 pixels/second.
18. Bresenham's Line Algorithm
19. Line equation The slope-intercept form of a line is written as • To illustrate Bresenham’s approach, we first consider the scan conversion process for lines with positive slope less than 1 • Pixel positions along a line path are the determined by sampling at unit x intervals. • Starting from the left end point( x0,y0) of a given line, we step to each successive column(x position) and plot the pixel whose scan line y value is closest to the line path
20. (xk+1,yk) or (xk+1,yk +1)
21. If dlower - dupper <0 dlower - dupper >0 yk yk+1 xk
22. ie ynext =yk
23. To find the initial value of Pk
24. Calculate the points between the starting coordinates (9, 18) and ending coordinates (14, 22). Calculate ΔX and ΔY from the given input. ΔX = Xn – X0 = 14 – 9 = 5 ΔY =Yn – Y0 = 22 – 18 = 4 Calculate the decision parameter. Pk= 2ΔY – ΔX = 2 x 4 – 5 = 3 So, decision parameter Pk = 3
25. As Pk >= 0, so case-02 is satisfied. Thus, k+1 k • P = P + 2ΔY – 2ΔX = 3 + (2 x 4) – (2 x 5) = 1 • Xk+1 = Xk + 1 = 9 + 1 = 10 • Yk+1 = Yk + 1 = 18 + 1 = 19 Similarly, Step-03 is executed until the end point is reached or number of iterations equals to 5 times. (Number of iterations = ΔX =5 times) x y p 9 18 3 10 19 1 11 20 -1 12 20 7 13 21 5 14 22 3
26. Calculate the points between the starting coordinates (20, 10) and ending coordinates (30, 18). dx=10 dy=8 2dy=16 Pk=2dy-dx= 16-10=6 2dy-2dx= 16-20 = -4 x y p 20 10 6 21 11 2 22 12 -2 23 12 14 24 13 10 25 14 6 26 15 2 27 16 -2 28 16 14 29 17 10 30 18 6