Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Introduction To Computer Graphics: Unit One

Download as pdf or txt
Download as pdf or txt
You are on page 1of 33

INTRODUCTION TO COMPUTER Unit One

GRAPHICS
2019/2020 ACADEMIC YEAR
WHAT IS COMPUTER GRAPHICS?
The algorithms and hardware required to produce realistic and/or
useful images on a computer
Computer graphics is an art of drawing pictures on computer screens
with the help of programming
It involves computations, creation, and manipulation of data
In other words, we can say that computer graphics is a rendering tool
for the generation and manipulation of images

2019/2020 ACADEMIC YEAR


2019/2020 ACADEMIC YEAR
Geometric Representation

Transformation

Scan Conversion

Alias Effect

Anti Aliasing

2019/2020 ACADEMIC YEAR


WHAT IS COMPUTER GRAPHICS?
Projection

Hidden Surface removal

Local Illumination model

Global Illumination model

Surface Texture

Shadow Generation

2019/2020 ACADEMIC YEAR


COMPUTER GRAPHICS PROCESS

2019/2020 ACADEMIC YEAR


APPLICATIONS OF COMPUTER GRAPHICS

Simulation Design Display of Information


Computer Art Entertainment Education and Training


2019/2020 ACADEMIC YEAR
GRAPHS AND CHARTS
Graphs and widely used for visualizing relationships and trends in
scientific, mathematical, financial, economic data, and others
 E.g. FusionChart, Microsoft Excel

2019/2020 ACADEMIC YEAR


COMPUTER-AIDED DESIGN (CAD)
CAD and CADD involve using a computer application to enable
designers to construct and visualize 3-D models
They are commonly used in fields such as architecture, engineering
and circuit design
 Application program example: AutoCAD

Computer-Aided Manufacturing (CAM) is a similar concept to CAD,


except CAM is linked to the manufacturing process
 i.e. the application will directly control, via a hardware communication link, the
machine that manufactures the object being designed

2019/2020 ACADEMIC YEAR


DATA VISUALIZATION
More complex, multidimensional, datasets often are difficult to
visualize without computer graphics
These complex datasets are particularly common in science (scientific
visualization) and business (business visualization)
E.g.1: Three-dimensional medical dataset E.g.2: A medical dataset acquired using a Magnetic
of a patient. Here we use computer Resonance Imaging (MRI) scanner. Computer
graphics to visualize the paths of blood graphics allow us to visualize this three-dimensional
vessels inside the patient’s head dataset as three slices through the 3-D volume

2019/2020 ACADEMIC YEAR


VIRTUAL REALITY AND AUGMENTED
REALITY
Virtual Reality (VR) allows users to be immersed in a computer
generated world, and to interact with it as if they were interacting with
the real world

VR-headset
2019/2020 ACADEMIC YEAR
VIRTUAL REALITY AND AUGMENTED
REALITY
Augmented Reality (AR) combines a computer-generated virtual
world with the real world
In AR, computer-generated images are overlaid onto a user’s view of
the real world
E.g. AR system used for
surgery, in which computer-
generated images of hidden
features such as blood
vessels and tumours are
overlaid on the surgeon’s
view of the patient through
a surgical microscope

2019/2020 ACADEMIC YEAR


EDUCATION AND TRAINING
Computer graphics can be very beneficial in education and training
Graphics are used to help students visualize the appearance and location of
different organs inside the body
Another common application of computer graphics is in training
In many jobs it is difficult for workers to get direct experience of the
environment that they are expected to work in.
This may be because the environment is inaccessible (e.g. space), dangerous
(e.g. bomb disposal), expensive (e.g. flying aircraft) or high-risk (e.g. surgery)
Helicopter simulator Track driving simulator

Anatomy 2019/2020 ACADEMIC YEAR


