Sei sulla pagina 1di 28

PENCIL SKETCH TO PHOTO REALISTIC RENDERING

CHAPTER 1

INTRODUCTION
1.1 About Computer Graphics

CG (computer graphics) started with the display of data on hardcopy plotters and cathode ray tube screens soon after the introduction of computer themselves. It includes the creation, storage and manipulation of models and images of objects. Computer graphics today is largely interactive the user controls contents structure and appearance of the objects and their displayed images by using input devices such as keyboard or touch sensitive panel on the screen. Bitmap graphics is used for user computer interaction. A bitmap is an ones and zeros representation of points on the screen. Bitmap graphics provide easy to use and inexpensive graphics based applications. By making communication more efficient, graphics makes it possible higher quality and more precise results or products, greater productivity, and lower analysis and design costs.

1.2 ADVANTAGES OF COMPUTER GRAPHICS:


User Interfaces: Most applications have facilities to manage multiple simultaneous activities and point-andclick that allows users to select menu items, Icons and objects on the screen.
Dept. of CS&E 1 B.G.S.I.T

PENCIL SKETCH TO PHOTO REALISTIC RENDERING Interactive Plotting in Business, Science and Technology: The next most common use of graphics today is to create 2D and 3D graphs of mathematical, physical and economic functions; histograms, bar and pie charts; task scheduling charts; inventory and production charts; and the like. Office Automation and Electronic Publishing: The use of graphics for the creation and dissemination of information has increased enormously since the advent of desktop publishing on personal computers. Many organizations whose publications used to be printed by outside specialists can now produce printed materials in house. Computer-Aided Drafting and Design: In computer-aided design (CAD), interactive graphics is used to design components and systems of mechanical, electrical, electro-mechanical, and electronic devices, including structures such as buildings, automobile bodies, airplane and ship. Simulation and Animation: Computer produced animated movies and displays of the time-varying behavior of real and simulated objects are becoming increasingly popular for scientific and engineering visualization. Art and Commerce:

Dept. of CS&E

B.G.S.I.T

PENCIL SKETCH TO PHOTO REALISTIC RENDERING There is a lot of development in the tools provided by computer graphics. This allows user to create artistic pictures which express messages and attract attentions. Such pictures are useful in advertising. Process Control: Status displays in refineries, power plants, and computer networks show data values from sensors attached to critical system components so that operators can respond to problematic conditions. Cartography: Computer graphics is also used to represent geographic maps, weather maps, oceanographic charts, contour charts.

1.3DESCRIPTION

The initial virtual environment consists of natural scenery of hill-side. The environment then transits from sketch mode to colored mode followed by an introduction of small bridge over the stream. This is followed by colorless sketch of a house which transits to colored from. Then the interior detailing of the house is shown with similar color transition.

Dept. of CS&E

B.G.S.I.T

PENCIL SKETCH TO PHOTO REALISTIC RENDERING

CHAPTER 2

REQUIREMENT ANALYSIS
2.1 SCOPE:
This is basically an gaming project and will help in understanding the working of Computer graphics and various concepts involved in it.

2.2 PURPOSE OF THE PROJECT:


The main purpose of this project is Creating visual effects in a virtual environment using C/C++ language with OpenGL API.

2.3 HARDWARE REQUIREMENTS:


Computer Micro Processor Co-Micro Processor CPU Clock RAM Floppy disk Driver : : : : : : IBM Compatible Pentium 1 Onwards Installed 166MHZ Onwards 32 MB or Higher 1.44 MB
4 B.G.S.I.T

Dept. of CS&E

PENCIL SKETCH TO PHOTO REALISTIC RENDERING Hard Disk Drive VGA Adapter Monitor Keyboard Frequency Hard Disk Capacity : : : : : : 2 GB or Higher Intel 82810 graphics controller(minimum) Standard VGA Monitor 102 Keys Keyboard 66MHZ 540MB

2.4 SOFTWARE REQUIREMENTS:


Operating system Compiler used Language used

