Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
558 views

Computer Graphics Moving Boat in River

This document discusses a computer graphics micro-project on simulating a moving boat in a river. It describes the rationale and aims of the project, which are to effectively display art and image data using computer graphics. It also covers the core concepts achieved, like modeling and transformations in 2D and 3D. The methodology section explains that computer graphics relies on geometry, optics, physics and perception. It renders graphics by processing data on displays driven by computer graphics hardware.

Uploaded by

khalique demon
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
558 views

Computer Graphics Moving Boat in River

This document discusses a computer graphics micro-project on simulating a moving boat in a river. It describes the rationale and aims of the project, which are to effectively display art and image data using computer graphics. It also covers the core concepts achieved, like modeling and transformations in 2D and 3D. The methodology section explains that computer graphics relies on geometry, optics, physics and perception. It renders graphics by processing data on displays driven by computer graphics hardware.

Uploaded by

khalique demon
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 32

Computer Graphics

Annexure -II

Micro-Project Report

Moving Boat In River

1.0 Rationale
The purpose of the project entitled as “Moving boat in River” Computer graphics is
responsible for displaying art and image data effectively and meaningfully to the consumer. It is
also used for processing image data received from the physical world, such as photo and video
content.

2.0 Aims/Benefits of the Micro-Project


Transform information into creative, conceptually appropriate design solutions using
industry-standard production software and hardware. Develop a personal, research-based design
process that applies graphic design theory in the creation of aesthetically pleasing artifacts Evaluate
design projects by articulating concepts in verbal, visual, and written forms. Prepare a portfolio of
work that clearly demonstrates effectiveness as a visual communicator.

3.0 Course Outcomes Achieved


The core concepts of computer graphics, including viewing, projection, perspective,
modelling and transformation in two and three dimensions. apply the concepts of colour models,
lighting and shading models, textures, ray tracing, hidden surface elimination, anti-aliasing, and
rendering. Today, computer graphics is a core technology in digital photography, film, video
games, cell phone and computer displays, and many specialized applications. A great deal of
specialized hardware and software has been developed, with the displays of most devices being
driven by computer graphics hardware.

4.0 Actual Methodology Followed


The overall methodology depends heavily on the underlying sciences of geometry, optics,
physics, and perception. Computer graphics is responsible for displaying art and image data
effectively and meaningfully to the consumer. The design of proposed graphics standards is based
on a methodology developed some years ago. Technical reviews of these proposals have
illuminated some aspects of this methodology, and on this basis alternatives can be explored. One
alternative methodology is proposed, and its advantages explored by means of a simple graphics
system.

JCEI’s Jaihind Polytechnic Kuran Page 1


Computer Graphics

4.1. Brief Information

Computer graphics deals with generating images with the aid of computers. Today,
computer graphics is a core technology in digital photography, film, video games, cell phone and
computer displays, and many specialized applications. A great deal of specialized hardware and
software has been developed, with the displays of most devices being driven by computer graphics
hardware. It is a vast and recently developed area of computer science. The phrase was coined in
1960 by computer graphics researchers Verne Hudson and William Fetter of Boeing. It is often
abbreviated as CG, or typically in the context of film as computer generated imagery (CGI). The
non-artistic aspects of computer graphics are the subject of computer science research.[1]

Some topics in computer graphics include user interface design, sprite graphics, rendering, ray


tracing, geometry processing, computer animation, vector graphics, 3D
modeling, shaders, GPU design, implicit surface visualization, image processing, computational
photography, scientific visualization, computational geometry and computer vision, among others.
The overall methodology depends heavily on the underlying sciences of geometry, optics, physics,
and perception.

Computer graphics is responsible for displaying art and image data effectively and meaningfully to
the consumer. It is also used for processing image data received from the physical world, such as
photo and video content. Computer graphics development has had a significant impact on many
types of media and has revolutionized animation, movies, advertising, video games, in general.

The term computer graphics has been used in a broad sense to describe "almost everything on
computers that is not text or sound". Typically, the term computer graphics refers to several
different things:

the representation and manipulation of image data by a computer

the various technologies used to create and manipulate images

methods for digitally synthesizing and manipulating visual content, see study of computer graphics

Today, computer graphics is widespread. Such imagery is found in and on television, newspapers,
weather reports, and in a variety of medical investigations and surgical procedures. A well-
constructed graph can present complex statistics in a form that is easier to understand and interpret.
In the media "such graphs are used to illustrate papers, reports, theses", and other presentation
material.

JCEI’s Jaihind Polytechnic Kuran Page 2


Computer Graphics

Many tools have been developed to visualize data. Computer-generated imagery can be categorized
into several different types: two dimensional (2D), three dimensional (3D), and animated graphics.
As technology has improved, 3D computer graphics have become more common, but 2D computer
graphics are still widely used. Computer graphics has emerged as a sub-field of computer
science which studies methods for digitally synthesizing and manipulating visual content. Over the
past decade, other specialized fields have been developed like information visualization,
and scientific visualization more concerned with "the visualization of three dimensional phenomena
(architectural, meteorological, medical, biological, etc.), where the emphasis is on realistic
renderings of volumes, surfaces, illumination sources, and so forth, perhaps with a dynamic (time)
component".

5.0 Actual Resources Used