GRAPHICAL USER INTERFACES
Another possibility that has been opened up by the improvements in
computer graphics technology is in the area of user interfaces
Computer graphics improved visual appeal between an old text-
based user interface and a modern windows-based user interface
Modern user interfaces have made multitasking much easier and
applications such as word-processors have become much more
powerful

2019/2020 ACADEMIC YEAR


ENTERTAINMENT
The applications of computer graphics in entertainment fall into three
categories: computer art, special effects and animations, and games
Computer-generated images (CGI) have been widely used for
producing special effects for films, and also for producing completely
computer-generated films
For computer games, images must be generated in real-time in
response to user actions
Therefore the graphics in games can be less realistic, since the
emphasis is on speed of generation rather than realism

2019/2020 ACADEMIC YEAR


WHAT’S OUR SCOPE?
Not a Tutorial on Commercial Software
 3DMax, Maya, Photoshop, etc.

Not about Graphics Business


 3D online-game, E-commerce, etc.

Graphics = Algorithm for Visual Simulation


 Imaging, Modeling, Rendering, Animation

2019/2020 ACADEMIC YEAR


WHAT’S OUR SCOPE?
Imaging
 Warping, Metamorphosis, Non-Photorealistic Rendering

Modeling
 Surface Modeling, Solid Modeling, Procedure Modeling, Simplification

Rendering
 Polygonal Rendering, Global Rendering, Texture Mapping

Animation
 Keyframe Animation, Inverse Kinematics, Dynamics, Motion Capture

2019/2020 ACADEMIC YEAR


ALLIED GRAPHICAL INFORMATION FIELDS
Image Processing
 Begins with images in the image space
 Performs pixel-based operations on the images
 Produce new image
User Interface
 Computer graphics focus on image production
 Field of user interface concerned on communication
between man and machine
 When this two are joined => Graphical User Interface

2019/2020 ACADEMIC YEAR


IMAGE REPRESENTATION
Image is composed of discrete pixel or picture elements
The pixels arranged in row and column to form a rectangular picture
area(raster)
Image resolution: number of pixels per unit length
If we want resize a 1024X768 image to one
Total number of pixel: (w*r)*(h*r) that is 640 pixels wide with the same aspect
 E.g. image:3X2 inches, Resolution 300 ratio, what would be the height of the resized
image?
Size given in pixels vertically and horizontally, easy but:
 Difficult to tell the size in units
If we want to cut 512X512 sub-image out
 Don’t specify image resolution from the center of an 800X600 image, what
Aspect Ratio: Width/height are the coordinates of the pixel in the large
Image pixel reference: e.g. 640X480 image that is at the lower left of the small
• lower left (0,0) , lower right (639, 0), upperimage?
left (0, 479) and upper right (639, 479)
2019/2020 ACADEMIC YEAR
THE RGB COLOR MODEL
Color coordinate system with three primary colors:
 R(red), G(green), and B(blue)

 Each primary color can take on an intensity value ranging from 0 (0ff-lowest) to 1(on-
highest).
2019/2020 ACADEMIC YEAR
THE RGB COLOR MODEL
Color matching using the RGB model is additive
 Closely matches with the working principles of display monitors

The CMY color model


 Defines color using subtractive process
 This closely matches with the working principles of printer

2019/2020 ACADEMIC YEAR


CONVERSION BETWEEN RGB & CMY
E.g. find the CMY coordinates of a
color at (0.15, 0.3, 1) in the RGB
space

2019/2020 ACADEMIC YEAR


DIRECT CODING
Image representation is essentially the representation of pixel colors
 E.g. 3bits representation

Bit 1 R Bit 2 G Bit 3 B Color


0 0 0 Black
0 0 1 Blue
0 1 0 Green
0 1 1 Cyan
1 0 0 Red
1 0 1 Magenta
1 1 0 Yellow
1 1 1 White
2019/2020 ACADEMIC YEAR
DIRECT CODING
The widely accepted standard: 3byte/24bits
 256 different intensity levels (00000000-11111111)
 256*256*256 or 16.7M color choices per pixel
 Simple way of representation but high demand for space

 E.g. image 1000X1000 requires 3 million bytes

