Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenCL module for PCL Introduction added #53

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Binary file removed blogweb/gsoc14/aimilitaru/images/CodeCogsEqn.gif
Binary file not shown.
Binary file removed blogweb/gsoc14/aimilitaru/images/CodeCogsEqn1.gif
Binary file not shown.
Binary file removed blogweb/gsoc14/aimilitaru/images/CodeCogsEqn2.gif
Binary file not shown.
Binary file removed blogweb/gsoc14/aimilitaru/images/CodeCogsEqn3.gif
Binary file not shown.
Binary file added blogweb/gsoc14/aimilitaru/images/debug_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added blogweb/gsoc14/aimilitaru/images/debug_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added blogweb/gsoc14/aimilitaru/images/debug_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added blogweb/gsoc14/aimilitaru/images/debug_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed blogweb/gsoc14/aimilitaru/images/latex1.jpg
Binary file not shown.
Binary file added blogweb/gsoc14/aimilitaru/images/result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added blogweb/gsoc14/aimilitaru/images/result10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added blogweb/gsoc14/aimilitaru/images/target.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added blogweb/gsoc14/aimilitaru/images/weight1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added blogweb/gsoc14/aimilitaru/images/weight2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
99 changes: 99 additions & 0 deletions blogweb/gsoc14/aimilitaru/status.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,106 @@ My status updates
T\. Vetter and V. Blanz, A Morphable Model For The Synthesis Of 3D Faces, Max-Planck-Institut, Tubingen, Germany


.. blogpost::
:title: Rigid and Non-Rigid Transformation ( Second phase )
:author: aimilitaru
:date: 17-07-2014

* **Introduction**

In the previous phase, it was presented how to obtain a statistical model from a set of face-meshes. The next step in our project is to "*match*" the mean face of the database, with the face of a random person, like the one in the picture below:


.. image:: images/target.png
:width: 650px
:height: 300px
:align: center


The matching is done by applying alternatively the following methods.



* **Rigid Registration**



This method is very similar to the Iterative Closest Point Cloud algorithm, because the goal is to estimate a rotation matrix and a translation vector that would move the average face to an optimal position, near the face of the kinect. Basically, it is required to minimize the error :math:`\epsilon = \sum ||\vec {y} - (R \cdot \vec{x} + \vec{t})||^2` and this is done by calculating the solution of this system in the least square sense. In order to calculate this solution, the system is first linearized using the Jacobian matrix.

Of course this process is applied iteratively, and below are presented a few stages of positioning of the model over the scan:

.. image:: images/debug_1.png
:width: 650px
:height: 300px
:align: center


.. image:: images/debug_2.png
:width: 650px
:height: 300px
:align: center


.. image:: images/debug_4.png
:width: 650px
:height: 300px
:align: center


.. image:: images/debug_5.png
:width: 650px
:height: 300px
:align: center





* **Non-Rigid Registration**



Once the model is roughly aligned, we need to modify the shape of the model to match the face from the scan. For this we make use of the eigenvectors computed in the previous phase and we calculate the optimal solution of this system: :math:`\vec {y} = P \cdot \vec{d} + \vec{model}`, where :math:`P` is the matrix of eigenvectors, :math:`\vec{model}` is the current form of the model and :math:`\vec{d}` is the vector of basis coefficients that need to be determined.

However, there is on more constraint to be applied and that is to minimize the sum :math:`\sum_i \frac{d_i}{\sigma_i}`, where :math:`\sigma_i` is the eigenvalue of the corresponding eigenvector. Therefore, to the Jacobian matrix of this system, we need to add a diagonal matrix with :math:`\frac{1}{\sigma_i}` on the diagonal and multiplied by a certain weight.

The purpose of this regualrization is to determine to what degree the face should be deformed. The eigenvectors are stored in the :math:`P` matrix in decreasing order according to their eigenvalues and their position in this sorting order determines whether they have a greater or a smaller influence on the shaping of the model. When the model is mostly overlapping with the face in the scan, more information can be drawn about the final figure, hence the weight specified above should be smaller . On the other hand, if the model is not yet aligned with the scan, the deforming should be smaller and thus the weight should be bigger. Below you can see how the model looks for several values of the weight:

.. image:: images/weight1.png
:width: 650px
:height: 300px
:align: center

