Professional Documents
Culture Documents
INTRODUCTION
1.1 Overview
A Mouse Interaction Using Hand Gesture is software that allows users to give mouse inputs to a system without using an actual mouse. To the extreme it can also be called as hardware because it uses an ordinary web camera. A virtual mouse can usually be operated with multiple input devices, which may include an actual mouse or a computer keyboard. Mouse Interaction Using Hand Gesture which uses web camera works with the help of different image processing techniques. In this the hand movements of a user is mapped into mouse inputs. A web camera is set to take images continuously. The user must have a particular color in his hand so that when the web camera takes image it must be visible in the image. This color is detected from the image pixel and the pixel position is mapped into mouse input. Depending upon the size of the image taken by camera various scaling techniques are used because the pixel position in the image will not have a correspondence with screen resolution.
1.3.1 C# Language:
C# is an elegant and type-safe object-oriented language that enables developers to build a wide range of secure and robust applications that run on the .NET Framework. C# syntax is highly expressive, it is also simple and easy to learn. Developers who know any of these languages are typically able to begin working productively in C# within a very short time. C#
1
syntax simplifies many of the complexities of C++ while providing powerful features such as nullable value types, enumerations, delegates, anonymous methods and direct memory access, which are not found in Java. As an object-oriented language, C# supports the concepts of encapsulation, inheritance and polymorphism. All variables and methods, including the Main method, the application's entry point, are encapsulated within class definitions. A class may inherit directly from one parent class, but it may implement any number of interfaces.
Chapter 2
FEASIBILITY STUDY
2.1 General
Feasibility study is very important aspect of building software. It will answer the question of why would a developer build a software. Without planning, the software may not be able to perform or function as planned and feasibility study makes sure the program created is needed and will be appealing to the intended users. The decision to implement any new project or program must be based on a thorough analysis of the current operation. In addition, the impact of the implementation of the proposed project/program on the future operation of MOUSE INTERACTIONS USING HAND GESTURES must be evaluated. The input to the feasibility study is outline description of the system and how it will be used within an organization. The results of the feasibility study should be a report, which recommends whether or not it is worth carrying on with the requirements engineering and system development process. When the information is available, the feasibility study report is prepared. This should make recommendation about whether or not the system development should continue. It may propose changes to the scope, budget and schedule of the system and suggest further high-level requirement of the system. A feasibility study should be relatively cheap and quick.
modules in parallel.
Direct access to windows APIs:.NET provides a direct access to windows APIs. The APIs including DLL (Dynamic Link library) functions [1]. Visual Studio provides GUI design tools: For designing the software. It simplifies overhead of coding to an extent and helps to reduce the software development time and provides a better user friendly system.
2.6 Summary
Feasibility analysis is a process of validating whether the software to be developed is possible with the current hardware and software technologies. In this stage, various factors such as, time constraints, budgetary constraint etc, are considered. Also, here we check whether the project to be developed will be cost-effective and can be developed with the given budgetary constraints and time constraints.
Chapter 3
SYSTEM ANALYSIS
3.1 General
System analysis is a detailed study of various operations performed by a system and their relationships within and outside the system. During analysis, data are collected on the available files, decision points and transactions handled by the present system. Interviews, on-site observation and questionnaire are the tools used for system analysis. There are two major activities in this phase [4]: Requirement analysis Requirement specification
C# Language
C# language
[1]
programming language. C# has a unified type system. This unified type system is called Common Type System (CTS) [4]. A unified type system implies that all types, including primitives such as integers, are subclasses of the System. Object class. For example, every type inherits a ToString()method. For performance reasons primitive types (and value types in general) are internally allocated on the stack. Features of C# C# (pronounced c sharp)is the native language for the .NET Common Language Runtime. It has been designed to fit seamlessly into the .NET Common Language Runtime. Code can be in either Visual C++ or Visual Basic, but in most cases, C# will likely fit programmers needs[1][4]. Component Software The .NET Common Language Runtime is a component-based environment, and it should come as no surprise that C# is designed to make component creation easier. Its a component-centric language, in that all objects are written as components, and the component is the center of the action. Component concepts, such as properties, methods, and events, are first-class citizens of the language and of the underlying runtime environment. Declarative information (known as attributes) can be applied to components to convey design- time and runtime information about the component to other parts of the system. Documentation can be written inside the component and exported to XML. C# objects dont require header files, IDL files, or type libraries to be created or used. Components created by C# are fully self-describing and can be used without registration process. C# is aided in the creation of components by the .NET Runtime and Frameworks, which provide a unified type system in which everything can be treated as an object, but without the performance penalty associated with pure object systems, such as Smalltalk.
The Execution Environment This section was once titled, The Execution Engine, but .NET Runtime is much more than just an engine. The environment provides a simpler programming model, safety and security, powerful tools support, and help with deployment, packaging, and other support. Safety and Security The .Net Runtime environment is designed to be a safe and secure environment. The .NET Runtime is a managed environment, which means that the Runtime manages memory for the programmer. Instead of having to manage memory allocation and de-allocation, the garbage collector does it. Not only does garbage collection reduce the number of things to remember when programming, in a server environment it can drastically reduce the number of memory leaks. This makes high-availability systems much easier to develop. Additionally, the .NET Runtime is a verified environment. At runtime, the environment verifies that the executing code is type-safe. This can catch errors, such as passing the wrong type to a function, and attacks, such as trying to read beyond allocated boundaries or executing code at an arbitrary location. The security system interacts with the verifier to ensure that code does only what it is permitted to do. The security requirements for a specific piece of code can be expressed in a finely grained manner, code can, for example, specify that it needs to be able to write a scratch file, and that requirement will be checked execution. Exception Handling The first reason is that exception handling is deeply ingrained in the .NET Runtime, and is therefore very common in C# code. The second reason is that it allows the code examples to be better. Trying and Catching To deal with exceptions, code needs to be organized a bit differently. The sections of code that might throw exceptions are placed in a try block, and the code to handle exceptions in the try block is placed in a catch block.
10
3.5 Summary
Detailed study of the various operations performed by the system and their relationship within and outside the system is studied. Non-Functional requirements which describe constraints imposed on the software and the restriction on freedom of designing are also studied and collected system requirements.
11
Chapter 4
SYSTEM DESIGN
4.1 General
System design is a process through which requirements are translated into a representation of software. Initially, the representation depicts a holistic view of software. Subsequent refinement leads to a design representation that is very close to source code. Design is the place where quality is fostered in software development.
Figure 4.1
Block diagram
The block diagram specifies how the project works in simple terms. Initially, we insert a color band to our fingers and these colors are set in the project. A webcam takes continuous sequence of image of the hand, based on the difference in location of the specified colored object in the image sequences specific functionalities can be seen in the monitor.
12
13
14
The flow diagram depicts the way of flow of control as well as how the various events are handled. A video source from the list available is selected and various color markers in the hand are identified. The hand movements in front of the webcam are processed in the form of continuous images and required color pixels are identified and based on the type and location of these color pixels mouse inputs are mapped and mouse functionalities are implemented.
4.5 Summary
Subsequent refinement to the design representation is made that is very close to source code. Requirements are translated into a representation of software. Different modules are identified. Flow of data between different modules is analyzed.
15
Chapter 5
DETAILED DESIGN
5.1 General
In detailed design we should know the organization of the design and what each function should do. It is concerned with producing short design specification of each function. This section provides a brief description of the various components that are used in our project Mouse Interaction Using Hand Gestures. Webcam: It enables to detect bright colored objects, provided the color of the object and environment should be different. The webcam should be minimum of 1.3Mp.The webcam is connected to the computer using the data link. The webcam will detect the object and will be processed accordingly and the outputs are displayed on the screen of the computer. Colored Objects: It enables the selection of one or more markers. For Object detection we make use of markers. Markers can be anything i.e. colored objects such as color band, ball, pen etc. All the markers should satisfy one criterion that is it should be distinguishable from its environment. Hence we cant have a marker of the same color as that of the environment.
16
The sequences of images are processed from video-source and selected object is identified and thus mouse functions are implemented. Processing of image is initiated by the NewFrameHandler event of VideoSourcePlayer class defined in Aforge library. In each image location of the selected colour object is determined. And this location information is used for performing different operations.
The Using: The using statement allow the programmer to specify when objects that use resources should release them. This statement is like pre-processor directive used in C and C++ languages. By adding a statement like Using xyz will add an external assembly to the code file. E.g. Using System.Forms
public void DoRightMouseClick(): The function is used to perform mouse single right click operation. This function is called based on the flags set during the processing of the image. The flags are constantly monitored by the timer function.
public void DoDoubleMouseClick(): The function is used to perform mouse left double click operation. This function is called based on the flags set during the processing of the image. The flags are constantly monitored by the timer function.
5.2 Algorithm
Img: signifies the image produced by the selected video-source. color1: signifies the color of the first marker. color2: signifies the color of the second marker. EucledianColorfiltering is applied to the image Img to filter out undesired pixels. GreyScaleFiltering is applied to convert image Img to greyscale image.
18
BlobCounter is used to get location of the desired colored objects. Based on the location of the colored objects, the required operations like mouse cursor movement, mouse left click, mouse right click and mouse double clicking are performed.
5.3 Summary
Various modules were used in proposed project. The study of detailed design of these modules enabled us to improve upon the workability of the system. Application of algorithm brought about the much needed synchrony amongst the modules. This study has opened up the scope and need for incremental improvement of the application.
19
Chapter 6
TESTING
6.1 General
Testing a systems capabilities is a very important task. Users are interested in getting a job done and test cases should be chosen to identify aspects of the system that will stop them from doing their job. Although errors, such as screen corruption, are irritating they are less disruptive than errors, which cause loss of data or program termination. Testing typical situations is very important. It is important that a system works under normal usage conditions than occasional conditions that only arise with extreme data values. Some of the most important testing methods are explained below:
Unit testing focuses on verification on effort on the smallest unit of software design module. The purpose of unit testing is to uncover errors in the smallest software unit in the routine. Each routine will be tested individually using black box oriented test. The programmer of each design will design a set of test cases for the module and ensure that the module is fully tested importance or complex routine will also be tested by at least other person [4]. 6.2.1.1 Test Cases Test cases are the specific executable test that examines all aspects including inputs and outputs of a system and then provides a detailed description of the steps that should be taken, the results that should be achieved, and other elements that should be identified. Steps explained in a test case include all details even if it they are assumed to be common knowledge. Test cases are used as a technical explanation and reference guide for systems. Test cases indicate the various test carried out and comparing the results obtained from the
20
test cases with the expected results. These will help us to know the different user inputs and the results obtained for those inputs. The test cases generated for our project has been displayed in the Table 6.1 Steps Input Specification Video source selection 2 No video source Expected Result Video source must be selected Error message is must be displayed 3 Color 1 picker Color 1 must be selected 4 Color 2 picker Color 2 must be selected 5 Cursor control Moves the mouse cursor 6 Left click function 7 Right click function 8 Double click function Must click the selected object Must click the selected object Must click the selected object Color 1 is selected Color 20 is selected Moves the mouse cursor Clicks the selected object Clicks the selected object Clicks the selected object As Expected As Expected As Expected As Expected As Expected As Expected Obtained Result Video source is selected Error message is selected As Expected Remarks
As Expected
21
6.7 Summary
Testing typical situations is very important. It is important that a system works under normal values. Different types of testing are done for the application developed. The test cases are chosen to identify aspects of the system that will stop them from doing their job.
22
Chapter 7
23
BIBLIOGRAPY
[1] Andrew Troelsen, Pro C# with .NET 3.0, Special Edition, Dream tech press, 2007. [2] Stuart Russel, Peter Norvig, Artificial Intelligence: A Modern Approach, 2nd Edition, Pearson Education, 2003. [3] Herbert Schildt, C# : The Complete Reference, 5th Edition, Tata Mc-GrawHill, 2004. [4] Ian Somerville, Software Engineering, 8th Edition, Pearson Education, 2007.
24
25
When two color bands are brought along y-axis in a single line with few meters apart then double click is implemented at position of the mouse pointer.
Following these steps will implement all the functionalities of the mouse thus will work as a virtual mouse.
26
27
28
29
30
31