The computer graphics technology is introduced into the resource management in this
chapter. Because the resource management involves a very wide range, this subject takes the
communication resource management as an example to elaborate this technology. Communication
resource management has always been known for a wide range of equipment. A large number of
equipment bring a large degree of inconvenience for the manager. The room equipment in
communication resource management using computer graphics display is applied to solve this
problem. And it has a wide range of representations in resource management, and fully embodies
the advantages of graphics technology in resource management [3]. Communication Resource
Management Nowadays, with the rapid development of information, the resources management in
communication has become particularly important. The concept of communication resource
management is huge and covers a wide range. It mainly refers to the three major parts of the data
entities in transmission, including transmission room, wiring room and outside line. However, the
communication resource management system really is a typical complex project, and the system
data types are also complex. The kind of system data involves a wide range, including
communication, database, GIS, network and other technical fields. The implementation of
communication resource management system, especially the application of computer graphics
technology in communication resource management system solves the difficulties of
communication station equipment maintenance and duty management caused by the increase of
communication traffic. This application also reduces the management difficulty and strength in
system resources, and improve the efficiency of the staff on duty [4]. Based on this technology, the
department staffs achieve the management on paperless office, digital and graphical management,
which meets the requirements from communication users for the communication resource
management system.

JCEI’s Jaihind Polytechnic Kuran Page 3


Computer Graphics

6.0 The Needs for Computer Graphics

Scope of Applications

Computer Graphics appear in nearly every field where computers are used. Let us mention:

 mathematics (numerical analysis, operations research)


 medicine (cardiovascular transport phenomena analysis, electro-encephalogram analysis in real
time)
 architecture (plan layout, building design)
 text processing (magazine page layout, on-line text editing)
 civil engineering {highway design, structural design, soil engineering analysis and design)
 art (pictorial art, fashion design, choreography)
 cartography (thematic mapping, automatic map digitization geo data analysis)
 mechanics {numerical control, automated drafting, mechanical design)
 electronic design (circuit design and layout)
 animation (educational films, simulation)
 chemistry {protein structure research, X-ray crystallography analysis, chemical documentation)
 computer aided instruction
 process control
 management information systems and so on...

It can be noted that:

 Image processing is generally considered outside of Computer Graphics. However, we would like
to consider image processing as a possible tool for Computer Graphics.
 Most important developments have been initiated by specific user's needs, for instance
mathematical representation of surfaces, 3-D manipulations.
 Applications may have an important influence on future graphic hardware and software design.

Classification of Graphical Requirements

An attempt is made to classify graphical requirements independently from application areas,


corresponding to the functions which should be available. This attempt should clarify ideas about
and lead to the emergence of prominent points for future developments and research in Computer
Graphics.

 2-Dimensional graphics

JCEI’s Jaihind Polytechnic Kuran Page 4


Computer Graphics

 different aspects: line drawings, diagrams, line drawings plus colouring of grey panels (advertising,
cartography), images
 image support: film, paper, engravings, microfilm
 input: by program, standard terminal {keyboard, cards...}, specific input device, digitization of
drawings and processing of images
 significance: schematic (data presented in a conventional way, data presentation techniques must be
carefully studied according to applications), realistic.
 3-Dimensional graphics
 virtual 3-D, that is presentation in 2-D, stereoscopic effects, perspective transformations, hidden-
lines elimination, surface illumination, holography
 real 3-D: by fast machining in different materials
 input: same as mentioned previously, but here we have a very important research field, related to
image processing (feature extraction, reconstruction from projections etc...).

Computer Animation

Computer animation is the production of sequences of pictures with time constraints. We find the
same characteristics as in 1.2.1., plus picture dynamics:

 continuous or discrete modifications of the pictures


 the rate of modification (time is a parameter)
 use of real time or simulated time
 use of specific techniques to reduce computation time (i.e. interpolation or approximation versus
exact computation).

Computer animation will become a very important field of application; and so major efforts have to
be made in this direction, starting with understanding what tools are needed.

Graphics as an Aid to Computation

We consider here applications where the picture is a support for man-machine communication. The
picture is then a suitable representation of the data to be handled and processed, as for instance in
Computer Aided Design or Computer Aided Instruction.

Apart from characteristics of 1.2.1., it is necessary to add:

 linkage to the data structure, to events (for process control), to programs. This linkage can be
defined by program control, interactively or automatically.
 man-machine graphical communication, or iconic communication.

JCEI’s Jaihind Polytechnic Kuran Page 5


Computer Graphics

The User's Point of View

We try to show here the main problems in graphics to which the user will have to pay attention
when implementing application programs. The different points involving software and hardware
will be discussed in the next chapters.

Ergonomics:
How to define the device which is best fitted to a given task?
What should be the possible variations of a given device with respect to a particular application and
user (brightness, contrast, colours, adaptability of input devices...)?
Portability:
Ability to use many different graphic devices with the same computer system or to transport
programs to different configurations: how to define the interfaces? Are there interfaces to be
defined?
Cost/benefit analysis:
Especially the balance between hardware and software, the criteria for choosing the appropriate
hardware and software.
Software:
What kind of software? (high level, low level)
General graphic systems versus specific application systems?
Influence of the programming language?

These different points will be studied in the next chapters.

Hardware

A graphical communication system may be divided into four components:

 the drawing device,


 the graphic processor,
 the connected computer,
 the input devices.

The Drawing Device

The drawing device is the physical means which permits display of a picture. Different technologies
are in use or may be developed, leading to devices whose performances are difficult to compare.
However, some criteria can be used:

 size of the display surface,

JCEI’s Jaihind Polytechnic Kuran Page 6


Computer Graphics

 resolution of drawing,
 brightness,
 colour ,
 line drawings versus surface painting,
 ease of picture modification {addition, erasure, selective era sure, creation) ,
 speed of modification or of displaying a new drawing.

The choice of a drawing device for a given application implies a trade-off between mainly
incompatible characteristics. A careful investigation of the adequacy of drawing devices to different
domains of application should be very useful and will point to deficiencies in the present
technology: the combination of characteristics needed for some applications cannot be obtained, or
if obtained at all, not at a reasonable cost (for example, large size frames plus instant regeneration).

The Graphic Processor

The graphic processor is the device which decodes and executes instructions, in order to produce a
picture using the drawing device. Fundamental characteristics are:

 the set of instructions,


 the hardware structure,
 access to display file,
 local interactive facilities (text or image editing, image transformation and presentation) see 2.4.

The Set of Instructions

Generally, three kinds of instructions are found:

 graphic instructions, for producing the picture.


 control instructions, for the management and structuring of the display file,
 communication instructions, in order to exchange information between the graphic processor and
the computer.
 New technologies will have more functions performed by hardware. Which functions are essential,
which are not?

 A standard set should be defined as a collection of subsets, some being optional. The set of
instructions of a given processor should be the union of some of these subsets, i.e. a subset must
exist entirely or not at all {for example: the set of geometric transformations in 2-D, or 3-D).
 Where and at which level should standards for control instructions be defined? This is not quite
clear now.

JCEI’s Jaihind Polytechnic Kuran Page 7


Computer Graphics

The Hardware Structure

A graphic processor consists of different components (generators, decoders, digital-analog


converters, etc...) which are linked together. The problem of the relationships between components
is the same as in computer architecture, with no specific complexity. However, it is very important
to discuss the impact of new trends in computer hardware such as the use of microprocessors, and
to investigate the possible modular structure of graphic processors.

Access to Display Files

The location of the display file has a strong influence on the performance of a graphic system:

 sharing of the computer's memory


 buffer memory
 use of disks or tapes

Crucial points are

 how fast can exchanges be done?


 how can the display file be managed?
 what is the impact of the memory size?

Connection to a Computer

A graphic device can be used:

 off-line: the graphic processor is running independently from the computer and uses pre-established
files to produce pictures (plotters, drafting machines)
 on-line: the graphic device is connected to a computer. Three working modes exist:
 stand alone the graphic application is running on a single, usually small, computer
 transparent the graphic application is running on a main computer, generally time-shared; messages
are exchanged through a satellite computer, which only ensures the connection between the main
computer and the graphic device
 intelligent terminal: part of the application program is running on the main computer, part on the
satellite.

 how to connect processors (phone line, direct access...)


 what should be the respective levels of the jobs performed by the processor and the computer and
correspondingly what kind of messages should be exchanged between them.

JCEI’s Jaihind Polytechnic Kuran Page 8


Computer Graphics

Input Devices and Local Interactive Facilities

A graphical application's program can be used more or less interactively, and with or without
graphical input (drawings, etc.). We only want to consider facilities which make graphical input and
interaction possible or easier. Two types of devices are needed:

 non-graphical input devices, such as keyboards, switches..., which can be integrated in the graphic
terminal,
 graphical input devices such as light-pen, digitizers... which enable one to input graphical data
directly.

The ergonomics of input devices and of complex terminals {several input devices plus display and
processor) should be carefully studied. From the hardware point of view, significant progress will
be made with devices designed to collect 3-dimensional information, probably using image
processing techniques, or dynamic graphical data (digital high-speed camera).

The use of these facilities leads to different types of graphic systems.

 non-interactive
 non-graphic interaction: graphical output with non-graphic interaction facilities (keyboard,
switches...)
 local interactive facilities: non-graphical input to computer, but possibilities offered by the graphic
processor to select or adapt the drawing according to the user's wishes (tracking, loop, perspective,
rotation, colour, brightness, contrast,...). The definition of these local facilities in hardware has to be
investigated with respect to the graphic terminal and the application.
 interactive graphics: previous possibilities plus graphical input used either to enter graphical data or
to define an interaction (pointing for instance). The control of the input devices can be made partly
by the graphic processor, using occasionally local interactive facilities. Two questions should be
answered: which functions (text editing, light-pen tracking, stack control for recovery of pointing
data...) should be implemented by hardware or microprogramming in the graphic processor, and
how to communicate with the main computer (graphical input and device control)?

The influence of display characteristics on interaction capabilities should be noticed, as, for
instance, the effect of picture regeneration or modification speed on response time. In fact, the main
part of this response time is frequently the calculation time used by a program, so that the
performance of interactive facilities must be carefully chosen according to the type of application.

JCEI’s Jaihind Polytechnic Kuran Page 9


Computer Graphics

Finally, there should be some investigation into the response time acceptable to the user, depending
on his reasonable wishes and on the apparent complexity of the task performed or the benefits from
it.

7.0 Software

Three kinds of people are concerned with graphic software

 program users,
 application program writers,
 graphic systems designers.

This division may appear in some cases rather artificial, but we think it is a good starting point to
study graphic software problems. We shall begin here again with the user's point of view and finish
with the system designer, whose task is to satisfy the previous ones.

Using a Graphical Application Program

A graphical application program is a program using graphic hardware. When running such a
program, information is handled by means of graphical communication. The dialogue with the
computer is achieved by using a set of commands, which are performed through communication
devices. Programs are mostly to be used by people who are not computer scientists, so technical
problems must be as transparent as possible. Problems linked to that point of view could be:

 ease of using the program: how can the user be helped during the dialogue, what kind of error
handling is to be proposed?
 adaptative dialogue: would it be possible to have programs which 'learn' how the user wishes to
operate, in order to facilitate the communication process?
 graphical communication: what are the laws of iconic communication? How can we handle the data
input by means of drawing?
 portability: what is the influence of the hardware on the program's performance? Can we change an
input device without modifying the program?
 semantics: how can we define precisely the effect of a program, and consequently its domain of
application? What kind of flexibility is to be allowed?

Writing Graphical Application Programs

When specifying and writing an application program, the programmer will have to define the
functional specifications of his program, taking into account the points developed in Sec. 3.1., then
he will implement it using some programming language. We define a graphic language as any set of

JCEI’s Jaihind Polytechnic Kuran Page 10


Computer Graphics

graphic programming facilities (set of subroutines, specific language...) offered to the application
programmer to write programs.

8.0. Characteristics of Graphic Languages

Semantics

Under this ambitious word, we will only try to define those functions which should be offered in a
graphic language. Some of these, usually low level functions, can be directly realized by the graphic
processor, so that we find here the same problems as in Sec. 2.2.1. We will not discuss them again.

A graphic language is usually composed of interactive graphic primitives and of tools to combine


them into more complex graphic functions. The set of possible primitives is nearly unlimited; it
depends on the specific facilities offered by each graphic terminal.

Nevertheless, there should be some basic and standard set of primitives available on each graphic
system and rules to create and use new primitives. Among these rules there should be a precise way
of defining the semantics of a given primitive, which could be done, for instance, using only the
basic set of primitives. A careful study should be made as to whether such a universal set exists. If
it does, it would ensure the portability of programs as any primitive non-realizable by hardware on
a certain configuration would then be realizable by software. This implies of course the portability
of the non-graphic part of the program. Also the set of primitives should be independent of the
programming language for obvious practical reasons. On the other hand, the facilities offered to
combine them (possibilities to define procedures, functions, subroutines, for instance) are by nature
dependent upon the programming language.

These facilities concur to what can be called the extensibility of the graphic language. The object is
indeed to extend the possibilities of a given set of primitives, by combining them with other graphic
primitives and with functions offered by the programming language (association of a data base with
drawings for instance). There are two problems:

 find a good programming language for a given application, which is not just a graphics problem,
 make sure that the programming language allows the handling without restriction (like type or
number of arguments) of the given primitives and permits the expected types of extensions.

Syntax

There are two types of problems to be considered here, the syntax of graphic functions or
primitives, and the influence of the syntax of the programming languages.

The syntax of the graphic primitives should be as simple as possible in order that it maps easily
onto most programming languages.

JCEI’s Jaihind Polytechnic Kuran Page 11


Computer Graphics

The second problem is whether the same set of primitives can be utilized with different
programming languages such as FORTRAN, LISP, APL, BASIC, Assembly languages, PL1, etc. A
complete compatibility does not seem possible, but we can hope that for most programming
languages, we will only need to make minor changes in the formal presentation of the primitives.

These syntactic problems are mainly conditioned by the implementation and compilation
techniques in use:

 what will be the influence of new compilation techniques (extensible languages, very high level
languages)?
 can we evaluate the cost of different implementation techniques such as the use of a package of
subroutines, the use of a preprocessor to allow new syntactic items, modifying a compiler, or
defining a completely new language?

These considerations could lead to the definition of standards adapted to classes of programming
languages.

Programming

The problems here are both practical and theoretical; neitheraspect seems to have been touched so
far.

First, the theory of graphical programming. There has been much effort recently on programming
theory. It should be possible to find similar results for graphical and interactive programming,
mainly in the fields of:

 formalization of programs,
 program semantics,
 proofs of programs (correctness, equivalence of programs...),
 complexity of programs and algorithms.

Such results condition the practical aspects of graphical programming, the art of graphical
programming and programming facilities. For the first point, we should look for rules similar, for
example, to the rules of structured programming, which would make programs easily
understandable and would facilitate documentation, proof and modification.

Programming facilities consist mainly of documentation, testing and debugging facilities which are
presently lacking. Graphical and interactive programming is one of the most promising research
fields in Computer Graphics and should condition largely its future developments.

JCEI’s Jaihind Polytechnic Kuran Page 12


Computer Graphics

Graphical Methods and Algorithms

We treat algorithms separately from application programs and graphic systems as it is clear that
graphics needs an enormous amount of specific algorithms which are mostly independent from
application programs and systems. A great effort has to be made to develop them.

Producing Pictures

We need algorithms in all the fields considered in this paper: geometric drawings, cartography,
graphs, mechanical drafting, 3-D presentations, real time, animation, and so on... We must add
some non-graphic algorithms which are frequently necessary, like mathematics for graphics
(interpolation and smoothing techniques, surface representation...).

These algorithms should be device independent, but we cannot skip the fact that in some cases, the
use of particular features of a given class of devices can lead to much more efficient algorithms, as
for instance with hidden-line elimination {Loutrel versus Watkins or Newell-Sancha).

The theoretical foundations of graphic information strongly influence the syntax and semantics of


graphic languages. How can a picture be described and structured? We should investigate the
possibilities of grammars, for both images and drawings. The classical tree structure of pictures is
not appropriate to many cases. A good understanding of these theoretical problems should lead to
simple definitions of pictures and to the possibility of quick local modifications.

Interactive Techniques

The most promising research field should be the use of artificial intelligence techniques for
graphical input and interaction:

 image analysis, text analysis, symbol (or character) recognizers, in order to give very flexible input
techniques,
 input of 3-D coordinates, by using image reconstruction from its projections,
 learning methods for the production of good drawings from indications, by the user and for the
interpretation of his input.

JCEI’s Jaihind Polytechnic Kuran Page 13


Computer Graphics

9.0 Geometrical Image & Manipulate visual


Based on the complementary sets of characteristics associated with 3-D texture-mapped and
image-based models, we can imagine using a continuum of representations to represent a scene.
Each representation would be designed to optimize compactness, speed, and visual fidelity; it could
change spatially within the same scene. One such range of representations is shown in Figure 5. As
can be seen, at the physically-based end of the spectrum, we have the usual single texture-mapped
geometry. Along the way, we have variations of geometry models, followed by increasingly image-
intensive representations. Note also that the dominant means of rendering changes from the
conventional graphics pipeline to warping to interpolation, suggesting that an optimized renderer
needs a different specialized hardware to handle these different modes of rendering. An interesting
set of representations that we think is a good bridge from the use of pure geometry to pure images
has a view-dependent geometry [17] component. We feel that view-dependent geometry is
necessary because stereo algorithms are often prone to errors. In areas where stereo data is
inaccurate, we may well represent these areas with view-dependent geometry, which comprises a
set of geometry extracted at various positions. For a geometry at 3 particular viewpoint, despite
faulty stereo reconstruction, it is expected that the reconstructed view would still be acceptable for
minor virtual camera perturbations. View dependent geometry may also be used to capture visual
effects such as highlights and transparency, where a single geometric representation will fail.
[Anandan: your comments on this?] The range of representations to be used for a scene could be
determined on a per application basis, i.e., depending on the speed requirement and bandwidth
constraint. One possible approach would be to start from the most geometric representation and
progressively move to a more and more image-based representation (Figure 5) based on how well
the reconstructed view match the expected view, subject to a predefined threshold. The error metric
used could be a perceptually-based one as described in [19]. For example, we would expect a blank
textureless wall to be represented simply by a plane with possibly view-dependent texture. On the
other hand, a plant may be represented by view-dependent geometry with view-dependent texture
or a Lumigraph, depending on the desired quality.

JCEI’s Jaihind Polytechnic Kuran Page 14


Computer Graphics

The Computer Graphics and Visualization group consists of researchers in image processing,
computer graphics, visualization, visual analytics, GPU programming, simulation, and geometry
processing. The primary goals of this group are the analysis, synthesis, understanding, and
manipulation of visual data such as images, video sequences, and 3D geometric content.

Application areas span a broad range from art entertainment, to science and engineering, and to
biology and medicine. The group is actively engaged in image and video editing and enhancement,
special effects, 3D interactive content generation, pattern recognition and object recognition. This
research cluster includes the researchers from the Graphics & Image Technologies Laboratory as
well as overlapping with researchers in the Data Science, Theoretical Computer Science, and
Artificial Intelligence groups.

Sub Areas

 Rendering

 Geometry Modeling

 Animation and Simulation

 GPU Programming

 Scientific Visualization

 Information Visualization

 Virtual Reality

Computer Vision

Computer vision is concerned with modeling and replicating human vision using computer
software and hardware. Formally if we define computer vision then its definition would be that
computer vision is a discipline that studies how to reconstruct, interrupt and understand a 3d scene
from its 2d images in terms of the properties of the structure present in scene.

It needs knowledge from the following fields in order to understand and stimulate the operation of
human vision system.

 Computer Science

 Electrical Engineering

 Mathematics

 Physiology

 Biology

JCEI’s Jaihind Polytechnic Kuran Page 15


Computer Graphics

 Cognitive Science

Computer Vision Hierarchy

Computer vision is divided into three basic categories that are as following:

Low-level vision: includes process image for feature extraction.

Intermediate-level vision: includes object recognition and 3D scene Interpretation

High-level vision: includes conceptual description of a scene like activity, intention and behavior.

Related Fields

Computer Vision overlaps significantly with the following fields:

Image Processing: it focuses on image manipulation.

Pattern Recognition: it studies various techniques to classify patterns.

Photogrammetry: it is concerned with obtaining accurate measurements from images.

Computer Vision Vs Image Processing

Image processing studies image to image transformation. The input and output of image
processing are both images.

Computer vision is the construction of explicit, meaningful descriptions of physical objects from
their image. The output of computer vision is a description or an interpretation of structures in 3D
scene.

Example Applications

 Robotics

 Medicine

 Security

 Transportation

 Industrial Automation

Robotics Application

 Localization-determine robot location automatically

 Navigation

JCEI’s Jaihind Polytechnic Kuran Page 16


Computer Graphics

 Obstacles avoidance

 Assembly (peg-in-hole, welding, painting)

 Manipulation (e.g. PUMA robot manipulator)

 Human Robot Interaction (HRI): Intelligent robotics to interact with and serve people

Medicine Application

 Classification and detection (e.g. lesion or cells classification and tumor detection)

 2D/3D segmentation

 3D human organ reconstruction (MRI or ultrasound)

 Vision-guided robotics surgery

Industrial Automation Application

 Industrial inspection (defect detection)

 Assembly

 Barcode and package label reading

 Object sorting

 Document understanding (e.g. OCR)

Security Application

 Biometrics (iris, finger print, face recognition)

 Surveillance-detecting certain suspicious activities or behaviors

Transportation Applicationb

 Autonomous vehicle

 Safety, e.g., driver vigilance monitoring

Computer Graphics

Computer graphics are graphics created using computers and the representation of image data by a
computer specifically with help from specialized graphic hardware and software. Formally we can
say that Computer graphics is creation, manipulation and storage of geometric objects (modeling)
and their images (Rendering). The field of computer graphics developed with the emergence of
computer graphics hardware. Today computer graphics is use in almost every field. Many
powerful tools have been developed to visualize data. Computer graphics field become more

JCEI’s Jaihind Polytechnic Kuran Page 17


Computer Graphics

popular when companies started using it in video games. Today it is a multibillion dollar industry
and main driving force behind the computer graphics development. Some common applications
areas are as following:

 Computer Aided Design (CAD)

 Presentation Graphics

 3d Animation

 Education and training

 Graphical User Interfaces