.. image:: images/weight2.png
:width: 650px
:height: 300px
:align: center

Notice that the shaping process tends to return the same effect if the weight of the regularizing constraint exceeds a certain value.


* **Results**



As mentioned above, these functions are applied alternatively for a few number of times, and the following results were obtained:

.. image:: images/result.png
:width: 650px
:height: 300px
:align: center

The above picture was obtained after one iteration and the following one after 10:

.. image:: images/result10.png
:width: 650px
:height: 300px
:align: center

Also, below you can observe the precision of this method, the black figure representing the final version of the model and the green one representing the point cloud of the face:

.. image:: images/result_overlap.png
:width: 650px
:height: 300px
:align: center

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions blogweb/gsoc14/jdbarros/entries/status_06_24.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
.. blogpost::
:title: 1. Reduction of computational redundancy in cost aggregation in stereo matching.
:author: jilliam
:date: 21-06-2014

**INTRODUCTION**

A stereo image pair can be used to estimate the depth of a scene. To do so, it is necessary to perform pixel matching and find the correspondences in both images. Different methods for stereo correspondence have been proposed and they are classified in two classes:

- Correlation-based algorithms: Produce a dense set of correspondences.

- Feature-based algorithms: Produce a sparse set of correspondences.

Additionally, correlation-based algorithms are usually classified in two main groups, local (window-based) or global algorithms. However, some methods do not fit into any group, and are classified in between them.

The current work is based on correlation-based algorithms, more espefically local and window based-methods, intended for applications where a dense and fast output is required.

The input of the algorithm are two calibrated images, i.e. the camera geometry is known. The images are also rectified in order to limit the correspondence to a 1D search.

**CORRESPONDENCE ESTIMATION**

The general methodology for stereo vision local approaches can be summarized as follows. An energy cost is computed for every pixel p by using the reference and d-shifted right images:

.. math:: e \left(p,d \right) = min \left(|I_{l}(x,y)-I_{r}(x-d,y)|, \sigma \right)
:label: eq11

Then, the aggregated cost is computed by an adaptive sum of the per-pixel cost:

.. math:: E(p,d) = \dfrac{\displaystyle \sum_{q \in N(p)}w(p,q)e(q,d)}{\displaystyle \sum_{q \in N(p)}w(p,q)}
:label: eq12

Finally, a Winner-Takes-All method is used to find the best of all the disparity hypothesis:

.. math:: d(p) = argmin\{ E(p,d), d \in [ 0,..,D-1 ] \}
:label: eq13

This whole process is complex and time consuming since it is repeated for every hypothesis d.
A representation of the conventional approaches can be observed in next figure [Min1]_.

.. image:: figures/conventional_ca.png
:height: 240px
:align: center

Min et al. [Min1]_ introduced a new methodology to reduce the complexity, by finding a compact representation of the per-pixel likelihood, assuming that low values do not provide really informative support. In this case, only a pre-defined number of disparity candidates per pixel are selected to perform the cost aggregation step. The subset of disparity hypotheses correspond to the local maxima points in the profile of the likelihood function, previously pre-filtered to reduce the noise, as shown in the following example:

.. image:: figures/disp_cand_selection.png
:height: 240px
:align: center

The disparity hypotheses estimation and cost aggregation processes proposed by Min et al. are depicted in the next figure, where Sc is the subset of disparity hypothesis with size Dc:

.. image:: figures/compact_ca.png
:height: 240px
:align: center

.. [Min1] Min, D., Lu, J., & Do, M. N. "A revisit to cost aggregation in stereo matching: How far can we reduce its computational redundancy?." In IEEE International Conference on Computer Vision (ICCV), 2011 (pp. 1567-1574).
47 changes: 47 additions & 0 deletions blogweb/gsoc14/jdbarros/entries/status_06_28.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.. blogpost::
:title: 2. Implementation of local-based approach for stereo matching
:author: jilliam
:date: 28-06-2014

**INTRODUCTION**

In this post, I will briefly describe the current state of the stereo module and the new features added.

Currently, the stereo module encompass two matching local-based algorithms:
1. Block-based algorithm, which is programed using the Box-Filtering algorithm proposed in [McDonnell81]_.
2. Adaptive Cost 2-pass Scanline Optimization, presented in [Wang06]_.
Both methods use the Sum of Absolute Differences (SAD) as the dissimilarity measure.