: : :

Windows Microsoft Visual C++ C and C++ programming language.

2.5 LITERATURE SURVEY:


The project is coded using the c language, which is one of the most popular computer languages and OpenGl as API. C was an offspring of the basic combined language (BCPL) called B, developed in 1960s at Cambridge university. B language was modified by Dennis Ritchie and was implemented at bell laboratories in 1972. The new language was named as C for many years; c was used mainly in academic environments, but eventually with the release of c compilers for commercial use it began to gain widespread support among computer professionals. Today c is running under number of operating system including MS-DOS. Since MS-DOS is a dominant
Dept. of CS&E 5 B.G.S.I.T

PENCIL SKETCH TO PHOTO REALISTIC RENDERING operating system for microcomputers, it is natural that c has begun to influence the microcomputer community at large.

2.6 OpenGL:
OpenGL (Open Graphics Library) is a standard specification defining a cross-language, cross-platform API for writing applications that produce 2D and 3D computer graphics. The interface consists of over 250 different function calls which can be used to draw complex threedimensional scenes from simple primitives. OpenGL was developed by Silicon Graphics Inc. (SGI) in 1992[1] and is widely used in CAD, virtual reality, scientific visualization, information visualization, and flight simulation. OpenGL is well structured with an intuitive design and logical commands. Efficient OpenGL routines typically result in applications with fewer lines of code than those that make up programs generated using other graphics libraries or packages. In addition, OpenGL drivers encapsulate information about the underlying hardware, freeing the application developer from having to design for specific hardware features.

Dept. of CS&E

B.G.S.I.T

PENCIL SKETCH TO PHOTO REALISTIC RENDERING

CHAPTER 3

DESIGN
The aim is to develop a virtual environment through sketches and show transition effects using colors and introducing new objects and articles in the initially designed virtual environment. This is done using computer graphics by applying the skills we learnt in class. And in doing so, to understand better the algorithms and the techniques underlying interactive graphics. The designed environment incorporates all the basic properties that a simple animation clip must possess like colorful objects, graphical effects and some interesting concepts along with a few other features which serve mainly as an application of class-room knowledge. Interaction is provided through the numeric keys and some characters in keyboard. Num2: Introduction of color to the sketch of a hill side scene with a river. Num 3: Introduction of a bridge over the river. Num 4: Change of scenery from a hill side view to a black and white sketch of a house. Num 5: Transition of sketch from black and white to colored.

Dept. of CS&E

B.G.S.I.T

PENCIL SKETCH TO PHOTO REALISTIC RENDERING Num 6: Display of the sketch of the interiors of the house comprising of sofa, table, etc. Num 7: Transition of sketch from black and white to colored. Num 8: Introduction of bunch of flowers hanging from the ceiling.

Dept. of CS&E

B.G.S.I.T

PENCIL SKETCH TO PHOTO REALISTIC RENDERING

CHAPTER 4

IMPLEMENTATION
4.1 Graphical Functions:
The following are in-built functions used in the project:

glut - an introduction to the OpenGL Utility Toolkit

glutInit initialize the GLUT library and graphics system. Declaration: void glutInit( int *argc, char **argv);

Remarks: To start thr graphics system, you must first call glutInit (),glutInit will initialize the GLUT library and negotiate a session with the window system. During this process, glutInit may cause the termination of the GLUT program with an error message to the user if GLUT cannot be properly initialized.

glutInitDisplayMode sets the initial display mode. Declaration:


9 B.G.S.I.T

Dept. of CS&E

PENCIL SKETCH TO PHOTO REALISTIC RENDERING void glutInitDisplayMode(unsigned int mode); Remarks:The initial display mode is used when creating top-level windows, sub windows, and overlays to determine the OpenGLdisplay mode for the to-becreated window or overlay.

glutMainLoop - enters the GLUT event processing loop. glutDisplayFunc - sets the display callback for the current window. glutReshapeFunc - sets the reshape callback for the current window. glutCreateWindow - creates a top-level window.