Computer Aided Design

 Used in design of buildings, automobiles, aircraft and many other product

 Use to make virtual reality system.

Presentation Graphics

 Commonly used to summarize financial, statistical data

 Use to generate slides

3d Animation

 Used heavily in the movie industry by companies such as Pixar, DresmsWorks

 To add special effects in games and movies.

Education and training

 Computer generated models of physical systems

 Medical Visualization

 3D MRI

 Dental and bone scans

 Stimulators for training of pilots etc.

Graphical User Interfaces

 It is used to make graphical user interfaces objects like buttons, icons and other components

JCEI’s Jaihind Polytechnic Kuran Page 18


Computer Graphics

9.0 Implement standard algorithms to draw various graphics objectives using programme

Program to find line passing through 2 Points

 Let the given two points be P(x1, y1) and Q(x2, y2). Now, we find the equation of line
formed by these points.
Any line can be represented as, 
ax + by = c 
Let the two points satisfy the given line. So, we have, 
ax1 + by1 = c 
ax2 + by2 = c 
We can set the following values so that all the equations hold true, 
 
 a = y2 - y1
 b = x1 - x2
 c = ax1 + by1
 These can be derived by first getting the slope directly and then finding the intercept of the
line.

OR these can also be derived cleverly by a simple observation as under:

Derivation : 
 ax1 + by1 = c ...(i)
 ax2 + by2 = c ...(ii)
 Equating (i) and (ii),
 ax1 + by1 = ax2 + by2
 => a(x1 - x2) = b(y2 - y1)
 Thus, for equating LHS and RHS, we can simply have,
 a = (y2 - y1)
 AND
 b = (x1 - x2)
 so that we have,
 (y2 - y1)(x1 - x2) = (x1 - x2)(y2 - y1)
 AND
 Putting these values in (i), we get,
 c = ax1 + by1

JCEI’s Jaihind Polytechnic Kuran Page 19


Computer Graphics

Mid-Point Circle Drawing Algorithm


The mid-point circle drawing algorithm is an algorithm used to determine the points needed for
rasterizing a circle.
We use the mid-point algorithm to calculate all the perimeter points of the circle in the first
octant and then print them along with their mirror points in the other octants. This will work
because a circle is symmetric about it’s centre.

The algorithm is very similar to the Mid-Point Line Generation Algorithm. Here, only the boundary
condition is different.
For any given pixel (x, y), the next pixel to be plotted is either (x, y+1) or (x-1, y+1). This can be
decided by following the steps below.

Find the mid-point p of the two possible pixels i.e (x-0.5, y+1)
1. If p lies inside or on the circle perimeter, we plot the pixel (x, y+1), otherwise if it’s outside we
plot the pixel (x-1, y+1)
Boundary Condition : Whether the mid-point lies inside or outside the circle can be decided by
using the formula:-
Given a circle centered at (0,0) and radius r and a point p(x,y)
F(p) = x2 + y2 – r2
if F(p)<0, the point is inside the circle

JCEI’s Jaihind Polytechnic Kuran Page 20


Computer Graphics

F(p)=0, the point is on the perimeter

F(p)>0, the point is outside the circle

In our program we denote F(p) with P. The value of P is calculated at the mid-point of the two
contending pixels i.e. (x-0.5, y+1). Each pixel is described with a subscript k.

Pk = (Xk — 0.5)2 + (yk + 1)2 – r2


Now,
xk+1 = xk or xk-1 , yk+1= yk +1
∴ Pk+1 = (xk+1 – 0.5)2 + (yk+1 +1)2 – r2
= (xk+1 – 0.5)2 + [(yk +1) + 1]2 – r2
= (xk+1 – 0.5)2 + (yk +1)2 + 2(yk + 1) + 1 – r2
= (xk+1 – 0.5)2 + [ – (xk – 0.5)2 +(xk – 0.5)2 ] + (yk + 1)2 – r2 + (yk + 1) + 1

= Pk + (xk+1 – 0.5)2 – (xk – 0.5)2 + 2(yk + 1) + 1


= Pk + (x2k+1 – x2k)2 + (xk+1 – xk)2 + 2(yk + 1) + 1
= Pk + 2(yk +1) + 1, when Pk <=0 i.e the midpoint is inside the circle
(xk+1 = xk)
Pk + 2(yk +1) – 2(xk – 1) + 1, when Pk>0 I.e the mid point is outside the circle(xk+1 = xk-1)
The first point to be plotted is (r, 0) on the x-axis. The initial value of P is calculated as follows:-

P1 = (r – 0.5)2 + (0+1)2 – r2
= 1.25 – r
= 1 -r (When rounded off)
Examples:

JCEI’s Jaihind Polytechnic Kuran Page 21


Computer Graphics

Input : Centre -> (0, 0), Radius -> 3


Output : (3, 0) (3, 0) (0, 3) (0, 3)
(3, 1) (-3, 1) (3, -1) (-3, -1)
(1, 3) (-1, 3) (1, -3) (-1, -3)
(2, 2) (-2, 2) (2, -2) (-2, -2)

Input : Centre -> (4, 4), Radius -> 2


Output : (6, 4) (6, 4) (4, 6) (4, 6)
(6, 5) (2, 5) (6, 3) (2, 3)
(5, 6) (3, 6) (5, 2) (3, 2)

10.0 Develop program for 2D and 3D transformation


2D Transformation

Transformation means changing some graphics into something else by applying rules. We can
have various types of transformations such as translation, scaling up or down, rotation, shearing,
etc. When a transformation takes place on a 2D plane, it is called 2D transformation.

Transformations play an important role in computer graphics to reposition the graphics on the
screen and change their size or orientation.

Homogenous Coordinates

