#. We are only missing one final step: To tell OpenCV where the OpenCV headers and libraries are. For this, do the following:
#. We are only missing one final step: To tell OpenCV where the OpenCV headers and libraries are. For this, do the following:
*
* Go to **Project-->Properties**
Go to **Project-->Properties**
.. image:: images/a8.png
.. image:: images/a8.png
:height: 400px
:height: 400px
:alt: Eclipse Tutorial Screenshot 8
:alt: Eclipse Tutorial Screenshot 8
:align: center
: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:
In **C/C++ Build**, click on **Settings**. At the right, choose the **Tool Settings** Tab. Here we will enter the headers and libraries info:
a.
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``.
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/a9.png
.. image:: images/a9.png
:height: 400px
:height: 400px
...
@@ -144,18 +141,15 @@ Making a project
...
@@ -144,18 +141,15 @@ Making a project
-I/usr/local/include/opencv -I/usr/local/include
-I/usr/local/include/opencv -I/usr/local/include
b.
b. Now go to **GCC C++ Linker**,there you have to fill two spaces:
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:
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
/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:
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:
* 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:
@@ -244,13 +208,11 @@ So, now we have an executable ready to run. If we were to use the Terminal, we w
...
@@ -244,13 +208,11 @@ So, now we have an executable ready to run. If we were to use the Terminal, we w
cd src
cd src
./DisplayImage ../images/HappyLittleFish.jpg
./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:
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:
@@ -260,7 +222,6 @@ Assuming that the image to use as the argument would be located in <DisplayImage
...
@@ -260,7 +222,6 @@ 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**:
#. 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**: