Scan conversion of line with the slope, Computer Graphics

Assignment Help:

Scan Conversion of Line with the slope (0 < m < 1)

Currently the pixel positions beside the line path are determined through sampling at Unit x intervals that is, starting from the first point. (x0, y0) of a provided line we step to all successive columns. That is x-position and plots the pixel that scan line y value is closest to the line path. Suppose we proceed in such fashion up to the kth step. The process is demonstrated in following figure. Suppose that we have determined the pixel at (xk, yk). We require deciding that pixel is to be plotted in column xk+ 1. Our options are either (xk +1, yk) or (xk + 1, yk + 1).

1959_Scan Conversion of Line with the slope 1.png

Figure: Scan conversion 0 < m < 1

On sampling position Xk + 1 the vertical pixel or say scan line separation from mathematical line i.e. y = mx + c is say d1 and d2.

Currently, the y coordinate on the mathematical line on pixel column position Xk + 1 is:

y = m (xk + 1) + c                                       ---------------------(1)

By using figure of Scan conversion 0 < m < 1:

d1 = y - yk                                                                             ---------------------(2)

= m (xk + 1) + c - yk                                                  ---------------------(3) (by using (1))

Likewise, d2 = (yk + 1) - y = yk +  1 - m (xk + 1) - c    ---------------------(4)

By using (3) and (4) we get d1 - d2

d1 - d2 = [m (xk + 1) + c - yk] - [yk + 1 - m (xk + 1) - c]

= mxk + m + c - yk - yk - 1 + mxk + m + c

= 2m (xk + 1) - 2yk + 2c - 1                     ---------------------(5)

As, decision parameter p for kth step that is pk is specified by

pk   = Δx(d1 - d2 )---------------------(6)

 

Currently, a decision parameter pk for the kth step in the line algorithm can be acquired by rearranging (5) hence it involves merely integer calculations. To achieve this substitute m = Δy/Δx; here, Δy and Δx ⇒ vertical and horizontal separations of the ending point positions.

pk = Δx (d1 - d2) = Δ x [2m (xk + 1) - 2yk + 2c - 1]

= Δx [2(Δy/Δx)  (xk + 1) - 2yk + 2c - 1]

= 2 Δy (xk + 1) - 2 Δxyk + 2 Δxc - Δx

= 2 Δy xk - 2 Δx yk + [2 Δy + Δx (2c - 1)]

pk  = 2 Δy xk - 2Δxyk + b               -------------------- (7)

Here b is constant with value b = 2Δy + Δx (2c - 1)       ---------------------(8)

Note: sign of pk is as similar as sign of d1 - d2 as it is assumed like Δx > 0; here in figure of Scan conversion 0 < m < 1 , d1 < d2 i.e. (d1 - d2) is -ve that is , pk is negative so pixel Ti is more suitable option otherwise pixel Si is the proper option.

That is (1) if pk < 0 choose Ti, hence subsequent pixel option (xk, yk) is (xk + 1, yk) else (2) if pk > 0 decide Si, so subsequent pixel option after (xk , yk ) is (xk + 1, yk + 1).

At step k + 1 the decision parameter is evaluated via writing (7) as:

pk + 1 = 2Δy xk + 1 - 2Δx yk + 1   + b         ---------------------(9)

Subtracting (7) from (9) we find:

982_Scan Conversion of Line with the slope 2.png

Such recursive calculation of decision parameter is preformed at all integer positions, starting along with the left coordinate ending point of line.

This first parameter p0 is calculated by utilizing Eq(7), and (8) at the beginning pixel position (x0, y0) along with m evaluated as Δy /Δx (that is intercept c = 0)

p0 = 0 - 0 + b = 2Δy + Δx (2 * 0 - 1) = 2Δy - Δx

p0 = 2Δy - Δx                                           -----------------------(10 A)


Related Discussions:- Scan conversion of line with the slope

Key frame systems, Ask questionkms eey frame syst #Minimum 100 words accept...

Ask questionkms eey frame syst #Minimum 100 words accepted#

Advantage and disadvantage of plasma panel-graphics hardware, Advantage and...

Advantage and Disadvantage of Plasma panel - Graphics Hardware Advantage 1. Slim design as Wall mountable 2. Larger than LCD screens Disadvantage

Applications for computer animation-physics, Normal 0 false f...

Normal 0 false false false EN-US X-NONE X-NONE

2d and 3d virtual environments , I need different convincing virtual enviro...

I need different convincing virtual environments (2D and 3D) that alter size perception. In particular, for 2D environment or background, when any object is augmented with the 2D e

Persistence of phosphor - display devices, Persistence (of phosphor) - Disp...

Persistence (of phosphor) - Display devices Time it takes the emitted light from screen to decay to one-tenth of its original intensity. The point where an electron gun strikes

Define affine transformation, Define Affine transformation?  A coordina...

Define Affine transformation?  A coordinate transformation of the form X= axxx +axyy+bx, y 'ayxx+ayy y+by  is known as a two-dimensional affine transformation. Every of the tra

What is monitor, Q. What is Monitor? A Monitor is a television like bo...

Q. What is Monitor? A Monitor is a television like box connected to your computer and providing you a vision into the mind of your PC. It displays what your computer is thinki

Forensics-applications for computer animation, Forensics: Accidents occur ...

Forensics: Accidents occur every minute. Very frequently, there are no witnesses except for the individuals concerned in the accident or worse yet, there are no surviving witnesse

Project by matlab , I am trying to do a project by matlab. which is related...

I am trying to do a project by matlab. which is related to computer vision. the name of project is (texture synthesis and image quilting), which is inspire from this paper (Efros a

Rotation about an arbitrary axis, Rotation about an arbitrary axis Rota...

Rotation about an arbitrary axis Rotation about an arbitrary axis is a composition of several rotations and translation operations. What you need to do is the following:  a)

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd