<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Code explanation</title><link>https://sourceforge.net/p/robotics-vergence-control/wiki/Code%2520explanation/</link><description>Recent changes to Code explanation</description><atom:link href="https://sourceforge.net/p/robotics-vergence-control/wiki/Code%20explanation/feed" rel="self"/><language>en</language><lastBuildDate>Fri, 09 Feb 2018 09:08:12 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/robotics-vergence-control/wiki/Code%20explanation/feed" rel="self" type="application/rss+xml"/><item><title>Code explanation modified by Agostino Gibaldi</title><link>https://sourceforge.net/p/robotics-vergence-control/wiki/Code%2520explanation/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Agostino Gibaldi</dc:creator><pubDate>Fri, 09 Feb 2018 09:08:12 -0000</pubDate><guid>https://sourceforge.net1a41b316c947011cde63ccff9a21a75645c2588e</guid></item><item><title>Code explanation modified by Agostino Gibaldi</title><link>https://sourceforge.net/p/robotics-vergence-control/wiki/Code%2520explanation/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v6
+++ v7
@@ -84,13 +84,13 @@
     :::cpp
     VergenceControl.exe image_left.format image_right.format

-#####* test_single_image()*  (see [video][13]).
+#####* test_single_image()*  (see [video][13])
 This demo loads a stereo pair of size 540 x 960 pixels and computes the Vergence Control 20 times in a for loop. At the end it shows the computation time and the achieved FPS

-#####* test_mouse_scale()*  (see [video][13]).
+#####* test_mouse_scale()*  (see [video][13])
 This demo loads a stereo pair of size 540 x 960 pixels and rescales them to a smalle size. The images are shown as a single anaglyph image. Saccadic eye movements to a target are simulated allowing the user to click with the mouse on a image location. The Vergence Control is then computed at target location, and vergence movements are simulated warping the left and right image according to the vergence control. 
 Exemplifying, if the Vergence Control provides a convergence movement, the left image is shifted towards right, while the right image is shifted toward left, of a quantity proportional to the Vergence Control.
-The effectiveness of the Vergence Control can be directly evaluated because, is the algorithm is able to provide the correct Vergence Control, the binocular disparity at target location is nullified, and the anaglyh image at target turns to gray scale.
+The effectiveness of the Vergence Control can be directly evaluated because, is the algorithm is able to provide the correct Vergence Control, the binocular disparity at target location is nullified, and the anaglyph image at target turns to gray scale.

 [1]: https://sourceforge.net/p/robotics-vergence-control/wiki/Home/
 [2]: https://sourceforge.net/p/robotics-vergence-control/wiki/Install/
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Agostino Gibaldi</dc:creator><pubDate>Fri, 09 Feb 2018 08:17:42 -0000</pubDate><guid>https://sourceforge.net979bacc6c78a958cf369eb0f03d706a11d8bb0ea</guid></item><item><title>Code explanation modified by Agostino Gibaldi</title><link>https://sourceforge.net/p/robotics-vergence-control/wiki/Code%2520explanation/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v5
+++ v6
@@ -26,23 +26,23 @@

 **setVergenceGAIN** allows to set the gain for the Vergence Control, which will be tuned for the kinematics of the specific head you are using. To improve stability and performance, we recommend to add a PID or a Kalman Filter to your control.

-        :::cpp
-        POPULATION.setVergenceGAIN(float *GAIN);
+    :::cpp
+    POPULATION.setVergenceGAIN(float *GAIN);

 The input is a float array with 2 cells, the first for the horizontal vergence gain, the second for the vertical vergence gain.

 **getVergenceGAIN(float *GAIN)** returns as pointer  the gain for the Vergence Control

-        :::cpp
-        POPULATION.getVergenceGAIN(float *GAIN);
+    :::cpp
+    POPULATION.getVergenceGAIN(float *GAIN);

 The input is a float array with 2 cells, where the vergence gain is copied, the first for the horizontal vergence gain, the second for the vertical vergence gain.        

 **loadImg** and **loadImgFile** allow to load an image in the class from a OpenCV Mat or from an image.

-        :::cpp
-       POPULATION.loadImg(Mat IMG, char tag);
-       POPULATION.loadImgFile(string img_filename, char tag)
+    :::cpp
+    POPULATION.loadImg(Mat IMG, char tag);
+    POPULATION.loadImgFile(string img_filename, char tag)

 The input parameters are:

@@ -54,28 +54,28 @@

 **computeVergenceControl** this function actually computes the Vergence Control.

-        :::cpp
-        POPULATION.computeVergenceControl();
+    :::cpp
+    POPULATION.computeVergenceControl();

 **getVergence**, **getVergenceH**, and **getVergenceV**,  these functions return the computed Vergence Control.        

-        :::cpp
-        Scalar* VC = POPULATION.getVergence();
-        float VH = POPULATION.getVergenceH();
-       float VV = POPULATION.getVergenceV();
+    :::cpp
+    Scalar* VC = POPULATION.getVergence();
+    float VH = POPULATION.getVergenceH();
+    float VV = POPULATION.getVergenceV();

  The output of these functions is a Scalar of floats with two cells for *getVergence*, and a float for *getVergenceH* and *getVergenceV*.

 **printVergence** this function prints to screen the computed horizontal and vertical vergence control, together with the estimated FPS

-        :::cpp
-        POPULATION.printVergence();
+    :::cpp
+    POPULATION.printVergence();

 **setCenter**: the Vergence control is computed to align the cameras on the center of the stereo image. This function allows to set the area on the image where to compute the Vergence Control in a position different form the center. This feature is used for instance to compute the vergence demand at target location before executing a saccade in depth. The theory is explained in the [related paper][6]. In the DEMO it is used to verge on different parts of the stereo image (see [video][13].

-        :::cpp
-        POPULATION.setCenter(Point2d cntr)
+    :::cpp
+    POPULATION.setCenter(Point2d cntr)

 #### The provided demo
 #####* Use the .exe file*
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Agostino Gibaldi</dc:creator><pubDate>Fri, 09 Feb 2018 08:11:42 -0000</pubDate><guid>https://sourceforge.net041dce73c1101e1dbe1a1ed3478081bbd3c7720e</guid></item><item><title>Code explanation modified by Agostino Gibaldi</title><link>https://sourceforge.net/p/robotics-vergence-control/wiki/Code%2520explanation/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v4
+++ v5
@@ -8,7 +8,7 @@

 ## Code Explanation

-#### Use the Vergence Control on your robot
+#### Description of the functions
 The Vergence Control is implemented as a C/C++ class, called *vergCLASS*. 

 **vergCLASS** is the default construtor: 
@@ -77,14 +77,20 @@
         :::cpp
         POPULATION.setCenter(Point2d cntr)

-#### Use the Vergence Control in the provided demo
+#### The provided demo
 #####* Use the .exe file*
 From the command windows navigate to the folder containing the compiled project. To compute the vergence ontrol on a single image pair, use the following command:

     :::cpp
     VergenceControl.exe image_left.format image_right.format

+#####* test_single_image()*  (see [video][13]).
+This demo loads a stereo pair of size 540 x 960 pixels and computes the Vergence Control 20 times in a for loop. At the end it shows the computation time and the achieved FPS

+#####* test_mouse_scale()*  (see [video][13]).
+This demo loads a stereo pair of size 540 x 960 pixels and rescales them to a smalle size. The images are shown as a single anaglyph image. Saccadic eye movements to a target are simulated allowing the user to click with the mouse on a image location. The Vergence Control is then computed at target location, and vergence movements are simulated warping the left and right image according to the vergence control. 
+Exemplifying, if the Vergence Control provides a convergence movement, the left image is shifted towards right, while the right image is shifted toward left, of a quantity proportional to the Vergence Control.
+The effectiveness of the Vergence Control can be directly evaluated because, is the algorithm is able to provide the correct Vergence Control, the binocular disparity at target location is nullified, and the anaglyh image at target turns to gray scale.

 [1]: https://sourceforge.net/p/robotics-vergence-control/wiki/Home/
 [2]: https://sourceforge.net/p/robotics-vergence-control/wiki/Install/
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Agostino Gibaldi</dc:creator><pubDate>Fri, 09 Feb 2018 08:08:16 -0000</pubDate><guid>https://sourceforge.net2a7ac4fc4c55db59d29450109ca64f0124f88a44</guid></item><item><title>Code explanation modified by Agostino Gibaldi</title><link>https://sourceforge.net/p/robotics-vergence-control/wiki/Code%2520explanation/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -30,6 +30,13 @@
         POPULATION.setVergenceGAIN(float *GAIN);

 The input is a float array with 2 cells, the first for the horizontal vergence gain, the second for the vertical vergence gain.
+
+**getVergenceGAIN(float *GAIN)** returns as pointer  the gain for the Vergence Control
+
+        :::cpp
+        POPULATION.getVergenceGAIN(float *GAIN);
+        
+The input is a float array with 2 cells, where the vergence gain is copied, the first for the horizontal vergence gain, the second for the vertical vergence gain.        

 **loadImg** and **loadImgFile** allow to load an image in the class from a OpenCV Mat or from an image.

@@ -64,6 +71,11 @@

         :::cpp
         POPULATION.printVergence();
+        
+**setCenter**: the Vergence control is computed to align the cameras on the center of the stereo image. This function allows to set the area on the image where to compute the Vergence Control in a position different form the center. This feature is used for instance to compute the vergence demand at target location before executing a saccade in depth. The theory is explained in the [related paper][6]. In the DEMO it is used to verge on different parts of the stereo image (see [video][13].
+
+        :::cpp
+        POPULATION.setCenter(Point2d cntr)

 #### Use the Vergence Control in the provided demo
 #####* Use the .exe file*
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Agostino Gibaldi</dc:creator><pubDate>Fri, 09 Feb 2018 07:56:52 -0000</pubDate><guid>https://sourceforge.netcfb9f9272393b998f0671789b1da3e8421d6b0b8</guid></item><item><title>Code explanation modified by Agostino Gibaldi</title><link>https://sourceforge.net/p/robotics-vergence-control/wiki/Code%2520explanation/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -10,12 +10,60 @@

 #### Use the Vergence Control on your robot
 The Vergence Control is implemented as a C/C++ class, called *vergCLASS*. 
-The default construtor 
+
+**vergCLASS** is the default construtor: 

     :::cpp
     vergCLASS POPULATION(int SX, int SY, string filter_filename, string vergence_weights_filename, int channles);

- takes five input parameters
+ takes five input parameters:
+ 
+ -  *int SX*: is the width of the  image from the robot cameras
+ -  *int SY*: is the height of the  image from the robot cameras
+ -  *string filter_filename*: is the string containing path and name of a *.ini* file containing the parameters to design the Gabor filters (provided)
+ -  *string vergence_weights_filename*: is the string containing path and name of a *.bin* file containing the weights used to compute the Vergence Control
+ -  *int channles*: defines the number of channels contained in the weights file (not used). In this version of the software the vergence channels are two, one for **horizontal vergence** and one for **vertical vergence**
+
+**setVergenceGAIN** allows to set the gain for the Vergence Control, which will be tuned for the kinematics of the specific head you are using. To improve stability and performance, we recommend to add a PID or a Kalman Filter to your control.
+
+        :::cpp
+        POPULATION.setVergenceGAIN(float *GAIN);
+        
+The input is a float array with 2 cells, the first for the horizontal vergence gain, the second for the vertical vergence gain.
+
+**loadImg** and **loadImgFile** allow to load an image in the class from a OpenCV Mat or from an image.
+
+        :::cpp
+       POPULATION.loadImg(Mat IMG, char tag);
+       POPULATION.loadImgFile(string img_filename, char tag)
+
+The input parameters are:
+
+- *Mat IMG*: the image to be loaded from a Mat
+- *string img_filename*:  the string containing path and name of a image to be loaded
+- *char tag*: a character that defines if you are uploading the let ('L') or the right ('R') image.
+
+At each iteration of the Vergence Control you have to read both the left and the right image from the stereo cameras.
+
+**computeVergenceControl** this function actually computes the Vergence Control.
+
+        :::cpp
+        POPULATION.computeVergenceControl();
+        
+**getVergence**, **getVergenceH**, and **getVergenceV**,  these functions return the computed Vergence Control.        
+
+        :::cpp
+        Scalar* VC = POPULATION.getVergence();
+        float VH = POPULATION.getVergenceH();
+       float VV = POPULATION.getVergenceV();
+        
+ The output of these functions is a Scalar of floats with two cells for *getVergence*, and a float for *getVergenceH* and *getVergenceV*.
+ 
+ 
+**printVergence** this function prints to screen the computed horizontal and vertical vergence control, together with the estimated FPS
+
+        :::cpp
+        POPULATION.printVergence();

 #### Use the Vergence Control in the provided demo
 #####* Use the .exe file*
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Agostino Gibaldi</dc:creator><pubDate>Fri, 09 Feb 2018 07:47:54 -0000</pubDate><guid>https://sourceforge.netc22dd723110f32dd404dd23516e089043d6868e5</guid></item><item><title>Code explanation modified by Agostino Gibaldi</title><link>https://sourceforge.net/p/robotics-vergence-control/wiki/Code%2520explanation/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -6,6 +6,23 @@
 ######- [&lt;u&gt;Vergence control&lt;/u&gt;][4]
 ######- [&lt;u&gt;Control Evaluation&lt;/u&gt;][5]

+## Code Explanation
+
+#### Use the Vergence Control on your robot
+The Vergence Control is implemented as a C/C++ class, called *vergCLASS*. 
+The default construtor 
+
+    :::cpp
+    vergCLASS POPULATION(int SX, int SY, string filter_filename, string vergence_weights_filename, int channles);
+    
+ takes five input parameters
+    
+#### Use the Vergence Control in the provided demo
+#####* Use the .exe file*
+From the command windows navigate to the folder containing the compiled project. To compute the vergence ontrol on a single image pair, use the following command:
+
+    :::cpp
+    VergenceControl.exe image_left.format image_right.format

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Agostino Gibaldi</dc:creator><pubDate>Fri, 09 Feb 2018 07:24:45 -0000</pubDate><guid>https://sourceforge.netfaf8b464034aeb7bfb811a607ed84f91bf9fbc43</guid></item><item><title>Code explanation modified by Agostino Gibaldi</title><link>https://sourceforge.net/p/robotics-vergence-control/wiki/Code%2520explanation/</link><description>&lt;div class="markdown_content"&gt;&lt;h6 id="-wzxhzdk0overview-and-creditswzxhzdk1"&gt;- &lt;a href="https://sourceforge.net/p/robotics-vergence-control/wiki/Home/"&gt;&lt;u&gt;Overview and credits&lt;/u&gt;&lt;/a&gt;&lt;/h6&gt;
&lt;h6 id="-wzxhzdk2how-to-installwzxhzdk3"&gt;- &lt;a href="https://sourceforge.net/p/robotics-vergence-control/wiki/Install/"&gt;&lt;u&gt;How to install&lt;/u&gt;&lt;/a&gt;&lt;/h6&gt;
&lt;h6 id="-wzxhzdk4demo-videowzxhzdk5"&gt;- &lt;a href="https://sourceforge.net/p/robotics-vergence-control/wiki/Usage/"&gt;&lt;u&gt;Demo video&lt;/u&gt;&lt;/a&gt;&lt;/h6&gt;
&lt;h6 id="-wzxhzdk6code-explanationwzxhzdk7"&gt;- &lt;a href="https://sourceforge.net/p/robotics-vergence-control/wiki/Code%20explanation/"&gt;&lt;u&gt;Code explanation&lt;/u&gt;&lt;/a&gt;&lt;/h6&gt;
&lt;h6 id="-wzxhzdk8binocular-energy-modelwzxhzdk9"&gt;- &lt;a href="https://sourceforge.net/p/robotics-vergence-control/wiki/BinEnergy/"&gt;&lt;u&gt;Binocular energy model&lt;/u&gt;&lt;/a&gt;&lt;/h6&gt;
&lt;h6 id="-wzxhzdk10vergence-controlwzxhzdk11"&gt;- &lt;a href="https://sourceforge.net/p/robotics-vergence-control/wiki/VergenceControl/"&gt;&lt;u&gt;Vergence control&lt;/u&gt;&lt;/a&gt;&lt;/h6&gt;
&lt;h6 id="-wzxhzdk12control-evaluationwzxhzdk13"&gt;- &lt;a href="https://sourceforge.net/p/robotics-vergence-control/wiki/Evaluation/"&gt;&lt;u&gt;Control Evaluation&lt;/u&gt;&lt;/a&gt;&lt;/h6&gt;
&lt;p&gt;&lt;span class="download-button-5a779e503bfd817113672d73" style="margin-bottom: 1em; display: block;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Agostino Gibaldi</dc:creator><pubDate>Fri, 09 Feb 2018 07:10:37 -0000</pubDate><guid>https://sourceforge.net9ad50f331513ec7db260697db98f3cddb5f0dd9f</guid></item></channel></rss>