As mentioned in the previous blog, the first objective of the present project is to implement the local-based approach proposed in [Min1]_, for dense correspondence estimation in a pair of grayscale rectified images with an efficient cost aggregation step. Additionally, the cost aggregation step in based on the method presented in [Yoon06]_, where the weighting function uses a similarity measure based on the color and spatial distances.

**DETAILS**

In order to do so, a new class CompactRepresentationStereoMatching was created in the stereo module. This class inherits from class GrayStereoMatching, which in turns inherits from class StereoMatching, since some pre and post-processing methods are re-implemented.
The new class has five member functions with public access: setRadius, set FilterRadius and setNumDispCandidates, setGammaS, setGammaC, which set three data members of type int (radius, filter_radius and num_disp_candidates) and two of type double (gamma_c and gamma_s) with private access, as well as implementing the virtual method compute_impl.

**radius** corresponds to the radius of the cost aggregation window, with default value equal to 5.

**filter_radius** corresponds to the radius of the box filter used for the computation of the likelihood function. The default value is 5.

**num_disp_candidates** is the number of the subset of the disparity hypotheses used for the cost aggregation. The default value is 60.

**gamma_c** is the spatial bandwidth used for cost aggregation based on adaptive weights. The default value is 15.

**gamma_s** is the color bandwidth used for cost aggregation based on adaptive weights. The default value is 25.

Similarly to the previous methods, the current class is based on the SAD matching function, and it estimates the per-pixel cost efficiently using the Box-Filtering algorithm.

