91.204.201 Computing IV Visual C++ 2010 Introduction with OpenCV 2.4.3 Example Xinwen Fu.

Slides:



Advertisements
Similar presentations
Creating a Dialog-Based Comet Windows Program Brian Levantine.
Advertisements

Using Macros and Visual Basic for Applications (VBA) with Excel
1 ADVANCED MICROSOFT POWERPOINT Lesson 5 – Using Advanced Text Features Microsoft Office 2003: Advanced.
© by Pearson Education, Inc. All Rights Reserved.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
 2006 Pearson Education, Inc. All rights reserved Introduction to the Visual C# 2005 Express Edition IDE.
Copyright 2007, Paradigm Publishing Inc. POWERPOINT 2007 CHAPTER 1 BACKNEXTEND 1-1 LINKS TO OBJECTIVES Create Presentation Open, Save, Run, Print, Close,Delete.
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Creating a Console Application with Visual Studio
ADVANCED MICROSOFT POWERPOINT Lesson 6 – Creating Tables and Charts
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter One An Introduction to Visual Basic 2010.
Basic Printing using Word. 3 Components required for printing Computer Computer Printer Printer Paper Paper.
PowerPoint Lesson 4 Expanding on PowerPoint Basics
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
CHAPTER 1 XNA Game Studio 4.0. Your First Project A computer game is not just a program—it is also lots of other bits and pieces that make playing the.
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
A First Program Using C#
Chapter 3 Navigating a Project Goals & Objectives 1.Get familiar with the navigation of the project. How is everything structured? What settings can you.
OPENCV TUTORIAL OpenCV Windows 7 Microsoft Visual C++ Express 2010.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
1 INF160 IS Development Environments AUBG, COS dept Lecture 06 Title: Dev Env: Code::Blocks (Extract from Syllabus) Reference:
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 2 - Welcome Application: Introduction to C++
CHAPTER 9 Introducing Microsoft Office Learning Objectives Start Office programs and explore common elements Use the Ribbon Work with files Use.
IT 211 Project Integration and Deployment Lab #11.
CS Tutorial 1 Getting Started with Visual Studio 2012 (Visual Studio 2010 are no longer available on MSDNAA, please choose Visual Studio 2012 which.
IE 411/511: Visual Programming for Industrial Applications
CHAPTER 9 Introducing Microsoft Office Learning Objectives Start Office programs and explore common elements Use the Ribbon Work with files Use.
Introduction to Matlab & Data Analysis
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 2 Welcome Application Introducing the Visual Basic 2008 Express Edition IDE.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
A1 Visual C++.NET Intro Programming in C++ Computer Science Dept Va Tech August, 2002 © Barnette ND & McQuain WD 1 Quick Introduction The following.
Lecture Set 1 Part C: Understanding Visual Studio and.NET – Applications, Solutions, Projects (no longer used – embedded in Lecture Set 2A)
Introduction to the Visual Studio.NET IDE (LAB 1 )
Copyright © 2010 Wolters Kluwer Health | Lippincott Williams & Wilkins Introduction to Windows Chapter 2.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Tutorial 11 Five windows included in the Visual Basic Startup Screen Main Form Toolbox Project Explorer (Project) Properties.
Active-HDL Interfaces Debugging C Code Course 10.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files.
Active-HDL Interfaces Building VHPI Applications C Compilation Course 9.
Using Microsoft Visual Studio 2005 Original by Suma Rao Revised by John G. McMahon ( 9/6/2008 )
Microsoft Access 2010 Chapter 8 Advanced Form Techniques.
Visual Basic.NET BASICS Lesson 1 A First Look at Microsoft Visual Basic.NET.
 2006 Pearson Education, Inc. All rights reserved Introduction to the Visual C# 2005 Express Edition IDE.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 7 – Creating and Using Templates in a Web.
Microsoft Visual Basic 2005 BASICS Lesson 1 A First Look at Microsoft Visual Basic.
Chapter 3 I Need a Tour Guide (Introduction to Visual Basic 2010) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Overview of Previous Lesson(s) Over View 3 Program.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Using Macros Lesson.
Tutorial 1 Writing Your First C++ Program CSC1110C Introduction to Computer Programming By Paul Pun Acknowledgement: Special thanks to Dr. Michael Fung.
Chapter 11 Enhancing an Online Form and Using Macros Microsoft Word 2013.
Dive Into® Visual Basic 2010 Express
Chapter 2: The Visual Studio .NET Development Environment
INF230 Basics in C# Programming
3.01 Apply Controls Associated With Visual Studio Form
Deploying and Configuring SSIS Packages
3.01 Apply Controls Associated With Visual Studio Form
Introduction to the Visual C# 2005 Express Edition IDE
Introducing Microsoft Office 2010
CIS16 Application Development Programming with Visual Basic
Lab 1 Introduction to C++.
Presentation transcript:

Computing IV Visual C Introduction with OpenCV Example Xinwen Fu

Reading Assignment  Chapter one of the tutorials By Dr. Xinwen Fu2 /the-college-degrees-with-the- highest-starting-salaries html

Outline  Installing and configuring Visual Studio 2010 to run an OpenCV example  Visual studio concepts  Tips of using Visual C++  Example code By Dr. Xinwen Fu3

Demo 4

How to install OpenCV on Visual Studio 2010  OpenCV for Windows OpenCV Version  Visit for source code: there is some bug  Some copy and pastables: Additional Include Directories: $(OPENCV_BUILD)\include Additional Library Directories: $(OPENCV_BUILD)\x86\vc10\lib By Dr. Xinwen Fu5

How to install OpenCV on Visual Studio 2010 (Cont’d)  Debug Additional Dependencies: opencv_core243d.lib opencv_imgproc243d.lib opencv_highgui243d.lib opencv_ml243d.lib opencv_video243d.lib opencv_features2d243d.lib opencv_calib3d243d.lib  Release Additional Dependencies (same thing but without 'd' at the end): opencv_core243.lib opencv_imgproc243.lib opencv_highgui243.lib opencv_ml243.lib opencv_video243.lib opencv_features2d243.lib opencv_calib3d243.lib By Dr. Xinwen Fu6

Differences between.dll,.lib,.h files? .h - header file a source file containing declarations (as opposed to.cpp.cxx etc. containing implementations) .lib - static library may contain code or just links to a dynamic library compiled code that you link with your program The static library is included in your.exe at link time. .dll - dynamic library Just like a static one but you need to deploy it with your.exe file because its loaded at run time By Dr. Xinwen Fu7

Configuration tips  No need of care about your systems is 64 bits or 32 bits 32 bits applications can run on 64 bits machines without problems  Use 32 bits OpenCV library By Dr. Xinwen Fu8

Troubleshooting  If it does not work following the video tutorial, you must have done one of the steps wrong Double check it By Dr. Xinwen Fu9

Outline  Installing and configuring Visual Studio 2010 to run an OpenCV example  Visual studio concepts  Tips of using Visual C++  Example code By Dr. Xinwen Fu10

Solutions and Projects  Visual Studio provides two containers to help you efficiently manage the items that are required by your development effort, such as references, data connections, folders, and files. These containers are called solutions and projects.  Visual Studio provides Solution Folders to organize related projects into groups and then perform actions on those groups of projects. Solution Explorer, an interface for viewing and managing these containers and their associated items, is part of the integrated development environment (IDE). By Dr. Xinwen Fu11

Items  Items can be files and other parts of your project such as references, data connections, or folders  In Solution Explorer, items can be organized as project items, which are items that compose your project, such as forms, source files, and classes within a project in Solution Explorer. as solution items for files that are applicable to your solution as a whole in the Solution Items folder of Solution Explorer. as miscellaneous files that are not associated with either a project or a solution and that can be displayed in a Miscellaneous Files folder By Dr. Xinwen Fu12

Solutions as Containers  Visual Studio implements conceptual containers called solutions and projects to enable the integrated development environment (IDE) to apply its wide range of tools, designers, templates, and settings  Visual Studio automatically generates a solution when you create a new project By Dr. Xinwen Fu13

Advantages  Solutions allow you to concentrate on developing and deploying your projects, instead of sorting through all the details of managing project files, components, and objects.  Each Visual Studio solution allows you to: Work on multiple projects within same instance of IDE. Work on items using settings and options that apply to an entire set of projects. Use Solution Explorer to help develop and deploy your application. Manage additional files opened outside the context of a solution or project. By Dr. Xinwen Fu14

Definition Files  Visual Studio stores the definition for a solution in two files:.sln and.suo In previous versions of Visual Studio, you might have noticed the group (.vbg) or workspace (.dsw) files in Visual Basic and Visual C++, respectively.  The solution definition file (.sln) stores the metadata that defines your solution: Projects that are associated with the solution. Items available at the solution level that are not associated with a particular project. Solution build configurations that set which project configurations to apply in each type of build. By Dr. Xinwen Fu15

Definition Files (Cont’d)  The metadata stored in the.suo file as you construct a solution and set its properties is used to customize the IDE whenever the solution is active. By Dr. Xinwen Fu16

Projects as Containers  To help you to organize and perform common tasks on the items that you are developing, Visual Studio projects are used as containers within a solution to logically manage, build, and debug the items that comprise your application.  The output of a project is usually an executable program (.exe), a dynamic-link library (.dll) file or a module, among others. By Dr. Xinwen Fu17

Create a Visual Studio Solution 1. In Visual Studio, click File, point to New, and then click Project. 2. In the New Project dialog box, in the Project types pane, click Other Project Types, and then click Visual Studio Solutions. 3. In the Templates pane, click Blank Solution. 4. Enter the name of your project in the Name field, and then click OK. By Dr. Xinwen Fu18

Outline  Installing and configuring Visual Studio 2010 to run an OpenCV example  Visual studio concepts  Tips of using Visual C++  Example code By Dr. Xinwen Fu19

Align C++ code in VS 2010  Often code is copied into a.cpp file and the formatting is lost  Reformatting the code – within vc++ Edit -> Advanced -> Format Selection By Dr. Xinwen Fu20

Enable Line Numbers in Visual C++/C# 2010  Tools -> Options -> Text Editor -> C/C++ -> check Line Numbers -> OK By Dr. Xinwen Fu21

StartUp project in a soluton  Select a StartUp project and click to debug it Right click the project and select it By Dr. Xinwen Fu22

Debugging with command-line parameters in Visual Studio  In VS 2008, 2010, or 2012, right-click the project, choose properties, go to the Debugging section there is a box for command line arguments By Dr. Xinwen Fu23

Zoom in/out with Visual Studio 2010 editor  Zoom in, Ctrl+Shift+period  Zoom out, Ctrl+Shift+comma By Dr. Xinwen Fu24

Change the color of ink of Powerpoint  Change the color of ink before starting a slide show On the Slide Show menu, click Set Up Show. In the Pen color box, click the color you want, and then click OK.  Change the ink color during a slide show On the Slide Show toolbar, click or tap the pointer arrow, point to Ink Color, and then click the color you want. Note Changing the color of the ink during the slide show affects the ink for the ballpoint and felt tip pens only.  Change the color of ink on a Tablet PC Select the ink you want to format.  On the Ink Drawing and Writing or Ink Annotations toolbar, tap Select Objects.  Tap the ink. Sizing handles and an outline of the ink shapes indicate that the ink is selected. On the Ink Drawing and Writing or Ink Annotations toolbar, tap the arrow next to Line Color. Tap the color you want to use.  Tip After you select a color, the Line Color button displays that color. You can apply the same color again to any ink selection by clicking or tapping Line Color again. By Dr. Xinwen Fu25

Outline  Installing and configuring Visual Studio 2010 to run an OpenCV example  Visual studio concepts  Tips of using Visual C++  Example code By Dr. Xinwen Fu26

By Dr. Xinwen Fu27 OpenCV 2 Example DisplayImage.cpp

1. #include 2. #include 3. #include 4. using namespace std; 5. using namespace cv; 6. int main(){ 7. Mat m; 8. VideoCapture cap; 9. cap.open(0); 10. cout<<cap.isOpened()<<endl; 11. namedWindow("window",1); 12. while(1){ 13. cap>>m; 14. imshow("window",m); 15. waitKey(33); 16. } 17. return 0; 18. } By Dr. Xinwen Fu28 Video Capture Example

By Dr. Xinwen Fu29 OpenCV 1 Example

cv Namespace  All OpenCV classes and functions are in the cv namespace.  Therefore, to access this functionality from your code, use the cv:: specifier or using namespace cv; directive: 1. #include "opencv2/core/core.hpp" cv::Mat H = cv::findHomography(points1, points2, CV_RANSAC, 5); or 1. #include "opencv2/core/core.hpp" 2. using namespace cv; Mat H = findHomography(points1, points2, CV_RANSAC, 5 ); By Dr. Xinwen Fu30

References  Application Development in Visual Studio Application Development in Visual Studio By Dr. Xinwen Fu31