glutInitWindowSize - Requests future windows to open at a given width/height.


glViewport - set the viewport. glutSwapBuffers - swaps the buffers of the current window if double buffered. glEnable, glDisable - enable or disable server-side GL capabilities glClear - clear buffers to preset values glutTimerFunc - registers a timer callback to be triggered in a specified number of milliseconds.
10 B.G.S.I.T

Dept. of CS&E

PENCIL SKETCH TO PHOTO REALISTIC RENDERING

glLoadIdentity - replace the current matrix with the identity matrix glMatrixMode - specify which matrix is the current matrix glutPostRedisplay, glutPostWindowRedisplay - marks the current or specified window as needing to be redisplayed. glOrtho - multiply the current matrix with an orthographic matrix glTranslated, glTranslatef - multiply the current matrix by a translation matrix glRotated, glRotatef - multiply the current matrix by a rotation matrix glPushMatrix, glPopMatrix - push and pop the current matrix stack glColor3* The GL stores both a current single-valued color index and a current fourvalued RGBA color. glColor sets a new four-valued RGBA color.glColor has two major variants: glColor3 and glColor4. glColor3 variants specify new red, green, and blue values explicitly and set the current alpha value to 1.0 (full intensity) implicitly.

4.2 User Defined Functions:


Implementations include the functions described in the program, Those functions are:
Dept. of CS&E 11 B.G.S.I.T

PENCIL SKETCH TO PHOTO REALISTIC RENDERING