2019/2020 ACADEMIC YEAR


LOOKUP TABLE
Images pixel values don’t code colors directly
They hold addresses or indices into a table of color values

2019/2020 ACADEMIC YEAR


DISPLAY MONITOR
Convert digitally represented image into visually perceivable pictures
Anatomy of monochromatic CRT

2019/2020 ACADEMIC YEAR


DISPLAY MONITOR
Fluorescence: the light given off by the phosphor during exposure to
the electron beam
Phosphorescence: the continuing glow given off after the beam is
removed
Phosphor’s persistence: the duration of phosphorescence
The intensity of the beam at a particular pixel position is determined
by the intensity value of the corresponding pixel in the image being
displayed
Frame buffer/Refresh buffer: a system memory area to store the
image to be displayed
Refreshing Rate: the frequency at which the content of the frame
buffer is sent to the display monitor
 60 frames per second (60Hz) or higher

Interlacing: half of the scan line are refreshed at a time 2019/2020 ACADEMIC YEAR
COLOR DISPLAY
Three electron guns instead of one, one for each primary color
The screen coat consist dot patterns of three different types of
phosphors

2019/2020 ACADEMIC YEAR


PRINTER
A printer deposit color pigments onto a printer media, changing the
light reflected from its surface and making it possible for us to see the
print result
In principle utilize three types of pigments(cyan, magenta, and yellow)
to regulate the amount of red, green and blue light reflected to yield
all RGB colors
In practice additional black pigment is often used due to the relatively
high cost of color pigments and technical difficulty associated with
producing high quality black from several color pigments
 Half toning
 Dithering

2019/2020 ACADEMIC YEAR


IMAGE FILES
A digital image is often encoded in the form of a binary file
• Windows Bitmap (BMP)
• Joint Photographic Experts Group Format/version identification
File Interchange Format (JPEG) Image width and height in pixels
Header
• Tagged Image File Format (TIFF) Image type
Image data format
Organization of information Compression type
etc.
Encoded in an image file consists
largely of two parts: Color map (if any)
• Header Pixel values Image data
• Image data
Compression type Reconstruct the string
e.g. Run Length Encoding (RLE)
“uuuutttttpppppp” => “4u5t6p” that has been compressed
to “981435” using RLE 2019/2020 ACADEMIC YEAR
SETTING THE COLOR ATTRIBUTES OF
PIXELS
Three element array is often used to represent the three primary color
components
Two possible protocols for the specification of pixel coordinates and
color values:
Protocol one: both coordinate and color information is given
simultaneously
 setPixel(x, y, rgb)
 Where: rgb is three element array
 rgb[0] = r
 rgb[1] = g
 rgb[2] = b
 setPixel(x, y, i) => if the image uses lookup table
 Where i is the address of the entry containing rgb

2019/2020 ACADEMIC YEAR


SETTING THE COLOR ATTRIBUTES OF
PIXELS
Protocol two: based on the existence of current color, maintained by
the system
 setColor(rgb)
 setColor(i) => if the image uses lookup table
 setPixel(x, y)

Lookup table entry


 Set color: setEntry(i, rgb)
 Read color: getEntry(I, rgb)

Additional pixel based image processing operations


 getPixel(x,y, rgb)
 getPixel(x,y, i)

2019/2020 ACADEMIC YEAR


SETTING THE COLOR ATTRIBUTES OF
PIXELS
Reading Assignment
 Mandelbrot Set
 Julia Set

Exercise - Write a pseudo-code segment to:


 Initialize a 24-bit 256-entry lookup table with gray-scale values
 Swap the red and green components of all colors in a 256 entry lookup table
 Draw a rectangular area of wXh pixels that starts at (x, y) using color rgb

2019/2020 ACADEMIC YEAR

You might also like