[SOLVED] data structure algorithm compiler operating system Demo Guideline

$25

File Name: data_structure_algorithm_compiler_operating_system_Demo_Guideline.zip
File Size: 612.3 KB

5/5 - (1 vote)

Demo Guideline

Download and Install Visual Studio

You can download from CityU CS MSDNAA Program

Download OpenCV
Installation by Using the Prebuilt Libraries
http:sourceforge.netprojectsopencvlibraryfilesopencvwin
Download OpenCV 2.4.13
Double Click to install OpenCV

After installation, in your OpenCV folder, you will see the Prebuild folder, we will use it directly.

set the environment variables OPENCV
Right Click ComputerProperties

Add new system variable OPENCV, the directory is where you have your OpenCV binaries.

Next, you need to add the bin folders path to the systems path. You can have different platform e.g. x64 instead of x86 and complier type e.g. vc12 instead of vc10, so substitute appropriate value. You may add both if you are not sure about the platform as;OPENCVx86vc10bin;OPENCVx64vc10bin;

Why need to set Path? This is because you will use the OpenCV library in form of Dynamiclink libraries, also known as DLL. Inside these are stored all the algorithms and information the OpenCV library contains. The operating system will load them only on demand, during runtime. However, to do this he needs to know where they are. The system PATH contains a list of folders where DLLs can be found. Add the OpenCV library path to this and the OS will know where to look if he ever needs the OpenCV binaries.

Note: If you are using the PCs in CSLab, OpenCV has already been installed. You can reach the path by running Path in the command line cmd.exe

Then you can find the installation path for OpenCV G:OpenCV2.4.13build in the above example. In the following steps, you should replace the OPENCV by this path.
Using OpenCV in Visual Studio
First, new a project in Visual Studio

Choose Win32 Console Application and name your project.

Choose Empty project and finish.

Now you will get your new project. Now you can add your source code file .cpp.

Copy one of demo code e.g. retrievalmain.cpp to your .cpp.

You note that the application doesnt know where to get the functions or data structures of OpenCV after you include the header files and tell to the compiler how the OpenCV library looks.

For using the opencv, you need to tell your project where to find OpenCV.
Add any .c.cpp file of OpenCV and Additional Library Directories to the project
Right Click your project, Click Properties

In Property Page, choose Configuration PropertiesVC Directories

In Include Directories, you should edit it by addingOPENCVinclude

In Library Directories, you should edit it by addingOPENCVx86vc10lib

Add the name of all modules which you want to use in OpenCV.
In Property Page, choose Configuration PropertiesLinkerInput

In Additional Dependencies, you should edit it by adding the related .lib. The names of the libraries are as follow:
opencvThe Name of the moduleThe version Number of the library you used.lib.
The letter d at the end just indicates that these are the libraries required for the debug.

opencvcalib3d2413d.lib
opencvcontrib2413d.lib
opencvcore2413d.lib
opencvfeatures2d2413d.lib
opencvflann2413d.lib
opencvhighgui2413d.lib
opencvgpu2413d.lib
opencvimgproc2413d.lib
opencvlegacy2413d.lib
opencvml2413d.lib
opencvnonfree2413d.lib
opencvobjdetect2413d.lib
opencvphoto2413d.lib
opencvstitching2413d.lib
opencvsuperres2413d.lib
opencvvideo2413d.lib
opencvvideostab2413d.lib
opencvts2413d.lib
opencvimgproc2413.lib
opencvlegacy2413.lib
opencvml2413.lib
opencvnonfree2413.lib
opencvobjdetect2413.lib
opencvphoto2413.lib
opencvstitching2413.lib
opencvsuperres2413.lib
opencvvideo2413.lib
opencvvideostab2413.lib
opencvts2413.lib
Now, you can build your project successfully.

Since the debug model is only for debug, thus it is very slow. When you test your program, you can run it in release mode.

After change to release mode, the application doesnt know where to get the functions or data structures of OpenCV again.
Thus you need to deploy it as the debug mode. The only difference is when editing the Additional Dependencies you should make sure to omit the d letters from the library names.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] data structure algorithm compiler operating system Demo Guideline
$25