wall(double thickness), wall1(double thickness): used to draw the walls. thickness), sofa11(double

Sofa(double thickness ),sofa1(double thickness): used to draw the sofa.

Sofalegl(double thickness), Sofalegl1(double thickness):used to draw left leg of sofa.

Sofalegr(double thickness), Sofalegr1(double thickness):used to draw right leg of sofa.


Flowers( ), Flowers1( ): to draw dotted flowers. Enable(void): to test depth,set light and smooth shadow. Mydisplay1(void):to display sketched scene. Mydisplay2(void): to display colored scene. Mydisplay3(void): to display colored scene with bridge. Mydisplay4(void):to display the sketch of the house. Mydisplay5(void):to display the colored house. Mydisplay6(void):to display the sketch of interior of the room. Mydisplay7(void):to display the colored interior of the room.
12 B.G.S.I.T

Dept. of CS&E

PENCIL SKETCH TO PHOTO REALISTIC RENDERING


Mydisplay8(void):to display the bunch of flowers in the room. Mouse( int btn,int state,int x,int y):to provide input from mouse. Keyboard(unsigned char key,int x,int y):to provide input from keyboard. myinit(void): Initialize material property and light source.

main( ): Open window with initial window size, title bar, RGB display mode, and handle input events

Dept. of CS&E

13

B.G.S.I.T

PENCIL SKETCH TO PHOTO REALISTIC RENDERING

CHAPTER 5

Snapshots

Snapshot 5.1: Sketch of a hill side scene with a river.

Dept. of CS&E

14

B.G.S.I.T

PENCIL SKETCH TO PHOTO REALISTIC RENDERING

Snapshot 5.2: Colored sketch of a hill side scene with a river

Dept. of CS&E

15

B.G.S.I.T

PENCIL SKETCH TO PHOTO REALISTIC RENDERING

Snapshot 5.3: Introduction of a bridge over the river

Dept. of CS&E

16

B.G.S.I.T

PENCIL SKETCH TO PHOTO REALISTIC RENDERING

Snapshot 5.4: Black and white sketch of a house

Dept. of CS&E

17

B.G.S.I.T

PENCIL SKETCH TO PHOTO REALISTIC RENDERING

Snapshot 5.5: Sketch from black and white to colored

Dept. of CS&E

18

B.G.S.I.T

PENCIL SKETCH TO PHOTO REALISTIC RENDERING

Snapshot 5.6: sketch of the interiors of the house

Dept. of CS&E

19

B.G.S.I.T

PENCIL SKETCH TO PHOTO REALISTIC RENDERING

Snapshot 5.7: Sketch from black and white to colored

Dept. of CS&E

20

B.G.S.I.T

PENCIL SKETCH TO PHOTO REALISTIC RENDERING

Snapshot 5.8: Introduction of bunch of flowers

CHAPTER 6

TESTING AND VALIDATION


Dept. of CS&E 21 B.G.S.I.T

PENCIL SKETCH TO PHOTO REALISTIC RENDERING

6.1 Test Case Design:


Software testing is a critical element of software quality assurance and represents the ultimate review of specification, design and coding. Testing represents an interesting anomaly for the software. The overall objective of event based testing is to find the maximum number of errors with a minimum effort. In event based testing the view of testing broadens to include the review of both analysis models. In addition, the focus moves away from the procedural component towards the class. There are main approaches for testing. They are: Top down testing Bottom up testing

In top down testing the general problem is tested first, followed by the addition program modules, one level at a time to the lowest level. In bottom up small scale program modules are tested first, which are linked to a high level module, and so on until the program is completed. The testing phase involves the testing of the developed system using various test data. Preparation of test data plays an important role in the system testing.

Dept. of CS&E

22

B.G.S.I.T

PENCIL SKETCH TO PHOTO REALISTIC RENDERING

6.2 Various Testing strategies:


A strategy for software testing may be viewed as a spiral which constituting of Unit Testing: A unit testing focuses verification effort on the smallest unit of software design. Using unit test plan prepared in the design phase of the system development as a guide, important control paths are tested to uncover errors within the module. This testing was carried out during the coding and tested results are compared with the expected output. When event oriented software is considered, the concept of the unit changes , rather than the individual module. Integration Testing: Integrating testing is the systematic technique for constructing the program structure while at the same time conducting test to uncover errors associated with interface. The objective is to take unit - tested modules and build the program structure that has been dictated by design. All modules are combined in this testing step. Then the entire program is tested as a whole. System Testing: At the culmination of integration testing, software is completely assembled as package,
Dept. of CS&E 23 B.G.S.I.T

Unit testing Integration testing System testing Acceptance testing

PENCIL SKETCH TO PHOTO REALISTIC RENDERING interface errors have been uncovered and corrected and final series of system testing begins. System testing can be defined in many ways, but a simple definition is that the system succeeds when the user/customer. Acceptance Testing: User acceptance of a system is a key factor to the success of the developed system. The system under consideration was tested for user acceptance constantly keeping in touch with the prospective system user at the time of developing and making change wherever require. All the forms have been thoroughly tested for any bugs that may have crept in our design or implementation. So far no such bags have been discovered.

CHAPTER 7

FUTURE ENHANCEMENTS

Graphics can be enhanced and made more realistic by improving the program. The environment can be made more detailed by incorporating objects and articles.
24 B.G.S.I.T

Dept. of CS&E

PENCIL SKETCH TO PHOTO REALISTIC RENDERING

Dept. of CS&E

25

B.G.S.I.T

PENCIL SKETCH TO PHOTO REALISTIC RENDERING

CHAPTER 8

CONCLUSION
The concept used in program can be very useful in creating similar but complicated environments. This project can be used as the frame work for developing better graphical and animation clips.

Dept. of CS&E

26

B.G.S.I.T

PENCIL SKETCH TO PHOTO REALISTIC RENDERING

CHAPTER 9

BIBILOGRAPHY

Dept. of CS&E

27

B.G.S.I.T

PENCIL SKETCH TO PHOTO REALISTIC RENDERING

Text Books:
[1]. Interactive Computer Graphics ByEdward Angel, 5th Edition, Addison-Wesley, 2008 [2]. Computer Graphics Using OpenGl F.S. Hill, 2nd Edition, 2001

Website:
[1]. www.google.com [2]. www.wikipedia.com

Dept. of CS&E

28

B.G.S.I.T

Potrebbero piacerti anche