To perform a sequence of transformation such as translation followed by rotation and scaling, we


need to follow a sequential process −

 Translate the coordinates,

 Rotate the translated coordinates, and then

 Scale the rotated coordinates to complete the composite transformation.

JCEI’s Jaihind Polytechnic Kuran Page 22


Computer Graphics

To shorten this process, we have to use 3×3 transformation matrix instead of 2×2 transformation
matrix. To convert a 2×2 matrix to 3×3 matrix, we have to add an extra dummy coordinate W.

In this way, we can represent the point by 3 numbers instead of 2 numbers, which is
called Homogenous Coordinate system. In this system, we can represent all the transformation
equations in matrix multiplication. Any Cartesian point PX,YX,Y can be converted to
homogenous coordinates by P’ (Xh, Yh, h).

Translation
A translation moves an object to a different position on the screen. You can translate a point in 2D
by adding translation coordinate (tx, ty) to the original coordinate X,YX,Y to get the new
coordinate X′,Y′X′,Y′.

From the above figure, you can write that −

X’ = X + tx

Y’ = Y + ty

The pair (tx, ty) is called the translation vector or shift vector. The above equations can also be
represented using the column vectors.

P=[X][Y]P=[X][Y] p' = [X′][Y′][X′][Y′]T = [tx][ty][tx][ty]

We can write it as −

P’ = P + T

JCEI’s Jaihind Polytechnic Kuran Page 23


Computer Graphics

Rotation
In rotation, we rotate the object at particular angle θ thetatheta from its origin. From the following
figure, we can see that the point PX,YX,Y is located at angle φ from the horizontal X coordinate
with distance r from the origin.
Let us suppose you want to rotate it at the angle θ. After rotating it to a new location, you will get a
new point P’ X′,Y′X′,Y′.

Using standard trigonometric the original coordinate of point PX,YX,Y can be represented as −


X=rcosϕ......(1)X=rcosϕ......(1)
Y=rsinϕ......(2)Y=rsinϕ......(2)
Same way we can represent the point P’ X′,Y′X′,Y′ as −
x′=rcos(ϕ+θ)=rcosϕcosθ−rsinϕsinθ.......(3)x′=rcos(ϕ+θ)=rcosϕcosθ−rsinϕsinθ.......(3)
y′=rsin(ϕ+θ)=rcosϕsinθ+rsinϕcosθ.......(4)y′=rsin(ϕ+θ)=rcosϕsinθ+rsinϕcosθ.......(4)
Substituting equation 11 & 22 in 33 & 44 respectively, we will get
x′=xcosθ−ysinθx′=xcosθ−ysinθ
y′=xsinθ+ycosθy′=xsinθ+ycosθ

Representing the above equation in matrix form,

[X′Y′]=[XY][cosθ−sinθsinθcosθ]OR[X′Y′]=[XY][cosθsinθ−sinθcosθ]OR

P’ = P . R

Where R is the rotation matrix

R=[cosθ−sinθsinθcosθ]R=[cosθsinθ−sinθcosθ]

The rotation angle can be positive and negative.

JCEI’s Jaihind Polytechnic Kuran Page 24


Computer Graphics

For positive rotation angle, we can use the above rotation matrix. However, for negative angle
rotation, the matrix will change as shown below −

R=[cos(−θ)−sin(−θ)sin(−θ)cos(−θ)]R=[cos(−θ)sin(−θ)−sin(−θ)cos(−θ)]
=[cosθsinθ−sinθcosθ](∵cos(−θ)=cosθandsin(−θ)=−sinθ)=[cosθ−sinθsinθcosθ]
(∵cos(−θ)=cosθandsin(−θ)=−sinθ)

Scaling

To change the size of an object, scaling transformation is used. In the scaling process, you either
expand or compress the dimensions of the object. Scaling can be achieved by multiplying the
original coordinates of the object with the scaling factor to get the desired result.

Let us assume that the original coordinates are X,YX,Y, the scaling factors are (SX, SY), and the
produced coordinates are X′,Y′X′,Y′. This can be mathematically represented as shown below −

X' = X . SX and Y' = Y . SY

The scaling factor SX, SY scales the object in X and Y direction respectively. The above equations
can also be represented in matrix form as below −

(X′Y′)=(XY)[Sx00Sy](X′Y′)=(XY)[Sx00Sy]

OR

P’ = P . S

Where S is the scaling matrix. The scaling process is shown in the following figure.

JCEI’s Jaihind Polytechnic Kuran Page 25


Computer Graphics

If we provide values less than 1 to the scaling factor S, then we can reduce the size of the object. If
we provide values greater than 1, then we can increase the size of the object.

Reflection

Reflection is the mirror image of original object. In other words, we can say that it is a rotation
operation with 180°. In reflection transformation, the size of the object does not change.

The following figures show reflections with respect to X and Y axes, and about the origin
respectively.

JCEI’s Jaihind Polytechnic Kuran Page 26


Computer Graphics

Shear

A transformation that slants the shape of an object is called the shear transformation. There are two
shear transformations X-Shear and Y-Shear. One shifts X coordinates values and other shifts Y
coordinate values. However; in both the cases only one coordinate changes its coordinates and
other preserves its values. Shearing is also termed as Skewing.

X-Shear

The X-Shear preserves the Y coordinate and changes are made to X coordinates, which causes the
vertical lines to tilt right or left as shown in below figure.

The transformation matrix for X-Shear can be represented as −

Xsh=⎡⎣⎢100shx10001⎤⎦⎥Xsh=[1shx0010001]

JCEI’s Jaihind Polytechnic Kuran Page 27


Computer Graphics

Y' = Y + Shy . X

