scan conversion n.
Skip this Video
Loading SlideShow in 5 Seconds..
Scan Conversion PowerPoint Presentation
Download Presentation
Scan Conversion

Loading in 2 Seconds...

play fullscreen
1 / 35

Scan Conversion - PowerPoint PPT Presentation

  • Uploaded on

Scan Conversion . Jehee Lee Seoul National University. Attributes of Output Primitives. Handling attribute parameters Passing a list of attributes as a parameter of output primitive functions Eg) X-windows

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Scan Conversion' - katelyn

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
scan conversion

Scan Conversion

Jehee Lee

Seoul National University

attributes of output primitives
Attributes of Output Primitives
  • Handling attribute parameters
    • Passing a list of attributes as a parameter of output primitive functions
      • Eg) X-windows
    • Maintain the “current” values of attributes and provide with a set of function for attribute settings
      • Eg) OpenGL
    • Maintain a scene graph and attribute nodes affects descending primitive nodes
      • Eg) Open Inventor
line attributes
Line Attributes

Butt cap

Round cap

Projecting square cap

Miter join

Round Join

Bevel join

area filling
Area Filling

How can we generate a solid color/patterned polygon area?

how to decide interior parity fill approach
How to decide interior -Parity Fill Approach
  • For each pixel determine if it is inside or outside of a given polygon.
  • Approach
    • from the point being tested cast a ray in an arbitrary direction
    • if the number of crossings is odd then the point is inside
    • if the number of crossings is even then the point is outside
how to decide interior parity fill approach1
How to decide interior -Parity Fill Approach
  • Very fragile algorithm
    • Ray crosses a vertex
    • Ray is coincident with an edge
  • Commonly used in ECAD
  • Suitable for H/W

How to decide interior-Winding Number

A winding number is an attribute of a point with respect to a polygon that tells us how many times the polygon encloses (or wraps around) the point. It is an integer, greater than or equal to 0. Regions of winding number 0 (unenclosed) are obviously outside the polygon, and regions of winding number 1 (simply enclosed) are obviously inside the polygon.

  • Initially 0
  • +1: edge crossing the line from
  • right to left
  • -1: left to right
  • use cross product of line and
  • edge vectors
  • No cross vertices
area filling scan line approach
Area Filling (Scan line Approach)
  • Take advantage of
    • Span coherence: all pixels on a span are set to the same value
    • Scan-line coherence: consecutive scan lines are identical
    • Edge coherence: edges intersected by scan line i are also intersected by scan line i+1
area filling scan line approach1
Area Filling (Scan line Approach)
  • For each scan line

(1) Find intersections (the extrema of spans)

      • Use Bresenham's line-scan algorithm

(2) Sort intersections (increasing x order)

(3) Fill in between pair of intersections

area filling filling methods
Area Filling(Filling Methods)
  • Pixel Adjacency
  • Boundary-Fill Algorithm
    • starting a point inside he figure and painting the interior in a specified color or intensity.



boundary filling1
Boundary Filling
  • Efficiency in space!
    • finish the scan line containing the starting position
    • process all lines below the start line
    • process all lines above the start line
flood filling
Flood Filling

: Start a point inside the figure, replace a specified interior color only.

problems of filling algorithm
Problems of Filling Algorithm
  • What happens if a vertex is shared by more than one polygon, e.g. three triangles?
  • What happens if the polygon intersects itself?
  • What happens for a “sliver”?
  • Solutions?
    • Redefine what it means to be inside of a triangle
    • Different routines for nasty little triangles
aliasing in cg
Aliasing in CG

Which is the better?

aliasing in cg1
Aliasing in CG
  • Digital technology can only approximate analog signals through a process known as sampling
  • The distortion of information due to low-frequency sampling (undersampling)
  • Choosing an appropriate sampling rate depends on data size restraints, need for accuracy, the cost per sample…
  • Errors caused by aliasing are called artefacts. Common aliasing artefacts in computer graphics include jagged profiles, disappearing or improperly rendered fine detail, and disintegrating textures.
the nyquist theorem
The Nyquist Theorem

the sampling rate must be at least twice the frequency of the signal or aliasing occurs

artefacts jagged profiles
Artefacts - Jagged profiles
  • Jagged silhouettes are probably the most familiar effect caused by aliasing.
  • Jaggies are especially noticeable where there is a high contrast between the interior and the exterior of the silhouette
artefacts disintegrating textures
Artefacts - Disintegrating textures
  • The checkers should become smaller as the distance from the viewer increases.
  • Antialiasing methods were developed to combat the effects of aliasing. The two major categories of antialiasing techniques are prefiltering and postfiltering.
  • Before sampling the image, use a low-pass filter to eliminate frequencies above the Nyquist limit
  • This blurs the image, but ensures that no high frequencies will be misrepresented as low frequencies
  • Determines pixel intensity based on the amount that a particular pixel is covered by an object in the scene. Determining such areas requires extensive calculations and integral approximations
catmull s algorithm





Catmull’s Algorithm
  • Find fragment areas
  • Multiply by fragment colors
  • Sum for final pixel color
  • Postfiltering, also known as supersampling
  • For each displayed pixel, a postfiltering method takes several samples from the scene and computes an average of the samples to determine the pixel's color.
  • Doesn’t eliminate aliasing, just shifts the Nyquist limit higher
    • Can’t fix some scenes (e.g., checkerboard)
  • Relatively easy and often works all right in practice
  • Can be added to a standard renderer : A-buffer
  • The two steps in the postfiltering process are:

1. Sample the scene at n times the display resolution.

2. The color of each pixel in the rendered image will be an average of several samples.

  • A filter provides the weights used to compute the average.
sampling in the postfiltering method
Sampling in the Postfiltering method
  • Supersampling from a 4*3 image.
  • Sampling can be done randomly or regularly. The method of perturbing the sample positions is known as "jittering."
nonuniform supersampling
Nonuniform Supersampling

Adaptive Sampling

adaptive sampling

Many more blue samples than white samples

But final pixel actually more white than purple!

Simple filtering will not handle this correctly

Adaptive Sampling

Final Samples