Some reST syntax correction. Now the PDF documentation builds correctly under Windows using MIKTEX. Some update on the tutorial structure. Some CSS syntax correction. Windows Install Tutorial v0.4.
This commit is contained in:
@@ -9,43 +9,43 @@ Using OpenCV with Eclipse (plugin CDT)
|
||||
Prerequisites
|
||||
===============
|
||||
|
||||
#. 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:
|
||||
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
|
||||
|
||||
* 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.
|
||||
|
||||
#. Having installed OpenCV. If not yet, go :ref:`here <Linux_Installation>`
|
||||
#. Having installed OpenCV. If not yet, go :ref:`here <Linux-Installation>`.
|
||||
|
||||
Making a project
|
||||
=================
|
||||
|
||||
#. 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**
|
||||
|
||||
.. image:: images/Eclipse_Tutorial_Screenshot-0.png
|
||||
.. image:: images/a0.png
|
||||
:height: 400px
|
||||
: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.
|
||||
|
||||
.. image:: images/Eclipse_Tutorial_Screenshot-1.png
|
||||
.. image:: images/a1.png
|
||||
:height: 400px
|
||||
:alt: Eclipse Tutorial Screenshot 1
|
||||
:align: center
|
||||
|
||||
#. Leave everything else by default. Press **Finish**.
|
||||
|
||||
.. image:: images/Eclipse_Tutorial_Screenshot-2.png
|
||||
.. image:: images/a2.png
|
||||
:height: 400px
|
||||
:alt: Eclipse Tutorial Screenshot 2
|
||||
:align: center
|
||||
|
||||
#. Your project (in this case DisplayImage) should appear in the **Project Navigator** (usually at the left side of your window).
|
||||
|
||||
.. image:: images/Eclipse_Tutorial_Screenshot-3.png
|
||||
.. image:: images/a3.png
|
||||
:height: 400px
|
||||
:alt: Eclipse Tutorial Screenshot 3
|
||||
:align: center
|
||||
@@ -55,28 +55,28 @@ Making a project
|
||||
|
||||
* Right click on **DisplayImage** (in the Navigator). **New -> Folder** .
|
||||
|
||||
.. image:: images/Eclipse_Tutorial_Screenshot-4.png
|
||||
.. image:: images/a4.png
|
||||
:height: 400px
|
||||
:alt: Eclipse Tutorial Screenshot 4
|
||||
:align: center
|
||||
|
||||
* Name your folder **src** and then hit **Finish**
|
||||
|
||||
.. image:: images/Eclipse_Tutorial_Screenshot-5.png
|
||||
.. image:: images/a5.png
|
||||
:height: 400px
|
||||
:alt: Eclipse Tutorial Screenshot 5
|
||||
:align: center
|
||||
|
||||
* Right click on your newly created **src** folder. Choose **New source file**:
|
||||
|
||||
.. image:: images/Eclipse_Tutorial_Screenshot-6.png
|
||||
.. image:: images/a6.png
|
||||
:height: 400px
|
||||
:alt: Eclipse Tutorial Screenshot 6
|
||||
:align: center
|
||||
|
||||
* Call it **DisplayImage.cpp**. Hit **Finish**
|
||||
|
||||
.. image:: images/Eclipse_Tutorial_Screenshot-7.png
|
||||
.. image:: images/a7.png
|
||||
:height: 400px
|
||||
:alt: Eclipse Tutorial Screenshot 7
|
||||
:align: center
|
||||
@@ -114,10 +114,10 @@ Making a project
|
||||
*
|
||||
Go to **Project-->Properties**
|
||||
|
||||
.. image:: images/Eclipse_Tutorial_Screenshot-8.png
|
||||
:height: 400px
|
||||
:alt: Eclipse Tutorial Screenshot 8
|
||||
:align: center
|
||||
.. image:: images/a8.png
|
||||
:height: 400px
|
||||
:alt: Eclipse Tutorial Screenshot 8
|
||||
:align: center
|
||||
|
||||
*
|
||||
In **C/C++ Build**, click on **Settings**. At the right, choose the **Tool Settings** Tab. Here we will enter the headers and libraries info:
|
||||
@@ -125,7 +125,7 @@ Making a project
|
||||
a.
|
||||
In **GCC C++ Compiler**, go to **Includes**. In **Include paths(-l)** you should include the path of the folder where opencv was installed. In our example, this is ``/usr/local/include/opencv``.
|
||||
|
||||
.. image:: images/Eclipse_Tutorial_Screenshot-9.png
|
||||
.. image:: images/a9.png
|
||||
:height: 400px
|
||||
:alt: Eclipse Tutorial Screenshot 9
|
||||
:align: center
|
||||
@@ -134,7 +134,7 @@ Making a project
|
||||
If you do not know where your opencv files are, open the **Terminal** and type:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
|
||||
pkg-config --cflags opencv
|
||||
|
||||
For instance, that command gave me this output:
|
||||
@@ -143,57 +143,82 @@ Making a project
|
||||
|
||||
-I/usr/local/include/opencv -I/usr/local/include
|
||||
|
||||
|
||||
|
||||
b.
|
||||
Now go to **GCC C++ Linker**,there you have to fill two spaces:
|
||||
|
||||
* In **Library search path (-L)** you have to write the path to where the opencv libraries reside, in my case the path is:
|
||||
::
|
||||
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
|
||||
|
||||
..
|
||||
|
||||
*
|
||||
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_highgui
|
||||
* opencv_ml
|
||||
* opencv_video
|
||||
* opencv_features2d
|
||||
* opencv_calib3d
|
||||
* opencv_objdetect
|
||||
* opencv_contrib
|
||||
* opencv_legacy
|
||||
* opencv_flann
|
||||
::
|
||||
|
||||
.. image:: images/Eclipse_Tutorial_Screenshot-10.png
|
||||
:height: 400px
|
||||
:alt: Eclipse Tutorial Screenshot 10
|
||||
:align: center
|
||||
/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:
|
||||
|
||||
.. note::
|
||||
* 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:
|
||||
|
||||
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**:
|
||||
opencv_core
|
||||
opencv_imgproc
|
||||
opencv_highgui
|
||||
opencv_ml
|
||||
opencv_video
|
||||
opencv_features2d
|
||||
opencv_calib3d
|
||||
opencv_objdetect
|
||||
opencv_contrib
|
||||
opencv_legacy
|
||||
opencv_flann
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
* opencv_core
|
||||
* opencv_imgproc
|
||||
* opencv_highgui
|
||||
* opencv_ml
|
||||
* opencv_video
|
||||
* opencv_features2d
|
||||
* opencv_calib3d
|
||||
* opencv_objdetect
|
||||
* opencv_contrib
|
||||
* opencv_legacy
|
||||
* opencv_flann
|
||||
|
||||
.. image:: images/Eclipse_Tutorial_Screenshot-10.png
|
||||
:height: 400px
|
||||
:alt: Eclipse Tutorial Screenshot 10
|
||||
:align: center
|
||||
.. image:: images/a10.png
|
||||
:height: 400px
|
||||
:alt: Eclipse Tutorial Screenshot 10
|
||||
:align: center
|
||||
|
||||
.. note::
|
||||
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**:
|
||||
|
||||
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
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
pkg-config --libs opencv
|
||||
pkg-config --libs opencv
|
||||
pkg-config --libs opencv
|
||||
|
||||
My output (in case you want to check) was:
|
||||
My output (in case you want to check) was:
|
||||
My output (in case you want to check) was:
|
||||
|
||||
.. code-block:: bash
|
||||
.. code-block:: bash
|
||||
.. 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
|
||||
-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**
|
||||
|
||||
Now you are done. Click **OK**
|
||||
|
||||
* Your project should be ready to be built. For this, go to **Project->Build all**
|
||||
|
||||
.. image:: images/Eclipse_Tutorial_Screenshot-11.png
|
||||
|
||||
.. image:: images/a11.png
|
||||
:height: 400px
|
||||
:alt: Eclipse Tutorial Screenshot 11
|
||||
:align: center
|
||||
@@ -201,6 +226,7 @@ Making a project
|
||||
In the Console you should get something like
|
||||
|
||||
.. image:: images/Eclipse_Tutorial_Screenshot-12.png
|
||||
.. image:: images/a12.png
|
||||
:height: 200px
|
||||
:alt: Eclipse Tutorial Screenshot 12
|
||||
:align: center
|
||||
@@ -218,12 +244,14 @@ So, now we have an executable ready to run. If we were to use the Terminal, we w
|
||||
cd src
|
||||
./DisplayImage ../images/HappyLittleFish.jpg
|
||||
|
||||
|
||||
Assuming that the image to use as the argument would be located in <DisplayImage_directory>/images/HappyLittleFish.jpg. We can still do this, but let's do it from Eclipse:
|
||||
|
||||
|
||||
#. Go to **Run->Run Configurations**
|
||||
|
||||
.. image:: images/Eclipse_Tutorial_Screenshot-13.png
|
||||
.. image:: images/a13.png
|
||||
:height: 300px
|
||||
:alt: Eclipse Tutorial Screenshot 13
|
||||
:align: center
|
||||
@@ -233,6 +261,7 @@ Assuming that the image to use as the argument would be located in <DisplayImage
|
||||
#. 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.jpg**:
|
||||
|
||||
.. image:: images/Eclipse_Tutorial_Screenshot-14.png
|
||||
.. image:: images/a14.png
|
||||
:height: 300px
|
||||
:alt: Eclipse Tutorial Screenshot 14
|
||||
:align: center
|
||||
@@ -240,8 +269,10 @@ Assuming that the image to use as the argument would be located in <DisplayImage
|
||||
#. 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/Eclipse_Tutorial_Screenshot-15.png
|
||||
.. image:: images/a15.png
|
||||
:alt: Eclipse Tutorial Screenshot 15
|
||||
:align: center
|
||||
|
||||
|
||||
#. Congratulations! You are ready to have fun with OpenCV using Eclipse.
|
||||
#. Congratulations! You are ready to have fun with OpenCV using Eclipse.
|
||||
|
Reference in New Issue
Block a user