To test the algorithm, the Middlebury stereo benchmark (http://vision.middlebury.edu/stereo/) dataset is going to be used.

.. image:: figures/Middlebury_dataset.png
:height: 240px
:align: center

.. [McDonnell81] McDonnell, M. J. "Box-filtering techniques". Computer Graphics and Image Processing 17.1, 65-70, 1981.

.. [Wang06] Wang, Liang, et al. "High-quality real-time stereo using adaptive cost aggregation and dynamic programming." 3D Data Processing, Visualization, and Transmission, Third International Symposium on. IEEE, 2006.

.. [Yoon06] K.-J. Yoon and I.-S. Kweon. “Locally Adaptive Support-Weight Approach for Visual Correspondence Search”. In Proceedings of Conference on Computer Vision and Pattern Recognition (CVPR), 924–931, 2005.



57 changes: 2 additions & 55 deletions blogweb/gsoc14/jdbarros/status.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,58 +5,5 @@ My status updates
:nr_days: 60
:author: jilliam


.. blogpost::
:title: Reduction of computational redundancy in cost aggregation in stereo matching.
:author: jilliam
:date: 21-06-2014

**INTRODUCTION**
A stereo image pair can be used to estimate the depth of a scene. To do so, it is necessary to perform pixel matching and find the correspondences in both images. Different methods for stereo correspondence have been proposed and they are classified in two classes:
- Correlation-based algorithms: Produce a dense set of correspondences.
- Feature-based algorithms: Produce a sparse set of correspondences.

Additionally, correlation-based algorithms are usually classified in two main groups, local (window-based) or global algorithms. However, some methods do not fit into any group, and are classified in between them.

The current work is based on correlation-based algorithms, more espefically local and window based-methods, intended for applications where a dense and fast output is required.

The input of the algorithm are two calibrated images, i.e. the camera geometry is known. The images are also rectified in order to limit the correspondence to a 1D search.

**CORRESPONDENCE ESTIMATION**
The general methodology for stereo vision local approaches can be summarized as follows. An energy cost is computed for every pixel p by using the reference and d-shifted right images:

.. math:: e \left(p,d \right) = min \left(|I_{l}(x,y)-I_{r}(x-d,y)|, \sigma \right)
:label: eq11

Then, the aggregated cost is computed by an adaptive sum of the per-pixel cost:

.. math:: E(p,d) = \dfrac{\displaystyle \sum_{q \in N(p)}w(p,q)e(q,d)}{\displaystyle \sum_{q \in N(p)}w(p,q)}
:label: eq12

Finally, a Winner-Takes-All method is used to find the best of all the disparity hypothesis:

.. math:: d(p) = argmin E(p,d), d \in {[ 0,..,D-1 ]}
:label: eq13

This whole process is complex and time consuming since it is repeated for every hypothesis d.
A representation of the conventional approaches can be observed in next figure [Min1]_.

.. image:: figures/conventional_ca.png
:height: 240px
:align: center

Min et al. [Min1]_ introduced a new methodology to reduce the complexity, by finding a compact representation of the per-pixel likelihood, assuming that low values do not provide really informative support. In this case, only a pre-defined number of disparity candidates per pixel are selected to perform the cost aggregation step. The subset of disparity hypotheses correspond to the local maxima points in the profile of the likelihood function, previously pre-filtered to reduce the noise, as shown in the following example:

.. image:: figures/disp_cand_selection.png
:height: 240px
:align: center

The disparity hypotheses estimation and cost aggregation processes proposed by Min et al. are depicted in the next figure, where Sc is the subset of disparity hypothesis with size Dc:

.. image:: figures/compact_ca.png
:height: 240px
:align: center

.. [Min1] Min, D., Lu, J., & Do, M. N. "A revisit to cost aggregation in stereo matching: How far can we reduce its computational redundancy?." In IEEE International Conference on Computer Vision (ICCV), 2011 (pp. 1567-1574).


status_06_24
status_06_28
Binary file added blogweb/gsoc14/kdesingh/images/box.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added blogweb/gsoc14/kdesingh/images/box_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added blogweb/gsoc14/kdesingh/images/cylinder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added blogweb/gsoc14/kdesingh/images/plane.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added blogweb/gsoc14/kdesingh/images/plane_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added blogweb/gsoc14/kdesingh/images/sphere.png
Binary file added blogweb/gsoc14/kdesingh/images/sphere_image.png
45 changes: 44 additions & 1 deletion blogweb/gsoc14/kdesingh/status.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,47 @@ My status updates


Next post will have the details of how GRSD results are and how they differentiate the characteristics of two surfaces. GRSD code from the author will be integrated into the PCL code base. We also plan to categorize the pipeline into modules that fit into the PCL code base as features, surface and segmentation sections. These information will be posted in the next post.




.. blogpost::
:title: GRSD Descriptor computation and analysis
:author: kdesingh
:date: 28-07-2014

Global Radius-based surface descriptor concatenates the RSD descriptor as discussed in the previous post to represent the complete object.
GRSD gives a good description of the 3D shape of the object. Below are the set of objects and its GRSD descriptors i.e. histograms. I have
used University of Washington's "Large scale RGBD dataset" for the experiments.

For an object whose surface is planar but has 2 different planes in the view
.. image:: images/box_image.png
:height: 240px
.. image:: images/box.png
:height: 200px


For an object whose surface is planar but has 1 planes in the view
.. image:: images/plane_image.png
:height: 240px
.. image:: images/plane.png
:height: 200px

For an object whose surface is spherical
.. image:: images/sphere_image.png
:height: 240px
.. image:: images/sphere.png
:height: 200px

For an object whose surface is cylinderical but doesn't have any planar surface in view
.. image:: images/cylinder_image.png
:height: 240px
.. image:: images/cylinder.png
:height: 200px

It can be seen that all the descriptors are different from eachother. Planes and box surfaces are similar as the surface characteristics
are similar in this case.
Both GRSD and RSD are pushed into the pcl-trunk for people to use. The test files for these two features are also included in the trunk
for the basic usage of the same.

Currently working on the NURBS for small surface patches. Since NURBS are already available in PCL we will be looking at how to tailor the
same for our needs. After this we plan to work on the features that compute the relationship between the surface patches.
4 changes: 2 additions & 2 deletions blogweb/gsoc14/mgesto/all.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
All blog posts for My_Name
All blog posts for Manuel Gesto
-----------------------------

.. blogbody::
:author: my_username
:author: Manuel_Gesto
14 changes: 7 additions & 7 deletions blogweb/gsoc14/mgesto/index.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
My_name
Manuel Gesto
==========

:email: [email protected]
:project: What I will be doing this summer
:mentor:
:email: [email protected]
:project: Object Discovery in Kinfu Data
:mentor: Federico Tombari

About me
--------
Hello World
I am a Phd student that will be working on GSOC.

Recent status updates
---------------------

.. blogbody::
:author: my_username
:nr_posts: 5
:author: Manuel_Gesto
:nr_posts: 4



Expand Down
Loading