Normalize whitespace in documentation and text files
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -20,7 +20,7 @@ In MacOS it can be done using the following command in Terminal:
|
||||
|
||||
cd ~/<my_working _directory>
|
||||
git clone https://github.com/Itseez/opencv.git
|
||||
|
||||
|
||||
|
||||
Building OpenCV from Source, using CMake and Command Line
|
||||
=========================================================
|
||||
@@ -28,10 +28,10 @@ Building OpenCV from Source, using CMake and Command Line
|
||||
#. Make symbolic link for Xcode to let OpenCV build scripts find the compiler, header files etc.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
|
||||
cd /
|
||||
sudo ln -s /Applications/Xcode.app/Contents/Developer Developer
|
||||
|
||||
|
||||
#. Build OpenCV framework:
|
||||
|
||||
.. code-block:: bash
|
||||
|
@@ -11,7 +11,7 @@ Prerequisites
|
||||
|
||||
1. Having installed `Eclipse <http://www.eclipse.org/>`_ in your workstation (only the CDT plugin for C/C++ is needed). You can follow the following steps:
|
||||
|
||||
* Go to the Eclipse site
|
||||
* Go to the Eclipse site
|
||||
|
||||
* Download `Eclipse IDE for C/C++ Developers <http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/heliossr2>`_ . Choose the link according to your workstation.
|
||||
|
||||
@@ -20,7 +20,7 @@ Prerequisites
|
||||
Making a project
|
||||
=================
|
||||
|
||||
1. Start Eclipse. Just run the executable that comes in the folder.
|
||||
1. Start Eclipse. Just run the executable that comes in the folder.
|
||||
|
||||
#. Go to **File -> New -> C/C++ Project**
|
||||
|
||||
@@ -28,13 +28,13 @@ Making a project
|
||||
:alt: Eclipse Tutorial Screenshot 0
|
||||
:align: center
|
||||
|
||||
#. Choose a name for your project (i.e. DisplayImage). An **Empty Project** should be okay for this example.
|
||||
#. Choose a name for your project (i.e. DisplayImage). An **Empty Project** should be okay for this example.
|
||||
|
||||
.. image:: images/a1.png
|
||||
:alt: Eclipse Tutorial Screenshot 1
|
||||
:align: center
|
||||
|
||||
#. Leave everything else by default. Press **Finish**.
|
||||
#. Leave everything else by default. Press **Finish**.
|
||||
|
||||
#. Your project (in this case DisplayImage) should appear in the **Project Navigator** (usually at the left side of your window).
|
||||
|
||||
@@ -45,7 +45,7 @@ Making a project
|
||||
|
||||
#. Now, let's add a source file using OpenCV:
|
||||
|
||||
* Right click on **DisplayImage** (in the Navigator). **New -> Folder** .
|
||||
* Right click on **DisplayImage** (in the Navigator). **New -> Folder** .
|
||||
|
||||
.. image:: images/a4.png
|
||||
:alt: Eclipse Tutorial Screenshot 4
|
||||
@@ -76,9 +76,9 @@ Making a project
|
||||
image = imread( argv[1], 1 );
|
||||
|
||||
if( argc != 2 || !image.data )
|
||||
{
|
||||
{
|
||||
printf( "No image data \n" );
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
namedWindow( "Display Image", CV_WINDOW_AUTOSIZE );
|
||||
@@ -102,7 +102,7 @@ Making a project
|
||||
:align: center
|
||||
|
||||
.. note::
|
||||
If you do not know where your opencv files are, open the **Terminal** and type:
|
||||
If you do not know where your opencv files are, open the **Terminal** and type:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@@ -112,56 +112,56 @@ Making a project
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-I/usr/local/include/opencv -I/usr/local/include
|
||||
-I/usr/local/include/opencv -I/usr/local/include
|
||||
|
||||
|
||||
b. Now go to **GCC C++ Linker**,there you have to fill two spaces:
|
||||
|
||||
First in **Library search path (-L)** you have to write the path to where the opencv libraries reside, in my case the path is:
|
||||
::
|
||||
|
||||
|
||||
/usr/local/lib
|
||||
|
||||
|
||||
Then in **Libraries(-l)** add the OpenCV libraries that you may need. Usually just the 3 first on the list below are enough (for simple applications) . In my case, I am putting all of them since I plan to use the whole bunch:
|
||||
|
||||
|
||||
opencv_core
|
||||
opencv_imgproc
|
||||
opencv_core
|
||||
opencv_imgproc
|
||||
opencv_highgui
|
||||
opencv_ml
|
||||
opencv_video
|
||||
opencv_ml
|
||||
opencv_video
|
||||
opencv_features2d
|
||||
opencv_calib3d
|
||||
opencv_objdetect
|
||||
opencv_calib3d
|
||||
opencv_objdetect
|
||||
opencv_contrib
|
||||
opencv_legacy
|
||||
opencv_legacy
|
||||
opencv_flann
|
||||
|
||||
.. image:: images/a10.png
|
||||
:alt: Eclipse Tutorial Screenshot 10
|
||||
:align: center
|
||||
|
||||
:align: center
|
||||
|
||||
If you don't know where your libraries are (or you are just psychotic and want to make sure the path is fine), type in **Terminal**:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
|
||||
pkg-config --libs opencv
|
||||
|
||||
|
||||
My output (in case you want to check) was:
|
||||
.. code-block:: bash
|
||||
|
||||
-L/usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann
|
||||
|
||||
-L/usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann
|
||||
|
||||
Now you are done. Click **OK**
|
||||
|
||||
* Your project should be ready to be built. For this, go to **Project->Build all**
|
||||
* Your project should be ready to be built. For this, go to **Project->Build all**
|
||||
|
||||
In the Console you should get something like
|
||||
In the Console you should get something like
|
||||
|
||||
.. image:: images/a12.png
|
||||
:alt: Eclipse Tutorial Screenshot 12
|
||||
:align: center
|
||||
:align: center
|
||||
|
||||
If you check in your folder, there should be an executable there.
|
||||
|
||||
@@ -179,21 +179,21 @@ So, now we have an executable ready to run. If we were to use the Terminal, we w
|
||||
Assuming that the image to use as the argument would be located in <DisplayImage_directory>/images/HappyLittleFish.png. We can still do this, but let's do it from Eclipse:
|
||||
|
||||
|
||||
#. Go to **Run->Run Configurations**
|
||||
#. Go to **Run->Run Configurations**
|
||||
|
||||
#. Under C/C++ Application you will see the name of your executable + Debug (if not, click over C/C++ Application a couple of times). Select the name (in this case **DisplayImage Debug**).
|
||||
#. Under C/C++ Application you will see the name of your executable + Debug (if not, click over C/C++ Application a couple of times). Select the name (in this case **DisplayImage Debug**).
|
||||
|
||||
#. Now, in the right side of the window, choose the **Arguments** Tab. Write the path of the image file we want to open (path relative to the workspace/DisplayImage folder). Let's use **HappyLittleFish.png**:
|
||||
|
||||
.. image:: images/a14.png
|
||||
:alt: Eclipse Tutorial Screenshot 14
|
||||
:align: center
|
||||
:align: center
|
||||
|
||||
#. Click on the **Apply** button and then in Run. An OpenCV window should pop up with the fish image (or whatever you used).
|
||||
|
||||
.. image:: images/a15.jpg
|
||||
:alt: Eclipse Tutorial Screenshot 15
|
||||
:align: center
|
||||
:align: center
|
||||
|
||||
#. Congratulations! You are ready to have fun with OpenCV using Eclipse.
|
||||
|
||||
@@ -238,7 +238,7 @@ Say you have or create a new file, *helloworld.cpp* in a directory called *foo*:
|
||||
ADD_EXECUTABLE( helloworld helloworld.cxx )
|
||||
TARGET_LINK_LIBRARIES( helloworld ${OpenCV_LIBS} )
|
||||
|
||||
#. Run: ``cmake-gui ..`` and make sure you fill in where opencv was built.
|
||||
#. Run: ``cmake-gui ..`` and make sure you fill in where opencv was built.
|
||||
|
||||
#. Then click ``configure`` and then ``generate``. If it's OK, **quit cmake-gui**
|
||||
|
||||
|
@@ -11,7 +11,7 @@ Using OpenCV with gcc and CMake
|
||||
* The easiest way of using OpenCV in your code is to use `CMake <http://www.cmake.org/>`_. A few advantages (taken from the Wiki):
|
||||
|
||||
#. No need to change anything when porting between Linux and Windows
|
||||
#. Can easily be combined with other tools by CMake( i.e. Qt, ITK and VTK )
|
||||
#. Can easily be combined with other tools by CMake( i.e. Qt, ITK and VTK )
|
||||
|
||||
* If you are not familiar with CMake, checkout the `tutorial <http://www.cmake.org/cmake/help/cmake_tutorial.html>`_ on its website.
|
||||
|
||||
@@ -21,7 +21,7 @@ Steps
|
||||
Create a program using OpenCV
|
||||
-------------------------------
|
||||
|
||||
Let's use a simple program such as DisplayImage.cpp shown below.
|
||||
Let's use a simple program such as DisplayImage.cpp shown below.
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
@@ -36,9 +36,9 @@ Let's use a simple program such as DisplayImage.cpp shown below.
|
||||
image = imread( argv[1], 1 );
|
||||
|
||||
if( argc != 2 || !image.data )
|
||||
{
|
||||
{
|
||||
printf( "No image data \n" );
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
namedWindow( "Display Image", CV_WINDOW_AUTOSIZE );
|
||||
|
@@ -11,8 +11,8 @@ Required Packages
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sudo apt-get install build-essential
|
||||
|
||||
sudo apt-get install build-essential
|
||||
|
||||
* CMake 2.6 or higher;
|
||||
* Git;
|
||||
* GTK+2.x or higher, including headers (libgtk2.0-dev);
|
||||
@@ -48,7 +48,7 @@ In Linux it can be achieved with the following command in Terminal:
|
||||
|
||||
cd ~/<my_working _directory>
|
||||
git clone https://github.com/Itseez/opencv.git
|
||||
|
||||
|
||||
|
||||
Building OpenCV from Source Using CMake, Using the Command Line
|
||||
===============================================================
|
||||
@@ -58,26 +58,26 @@ Building OpenCV from Source Using CMake, Using the Command Line
|
||||
#. Enter the <cmake_binary_dir> and type
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
|
||||
cmake [<some optional parameters>] <path to the OpenCV source directory>
|
||||
|
||||
For example
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
|
||||
cd ~/opencv
|
||||
mkdir release
|
||||
cd release
|
||||
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
|
||||
|
||||
|
||||
#. Enter the created temporary directory (<cmake_binary_dir>) and proceed with:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
|
||||
make
|
||||
sudo make install
|
||||
|
||||
.. note::
|
||||
|
||||
|
||||
If the size of the created library is a critical issue (like in case of an Android build) you can use the ``install/strip`` command to get the smallest size as possible. The *stripped* version appears to be twice as small. However, we do not recommend using this unless those extra megabytes do really matter.
|
||||
|
||||
|
@@ -5,8 +5,8 @@ Load, Modify, and Save an Image
|
||||
|
||||
.. note::
|
||||
|
||||
We assume that by now you know how to load an image using :imread:`imread <>` and to display it in a window (using :imshow:`imshow <>`). Read the :ref:`Display_Image` tutorial otherwise.
|
||||
|
||||
We assume that by now you know how to load an image using :imread:`imread <>` and to display it in a window (using :imshow:`imshow <>`). Read the :ref:`Display_Image` tutorial otherwise.
|
||||
|
||||
Goals
|
||||
======
|
||||
|
||||
@@ -35,9 +35,9 @@ Here it is:
|
||||
{
|
||||
char* imageName = argv[1];
|
||||
|
||||
Mat image;
|
||||
Mat image;
|
||||
image = imread( imageName, 1 );
|
||||
|
||||
|
||||
if( argc != 2 || !image.data )
|
||||
{
|
||||
printf( " No image data \n " );
|
||||
@@ -53,7 +53,7 @@ Here it is:
|
||||
namedWindow( "Gray image", CV_WINDOW_AUTOSIZE );
|
||||
|
||||
imshow( imageName, image );
|
||||
imshow( "Gray image", gray_image );
|
||||
imshow( "Gray image", gray_image );
|
||||
|
||||
waitKey(0);
|
||||
|
||||
@@ -67,18 +67,18 @@ Explanation
|
||||
|
||||
* Creating a Mat object to store the image information
|
||||
* Load an image using :imread:`imread <>`, located in the path given by *imageName*. Fort this example, assume you are loading a RGB image.
|
||||
|
||||
#. Now we are going to convert our image from RGB to Grayscale format. OpenCV has a really nice function to do this kind of transformations:
|
||||
|
||||
#. Now we are going to convert our image from RGB to Grayscale format. OpenCV has a really nice function to do this kind of transformations:
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
|
||||
cvtColor( image, gray_image, CV_RGB2GRAY );
|
||||
|
||||
As you can see, :cvt_color:`cvtColor <>` takes as arguments:
|
||||
|
||||
.. container:: enumeratevisibleitemswithsquare
|
||||
|
||||
* a source image (*image*)
|
||||
* a source image (*image*)
|
||||
* a destination image (*gray_image*), in which we will save the converted image.
|
||||
* an additional parameter that indicates what kind of transformation will be performed. In this case we use **CV_RGB2GRAY** (self-explanatory).
|
||||
|
||||
@@ -86,7 +86,7 @@ Explanation
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
imwrite( "../../images/Gray_Image.jpg", gray_image );
|
||||
imwrite( "../../images/Gray_Image.jpg", gray_image );
|
||||
|
||||
Which will save our *gray_image* as *Gray_Image.jpg* in the folder *images* located two levels up of my current location.
|
||||
|
||||
|
@@ -130,7 +130,7 @@ Building the library
|
||||
|
||||
#. Install |TortoiseGit|_. Choose the 32 or 64 bit version according to the type of OS you work in. While installing, locate your msysgit (if it doesn't do that automatically). Follow the wizard -- the default options are OK for the most part.
|
||||
|
||||
#. Choose a directory in your file system, where you will download the OpenCV libraries to. I recommend creating a new one that has short path and no special charachters in it, for example :file:`D:/OpenCV`. For this tutorial I'll suggest you do so. If you use your own path and know, what you're doing -- it's OK.
|
||||
#. Choose a directory in your file system, where you will download the OpenCV libraries to. I recommend creating a new one that has short path and no special charachters in it, for example :file:`D:/OpenCV`. For this tutorial I'll suggest you do so. If you use your own path and know, what you're doing -- it's OK.
|
||||
|
||||
a) Clone the repository to the selected directory. After clicking *Clone* button, a window will appear where you can select from what repository you want to download source files (https://github.com/Itseez/opencv.git) and to what directory (:file:`D:/OpenCV`).
|
||||
|
||||
|
@@ -10,16 +10,16 @@ I start out from the assumption that you have read and completed with success th
|
||||
:alt: You should have a folder looking like this.
|
||||
:align: center
|
||||
|
||||
The OpenCV libraries, distributed by us, on the Microsoft Windows operating system are in a **D**\ ynamic **L**\ inked **L**\ ibraries (*DLL*). These have the advantage that all the content of the library are loaded only at runtime, on demand, and that countless programs may use the same library file. This means that if you have ten applications using the OpenCV library, no need to have around a version for each one of them. Of course you need to have the *dll* of the OpenCV on all systems where you want to run your application.
|
||||
The OpenCV libraries, distributed by us, on the Microsoft Windows operating system are in a **D**\ ynamic **L**\ inked **L**\ ibraries (*DLL*). These have the advantage that all the content of the library are loaded only at runtime, on demand, and that countless programs may use the same library file. This means that if you have ten applications using the OpenCV library, no need to have around a version for each one of them. Of course you need to have the *dll* of the OpenCV on all systems where you want to run your application.
|
||||
|
||||
Another approach is to use static libraries that have *lib* extensions. You may build these by using our source files as described in the :ref:`Windows_Installation` tutorial. When you use this the library will be built-in inside your *exe* file. So there is no chance that the user deletes them, for some reason. As a drawback your application will be larger one and as, it will take more time to load it during its startup.
|
||||
|
||||
To build an application with OpenCV you need to do two things:
|
||||
To build an application with OpenCV you need to do two things:
|
||||
|
||||
.. container:: enumeratevisibleitemswithsquare
|
||||
|
||||
+ *Tell* to the compiler how the OpenCV library *looks*. You do this by *showing* it the header files.
|
||||
+ *Tell* to the linker from where to get the functions or data structures of OpenCV, when they are needed.
|
||||
+ *Tell* to the compiler how the OpenCV library *looks*. You do this by *showing* it the header files.
|
||||
+ *Tell* to the linker from where to get the functions or data structures of OpenCV, when they are needed.
|
||||
|
||||
If you use the *lib* system you must set the path where the library files are and specify in which one of them to look. During the build the linker will look into these libraries and add the definitions and implementation of all *used* functions and data structures to the executable file.
|
||||
|
||||
@@ -27,7 +27,7 @@ To build an application with OpenCV you need to do two things:
|
||||
|
||||
To pass on all this information to the Visual Studio IDE you can either do it globally (so all your future projects will get these information) or locally (so only for you current project). The advantage of the global one is that you only need to do it once; however, it may be undesirable to clump all your projects all the time with all these information. In case of the global one how you do it depends on the Microsoft Visual Studio you use. There is a **2008 and previous versions** and a **2010 way** of doing it. Inside the global section of this tutorial I'll show what the main differences are.
|
||||
|
||||
The base item of a project in Visual Studio is a solution. A solution may contain multiple projects. Projects are the building blocks of an application. Every project will realize something and you will have a main project in which you can put together this project puzzle. In case of the many simple applications (like many of the tutorials will be) you do not need to break down the application into modules. In these cases your main project will be the only existing one. Now go create a new solution inside Visual studio by going through the :menuselection:`File --> New --> Project` menu selection. Choose *Win32 Console Application* as type. Enter its name and select the path where to create it. Then in the upcoming dialog make sure you create an empty project.
|
||||
The base item of a project in Visual Studio is a solution. A solution may contain multiple projects. Projects are the building blocks of an application. Every project will realize something and you will have a main project in which you can put together this project puzzle. In case of the many simple applications (like many of the tutorials will be) you do not need to break down the application into modules. In these cases your main project will be the only existing one. Now go create a new solution inside Visual studio by going through the :menuselection:`File --> New --> Project` menu selection. Choose *Win32 Console Application* as type. Enter its name and select the path where to create it. Then in the upcoming dialog make sure you create an empty project.
|
||||
|
||||
.. image:: images/NewProjectVisualStudio.jpg
|
||||
:alt: Which options to select
|
||||
@@ -36,7 +36,7 @@ The base item of a project in Visual Studio is a solution. A solution may contai
|
||||
The *local* method
|
||||
==================
|
||||
|
||||
Every project is built separately from the others. Due to this every project has its own rule package. Inside this rule packages are stored all the information the *IDE* needs to know to build your project. For any application there are at least two build modes: a *Release* and a *Debug* one. The *Debug* has many features that exist so you can find and resolve easier bugs inside your application. In contrast the *Release* is an optimized version, where the goal is to make the application run as fast as possible or to be as small as possible. You may figure that these modes also require different rules to use during build. Therefore, there exist different rule packages for each of your build modes. These rule packages are called inside the IDE as *project properties* and you can view and modify them by using the *Property Manger*. You can bring up this with :menuselection:`View --> Property Pages`. Expand it and you can see the existing rule packages (called *Proporty Sheets*).
|
||||
Every project is built separately from the others. Due to this every project has its own rule package. Inside this rule packages are stored all the information the *IDE* needs to know to build your project. For any application there are at least two build modes: a *Release* and a *Debug* one. The *Debug* has many features that exist so you can find and resolve easier bugs inside your application. In contrast the *Release* is an optimized version, where the goal is to make the application run as fast as possible or to be as small as possible. You may figure that these modes also require different rules to use during build. Therefore, there exist different rule packages for each of your build modes. These rule packages are called inside the IDE as *project properties* and you can view and modify them by using the *Property Manger*. You can bring up this with :menuselection:`View --> Property Pages`. Expand it and you can see the existing rule packages (called *Proporty Sheets*).
|
||||
|
||||
.. image:: images/PropertyPageExample.jpg
|
||||
:alt: An example of Property Sheet
|
||||
@@ -55,10 +55,10 @@ Use for example the *OpenCV_Debug* name. Then by selecting the sheet :menuselect
|
||||
$(OPENCV_DIR)\include
|
||||
|
||||
.. image:: images/PropertySheetOpenCVInclude.jpg
|
||||
:alt: Add the include dir like this.
|
||||
:alt: Add the include dir like this.
|
||||
:align: center
|
||||
|
||||
When adding third party libraries settings it is generally a good idea to use the power behind the environment variables. The full location of the OpenCV library may change on each system. Moreover, you may even end up yourself with moving the install directory for some reason. If you would give explicit paths inside your property sheet your project will end up not working when you pass it further to someone else who has a different OpenCV install path. Moreover, fixing this would require to manually modifying every explicit path. A more elegant solution is to use the environment variables. Anything that you put inside a parenthesis started with a dollar sign will be replaced at runtime with the current environment variables value. Here comes in play the environment variable setting we already made in our :ref:`previous tutorial <WindowsSetPathAndEnviromentVariable>`.
|
||||
When adding third party libraries settings it is generally a good idea to use the power behind the environment variables. The full location of the OpenCV library may change on each system. Moreover, you may even end up yourself with moving the install directory for some reason. If you would give explicit paths inside your property sheet your project will end up not working when you pass it further to someone else who has a different OpenCV install path. Moreover, fixing this would require to manually modifying every explicit path. A more elegant solution is to use the environment variables. Anything that you put inside a parenthesis started with a dollar sign will be replaced at runtime with the current environment variables value. Here comes in play the environment variable setting we already made in our :ref:`previous tutorial <WindowsSetPathAndEnviromentVariable>`.
|
||||
|
||||
Next go to the :menuselection:`Linker --> General` and under the *"Additional Library Directories"* add the libs directory:
|
||||
|
||||
@@ -67,7 +67,7 @@ Next go to the :menuselection:`Linker --> General` and under the *"Additional Li
|
||||
$(OPENCV_DIR)\libs
|
||||
|
||||
.. image:: images/PropertySheetOpenCVLib.jpg
|
||||
:alt: Add the library folder like this.
|
||||
:alt: Add the library folder like this.
|
||||
:align: center
|
||||
|
||||
Then you need to specify the libraries in which the linker should look into. To do this go to the :menuselection:`Linker --> Input` and under the *"Additional Dependencies"* entry add the name of all modules which you want to use:
|
||||
@@ -77,7 +77,7 @@ Then you need to specify the libraries in which the linker should look into. To
|
||||
:align: center
|
||||
|
||||
.. image:: images/PropertySheetOpenCVLibrariesDebug.jpg
|
||||
:alt: Like this.
|
||||
:alt: Like this.
|
||||
:align: center
|
||||
|
||||
The names of the libraries are as follow:
|
||||
@@ -105,33 +105,33 @@ A full list, for the currently latest trunk version would contain:
|
||||
The letter *d* at the end just indicates that these are the libraries required for the debug. Now click ok to save and do the same with a new property inside the Release rule section. Make sure to omit the *d* letters from the library names and to save the property sheets with the save icon above them.
|
||||
|
||||
.. image:: images/PropertySheetOpenCVLibrariesRelease.jpg
|
||||
:alt: And the release ones.
|
||||
:alt: And the release ones.
|
||||
:align: center
|
||||
|
||||
You can find your property sheets inside your projects directory. At this point it is a wise decision to back them up into some special directory, to always have them at hand in the future, whenever you create an OpenCV project. Note that for Visual Studio 2010 the file extension is *props*, while for 2008 this is *vsprops*.
|
||||
You can find your property sheets inside your projects directory. At this point it is a wise decision to back them up into some special directory, to always have them at hand in the future, whenever you create an OpenCV project. Note that for Visual Studio 2010 the file extension is *props*, while for 2008 this is *vsprops*.
|
||||
|
||||
.. image:: images/PropertySheetInsideFolder.jpg
|
||||
:alt: And the release ones.
|
||||
:alt: And the release ones.
|
||||
:align: center
|
||||
|
||||
Next time when you make a new OpenCV project just use the "Add Existing Property Sheet..." menu entry inside the Property Manager to easily add the OpenCV build rules.
|
||||
Next time when you make a new OpenCV project just use the "Add Existing Property Sheet..." menu entry inside the Property Manager to easily add the OpenCV build rules.
|
||||
|
||||
.. image:: images/PropertyPageAddExisting.jpg
|
||||
:alt: Use this option.
|
||||
:alt: Use this option.
|
||||
:align: center
|
||||
|
||||
The *global* method
|
||||
===================
|
||||
|
||||
In case you find to troublesome to add the property pages to each and every one of your projects you can also add this rules to a *"global property page"*. However, this applies only to the additional include and library directories. The name of the libraries to use you still need to specify manually by using for instance: a Property page.
|
||||
In case you find to troublesome to add the property pages to each and every one of your projects you can also add this rules to a *"global property page"*. However, this applies only to the additional include and library directories. The name of the libraries to use you still need to specify manually by using for instance: a Property page.
|
||||
|
||||
In Visual Studio 2008 you can find this under the: :menuselection:`Tools --> Options --> Projects and Solutions --> VC++ Directories`.
|
||||
In Visual Studio 2008 you can find this under the: :menuselection:`Tools --> Options --> Projects and Solutions --> VC++ Directories`.
|
||||
|
||||
.. image:: images/VCDirectories2008.jpg
|
||||
:alt: VC++ Directories in VS 2008.
|
||||
:align: center
|
||||
|
||||
In Visual Studio 2010 this has been moved to a global property sheet which is automatically added to every project you create:
|
||||
In Visual Studio 2010 this has been moved to a global property sheet which is automatically added to every project you create:
|
||||
|
||||
.. image:: images/VCDirectories2010.jpg
|
||||
:alt: VC++ Directories in VS 2010.
|
||||
@@ -153,10 +153,10 @@ You can start a Visual Studio build from two places. Either inside from the *IDE
|
||||
|
||||
.. |voila| unicode:: voil U+00E1
|
||||
|
||||
This is important to remember when you code inside the code open and save commands. You're resources will be saved ( and queried for at opening!!!) relatively to your working directory. This is unless you give a full, explicit path as parameter for the I/O functions. In the code above we open :download:`this OpenCV logo<../../../../samples/cpp/tutorial_code/images/opencv-logo.png>`. Before starting up the application make sure you place the image file in your current working directory. Modify the image file name inside the code to try it out on other images too. Run it and |voila|:
|
||||
This is important to remember when you code inside the code open and save commands. You're resources will be saved ( and queried for at opening!!!) relatively to your working directory. This is unless you give a full, explicit path as parameter for the I/O functions. In the code above we open :download:`this OpenCV logo<../../../../samples/cpp/tutorial_code/images/opencv-logo.png>`. Before starting up the application make sure you place the image file in your current working directory. Modify the image file name inside the code to try it out on other images too. Run it and |voila|:
|
||||
|
||||
.. image:: images/SuccessVisualStudioWindows.jpg
|
||||
:alt: You should have this.
|
||||
:alt: You should have this.
|
||||
:align: center
|
||||
|
||||
Command line arguments with Visual Studio
|
||||
@@ -167,11 +167,11 @@ Throughout some of our future tutorials you'll see that the programs main input
|
||||
.. code-block:: bash
|
||||
:linenos:
|
||||
|
||||
D:
|
||||
D:
|
||||
CD OpenCV\MySolutionName\Release
|
||||
MySolutionName.exe exampleImage.jpg
|
||||
|
||||
Here I first changed my drive (if your project isn't on the OS local drive), navigated to my project and start it with an example image argument. While under Linux system it is common to fiddle around with the console window on the Microsoft Windows many people come to use it almost never. Besides, adding the same argument again and again while you are testing your application is, somewhat, a cumbersome task. Luckily, in the Visual Studio there is a menu to automate all this:
|
||||
Here I first changed my drive (if your project isn't on the OS local drive), navigated to my project and start it with an example image argument. While under Linux system it is common to fiddle around with the console window on the Microsoft Windows many people come to use it almost never. Besides, adding the same argument again and again while you are testing your application is, somewhat, a cumbersome task. Luckily, in the Visual Studio there is a menu to automate all this:
|
||||
|
||||
.. image:: images/VisualStudioCommandLineArguments.jpg
|
||||
:alt: Visual Studio Command Line Arguments
|
||||
|
Reference in New Issue
Block a user