Odd-even rule and non-zero winding number rule, Computer Graphics

Assignment Help:

What is the difference between odd-even rule and non-zero winding number rule to identify interior regions of an object? Develop an algorithm for a recursive method for filling a 4-connected area? What is the problem associated with this algorithm.

Difference between odd-even rule and non zero winding number:  Odd- even rule: In this algorithm we draw a line from any position p to a distant point outside the coordinate extents of the object and counting the number of edge crossing along the line. If the number of polygon edges crossed by this line is odd, then p is an interior point, otherwise p is an exterior point. To obtain an accurate edge count, we must be sure that the line path we choose does not intersect any polygon vertices. 

Non zero winding number rule: In this algorithm count the number of times the polygon edges wind around a particular point in the counter clockwise direction. This count s called the winding number and the interior points of a two dimensional object are defined to be those that have a non zero value for the winding number. We apply the non zero winding number rule to polygons by initializing the winding number to 0 and again imagining a kine drawn from any position p to a distant point beyond the coordinates extents of the object. The line we choose must not pass through any vertices. As we move along the line from position p to the distant point. We count the number of edges that crosses the line in each direction we add 1 to the winding number every time we intersect a polygon edge that crosses the line from right to lift, and we subtract 1 every line we intersect an edge that crosses from left to right. The final value of the winding number, after all edge crossing have been counted, determines the relative position of p. If the ending number is non zero p is taken to be an exterior point. Recursive boundary fill algorithms may not fill regions correctly if some interior pixels are already displayed in the fill color. This occurs because the algorithm checks next pixels both for boundary color and for fill color. Encountering a pixel with the fill color can cause a recursive branch to terminate leaving other interior pixels unfilled. To avoid this we can first change the color of and interior pixels unfilled. To avoid this we can first change the color of any interior pixels that are initially set to the fill color before applying the boundary fill procedure.  Also since this procedure requires considerable stacking of neighboring points more efficient methods are generally employed. These methods fill horizontal pixel spans across scan lines instead of proceeding to 4 commented or 8 commented neighboring points. Then we need only stack a beginning position for each horizontal pixel span instead of stacking all unprocessed neighboring positions around the current position. Starting from the initial interior point with this method we first fill in the contiguous span of pixels on this starting scan line.

(a) The filled initial pixel span showing the position of the initial point and the stacked positions for pixel spans on adjacent scan lines. (b) Filled pixel scan on the first scan line above the initial scan line and the current contents of the stack. (d) Completed pixel spans for the upper right portion of the defined region and the remaining stacked positions to be processed.  Then we locate and stack starting positions for spans on the adjacent scan lines, where spans are defined as the contiguous horizontal string of positions bounded by pixels displayed in the area border color. At each subsequent step we unstuck the next start position and repeat process. 


Related Discussions:- Odd-even rule and non-zero winding number rule

General perspective transformation with cop at the origin, General Perspect...

General Perspective transformation with COP at the origin Here we suppose the given point P(x,y,z) be projected like P'(x',y',z') on the plane of projection. The center of pro

Explain the advantage and disadvantage of raster crt, Explain the advantage...

Explain the advantage and disadvantage of Raster CRT Advantages Allows solids, not just wireframes Leverages low-cost CRT technology (i.e., TVs) Bright, i.e.

Achieve a perspective projection on the plane of unit cube, Achieve a persp...

Achieve a perspective projection on the z = 0 plane of the unit cube, demonstrated in Figure (l) from the cop at E (0, 0, 10) upon the z-axis. Figure: I 01:  currently c

Quicktime and real video, Quicktime Quicktime is the video format devis...

Quicktime Quicktime is the video format devised through and used through Apple and can be utilized at varying quality and file sizes. This is quite broadly used and has affecte

Translation, Translation, Rotation and Scaling -  output primitives 1. ...

Translation, Rotation and Scaling -  output primitives 1. Two basic approaches used in character generation are - Bitmap method and outline method.  2. All 2D geometric tran

Area-subdivision method, Area-Subdivision method This method is a ty...

Area-Subdivision method This method is a type of an image-space method although uses object-space operations re-ordering or sorting of surfaces as per to depth. Area sub-div

2-d viewing and clipping - raster graphics and clipping, 2-D Viewing and C...

2-D Viewing and Clipping - Raster Graphics and  Clipping In the previous two units of this block, we illustrated the basic elements of computer graphics, that is, the hardware

Determine about the liquid crystal display, Determine about the Liquid Crys...

Determine about the Liquid Crystal Display LCDs are organic molecules, naturally in crystalline state, and they get liquified when excited by heat or E field. Crystalline state

Applications-introduction to computer graphics, Applications Research ...

Applications Research in computer graphics has a wide range of application as well as both photorealistic and non-photorealistic image synthesis, image-based rendering and mod

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