Download presentation
Presentation is loading. Please wait.
Published byClaribel Watson Modified over 9 years ago
1
91.204.201 Computing IV Visual C++ 2010 Introduction with OpenCV 2.4.3 Example Xinwen Fu
2
CS@UML Reading Assignment Chapter one of the tutorials By Dr. Xinwen Fu2 http://finance.yahoo.com/news /the-college-degrees-with-the- highest-starting-salaries- 204949790.html
3
CS@UML 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
4
CS@UML Demo http://www.youtube.com/watch?v=cgo0UitHfp8 4
5
CS@UML How to install OpenCV 2.4.3 on Visual Studio 2010 OpenCV for Windows OpenCV Version 2.4.3 Visit http://kylehounslow.com/?page_id=75 for source code: there is some bug http://kylehounslow.com/?page_id=75 Some copy and pastables: Additional Include Directories: $(OPENCV_BUILD)\include Additional Library Directories: $(OPENCV_BUILD)\x86\vc10\lib By Dr. Xinwen Fu5
6
CS@UML How to install OpenCV 2.4.3 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
7
CS@UML 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
8
CS@UML 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
9
CS@UML 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
10
CS@UML 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
11
CS@UML 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
12
CS@UML 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
13
CS@UML 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
14
CS@UML 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
15
CS@UML 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
16
CS@UML 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
17
CS@UML 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
18
CS@UML 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
19
CS@UML 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
20
CS@UML 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
21
CS@UML Enable Line Numbers in Visual C++/C# 2010 Tools -> Options -> Text Editor -> C/C++ -> check Line Numbers -> OK By Dr. Xinwen Fu21
22
CS@UML 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
23
CS@UML 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
24
CS@UML Zoom in/out with Visual Studio 2010 editor Zoom in, Ctrl+Shift+period Zoom out, Ctrl+Shift+comma By Dr. Xinwen Fu24
25
CS@UML 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
26
CS@UML 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
27
CS@UML By Dr. Xinwen Fu27 OpenCV 2 Example DisplayImage.cpp
28
CS@UML 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
29
CS@UML By Dr. Xinwen Fu29 OpenCV 1 Example
30
CS@UML 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" 2.... 3. cv::Mat H = cv::findHomography(points1, points2, CV_RANSAC, 5); 4.... or 1. #include "opencv2/core/core.hpp" 2. using namespace cv; 3.... 4. Mat H = findHomography(points1, points2, CV_RANSAC, 5 ); 5.... By Dr. Xinwen Fu30
31
CS@UML References Application Development in Visual Studio Application Development in Visual Studio By Dr. Xinwen Fu31
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.