X’ = X

Y-Shear

The Y-Shear preserves the X coordinates and changes the Y coordinates which causes the
horizontal lines to transform into lines which slopes up or down as shown in the following figure.

The Y-Shear can be represented in matrix from as −

Ysh⎡⎣⎢1shy0010001⎤⎦⎥Ysh[100shy10001]

X’ = X + Shx . Y

Y’ = Y

Composite Transformation

If a transformation of the plane T1 is followed by a second plane transformation T2, then the result
itself may be represented by a single transformation T which is the composition of T1 and T2
taken in that order. This is written as T = T1∙T2.

Composite transformation can be achieved by concatenation of transformation matrices to obtain a


combined transformation matrix.

A combined matrix −

[T][X] = [X] [T1] [T2] [T3] [T4] …. [Tn]

Where [Ti] is any combination of

 Translation

JCEI’s Jaihind Polytechnic Kuran Page 28


Computer Graphics

 Scaling

 Shearing

 Rotation

 Reflection

The change in the order of transformation would lead to different results, as in general matrix
multiplication is not cumulative, that is [A] . [B] ≠ [B] . [A] and the order of multiplication. The
basic purpose of composing transformations is to gain efficiency by applying a single composed
transformation to a point, rather than applying a series of transformation, one after another.

 For example, to rotate an object about an arbitrary point (Xp, Yp), we have to carry out
three steps Translate point (Xp, Yp) to the origin.
 Rotate it about the origin.
 Finally, translate the center of rotation back where it belonged.

3D transformation

Rotation

3D rotation is not same as 2D rotation. In 3D rotation, we have to specify the angle of rotation
along with the axis of rotation. We can perform 3D rotation about X, Y, and Z axes. They are
represented in the matrix form as below –

JCEI’s Jaihind Polytechnic Kuran Page 29


Computer Graphics

Scaling

You can change the size of an object using scaling transformation. In the scaling process, you
either expand or compress the dimensions of the object. Scaling can be achieved by multiplying
the original coordinates of the object with the scaling factor to get the desired result. The following
figure shows the effect of 3D scaling −

In 3D scaling operation, three coordinates are used. Let us assume that the original coordinates
are X,Y,ZX,Y,Z, scaling factors are (SX,SY,Sz)(SX,SY,Sz) respectively, and the produced
coordinates are X′,Y′,Z′X′,Y′,Z′. This can be mathematically represented as shown below −

Shear

A transformation that slants the shape of an object is called the shear transformation. Like in 2D
shear, we can shear an object along the X-axis, Y-axis, or Z-axis in 3D.

As shown in the above figure, there is a coordinate P. You can shear it to get a new coordinate P',
which can be represented in 3D matrix form as below −

P’ = P ∙ Sh

JCEI’s Jaihind Polytechnic Kuran Page 30


Computer Graphics

X′=X+ShyxY+ShzxZX′=X+ShxyY+ShxzZ
Y′=ShxyX+Y+shzyZY′=ShyxX+Y+shyzZ
Z′=ShxzX+ShyzY+ZZ′=ShzxX+ShzyY+Z

Transformation Matrices

Transformation matrix is a basic tool for transformation. A matrix with n x m dimensions is


multiplied with the coordinate of objects. Usually 3 x 3 or 4 x 4 matrices are used for
transformation. For example, consider the following matrix for various operation.

7.0 Skill Developed/ Learning outcome of this Micro-Project


Basic principles and techniques for computer graphics on modern graphics hardware.
Students will gain experience in interactive computer graphics using the OpenGL API. Topics
include: 2D viewing, 3D viewing, perspective, lighting, and geometry. Prerequisites: COSC 2437,
MATH 2413. MATH 3311, Linear Algebra is recommended. Fall. This course will introduce
students to all aspects of computer graphics including hardware, software and applications. Students
will gain experience using a graphics application programming interface (OpenGL) by completing
several programming projects. This course is required of some COSC students, and can be taken as
an elective for other COSC students. Have a basic understanding of the core concepts of computer
graphics. Be capable of using OpenGL to create interactive computer graphics. Understand a
typical graphics pipeline. Have made pictures with their computer

JCEI’s Jaihind Polytechnic Kuran Page 31


Computer Graphics

10.0 Applications of Micro-Project

1. Computer Art:
Using computer graphics we can create fine and commercial art which include animation
packages, paint packages. These packages provide facilities for designing object shapes and
specifying object motion.Cartoon drawing, paintings, logo design can also be done.

2. Computer Aided Drawing:


Designing of buildings, automobile, aircraft is done with the help of computer aided drawing,
this helps in providing minute details to the drawing and producing more accurate and sharp
drawings with better specifications.

3. Presentation Graphics:
For the preparation of reports or summarising the financial, statistical, mathematical, scientific,
economic data for research reports, managerial reports, moreover creation of bar graphs, pie
charts, time chart, can be done using the tools present in computer graphics.

4. Entertainment:
Computer graphics finds a major part of its utility in the movie industry and game industry.
Used for creating motion pictures , music video, television shows, cartoon animation films. In
the game industry where focus and interactivity are the key players, computer graphics helps in
providing such features in the efficient way.

5. Education:
Computer generated models are extremely useful for teaching huge number of concepts and
fundamentals in an easy to understand and learn manner. Using computer graphics many
educational models can be created through which more interest can be generated among the
students regarding the subject.

6. Training:
Specialised system for training like simulators can be used for training the candidates in a way
that can be grasped in a short span of time with better understanding. Creation of training
modules using computer graphics is simple and very useful.

Ms.Dhumal K.R.

************************

JCEI’s Jaihind Polytechnic Kuran Page 32

You might also like