Skip to content

Implementation of Quasi Dense Stereo algorithm. #1941

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

Merged
merged 29 commits into from
Dec 28, 2018
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
502770f
initial commit.
dimitrisPs Dec 10, 2018
e3301f4
Remove license header.
dimitrisPs Dec 12, 2018
529f8eb
Fix python wrap flags
dimitrisPs Dec 12, 2018
5952b83
Change std::string to cv::String, in function declarations, to resolv…
dimitrisPs Dec 12, 2018
6bb29e0
Add python wrapper extending header
dimitrisPs Dec 12, 2018
928a47f
Fix python wrapper conflicts
dimitrisPs Dec 12, 2018
17dde34
Fix implicit type conversions
dimitrisPs Dec 12, 2018
3f90782
Change C API types and enums to C++.
dimitrisPs Dec 13, 2018
8809463
Remove redundant included headers and move wanted headers to src/prec…
dimitrisPs Dec 13, 2018
791e823
Remove saturate header
dimitrisPs Dec 13, 2018
8062754
Remove unnecessary python wrapping flags
dimitrisPs Dec 13, 2018
0a4f040
Removed defaults parameter header
dimitrisPs Dec 14, 2018
19e42b0
Split declaration and implementation of the class using Pimpl.
dimitrisPs Dec 17, 2018
1d92960
Fix to comply with new public API.
dimitrisPs Dec 17, 2018
b81a070
Remove unnecessary modules
dimitrisPs Dec 17, 2018
e3c9eec
Fix maybe-uninitialized warnings on linux
dimitrisPs Dec 17, 2018
2738d12
Migration to stereo module
dimitrisPs Dec 17, 2018
2bb9994
Remove CV_PROP_RW flag.
dimitrisPs Dec 18, 2018
e2963f0
Remove CV_EXPORTS flags from class members.
dimitrisPs Dec 18, 2018
4d04ae7
Fix: Removed misplaced flag
dimitrisPs Dec 18, 2018
2c3b480
Remove empty lines.
dimitrisPs Dec 19, 2018
e2cdd27
Move queue to private headers.
dimitrisPs Dec 19, 2018
a7d0556
Fix default arguments of public methods.
dimitrisPs Dec 19, 2018
2d8d4ca
Add authors information and switch to the compact version of license …
dimitrisPs Dec 19, 2018
bb769ad
Reorganize and fix markdown files. Create a table of content and move…
dimitrisPs Dec 19, 2018
326d6d7
Change argument name dMatch->denseMatch, to avoid confusion with cv::…
dimitrisPs Dec 19, 2018
5775768
Remove duplicate snippet.
dimitrisPs Dec 19, 2018
045ad89
Fix: change vector resize to reserve.
dimitrisPs Dec 20, 2018
4a29108
Fix: replace extensive license header with the compact version.
dimitrisPs Dec 27, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions modules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ $ cmake -D OPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules -D BUILD_opencv_<r

- **plot**: Plotting -- The plot module allows you to easily plot data in 1D or 2D.

- **qds**: Dense Stereo Correspondence -- Densification of stereo matches using Quasi Dense Stereo method.

- **reg**: Image Registration -- Pixels based image registration for precise alignment. Follows the paper "Image Alignment and Stitching: A Tutorial", by Richard Szeliski.

- **rgbd**: RGB-Depth Processing module -- Linemod 3D object recognition; Fast surface normals and 3D plane finding. 3D visual odometry. 3d reconstruction using KinectFusion.
Expand Down
3 changes: 3 additions & 0 deletions modules/qds/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

set(the_description "Quasi Dense Stereo")
ocv_define_module(qds opencv_core opencv_imgproc opencv_video opencv_imgcodecs opencv_tracking OPTIONAL opencv_video opencv_imgproc opencv_imgcodecs opencv_core WRAP python)
8 changes: 8 additions & 0 deletions modules/qds/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Quasi Dense Stereo
======================

**qds**

Quasi Dense Stereo is method for performing dense stereo matching. This module contains a class that implements this process.
The code uses pyramidal Lucas-Kanade with Shi-Tomasi features to get the initial seed correspondences.
Then these seeds are propagated by using mentioned growing scheme.
36 changes: 36 additions & 0 deletions modules/qds/doc/qds.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@InProceedings{Stoyanov2010,
author="Stoyanov, Danail
and Scarzanella, Marco Visentini
and Pratt, Philip
and Yang, Guang-Zhong",
editor="Jiang, Tianzi
and Navab, Nassir
and Pluim, Josien P. W.
and Viergever, Max A.",
title="Real-Time Stereo Reconstruction in Robotically Assisted Minimally Invasive Surgery",
booktitle="Medical Image Computing and Computer-Assisted Intervention (MICCAI 2010)",
year="2010",
publisher="Springer Berlin Heidelberg",
address="Berlin, Heidelberg",
pages="275--282",
abstract="The recovery of 3D tissue structure and morphology during robotic assisted surgery is an important step towards accurate deployment of surgical guidance and control techniques in minimally invasive therapies. In this article, we present a novel stereo reconstruction algorithm that propagates disparity information around a set of candidate feature matches. This has the advantage of avoiding problems with specular highlights, occlusions from instruments and view dependent illumination bias. Furthermore, the algorithm can be used with any feature matching strategy allowing the propagation of depth in very disparate views. Validation is provided for a phantom model with known geometry and this data is available online in order to establish a structured validation scheme in the field. The practical value of the proposed method is further demonstrated by reconstructions on various in vivo images of robotic assisted procedures, which are also available to the community.",
isbn="978-3-642-15705-9"
}




@article{Lhuillier2000,
abstract = {A new robust dense matching algorithm is introduced. The algorithm$\backslash$nstarts from matching the most textured points, then a match propagation$\backslash$nalgorithm is developed with the best first strategy to dense matching.$\backslash$nNext, the matching map is regularised by using the local geometric$\backslash$nconstraints encoded by planar affine applications and by using the$\backslash$nglobal geometric constraint encoded by the fundamental matrix. Two most$\backslash$ndistinctive features are a match propagation strategy developed by$\backslash$nanalogy to region growing and a successive regularisation by local and$\backslash$nglobal geometric constraints. The algorithm is efficient, robust and can$\backslash$ncope with wide disparity. The algorithm is demonstrated on many real$\backslash$nimage pairs, and applications on image interpolation and a creation of$\backslash$nnovel views are also presented},
author = {Lhuillier, Maxime and Quan, Long},
doi = {10.1109/ICPR.2000.905620},
file = {:home/dimitrisps/Desktop/ucl/papers/quasiDenseMatching.pdf:pdf},
isbn = {0-7695-0750-6},
issn = {10514651},
journal = {Proceedings-International Conference on Pattern Recognition},
number = {1},
pages = {968--972},
title = {{Robust dense matching using local and global geometric constraints}},
volume = {15},
year = {2000}
}
73 changes: 73 additions & 0 deletions modules/qds/include/opencv2/qds.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
By downloading, copying, installing or using the software you agree to this license.
If you do not agree to this license, do not download, install,
copy or use the software.


License Agreement
For Open Source Computer Vision Library
(3-clause BSD License)

Copyright (C) 2015-2018, OpenCV Foundation, all rights reserved.
Third party copyrights are property of their respective owners.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the names of the copyright holders nor the names of the contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

This software is provided by the copyright holders and contributors "as is" and
any express or implied warranties, including, but not limited to, the implied
warranties of merchantability and fitness for a particular purpose are disclaimed.
In no event shall copyright holders or contributors be liable for any direct,
indirect, incidental, special, exemplary, or consequential damages
(including, but not limited to, procurement of substitute goods or services;
loss of use, data, or profits; or business interruption) however caused
and on any theory of liability, whether in contract, strict liability,
or tort (including negligence or otherwise) arising in any way out of
the use of this software, even if advised of the possibility of such damage.
*/





#ifndef __OPENCV_QDS_H__
#define __OPENCV_QDS_H__

#include <opencv2/qds/quasiDenseStereo.hpp>

/**
* @defgroup qds Quasi Dense Stereo
* This module contains the code to perform quasi dense stereo matching.
* The method initially starts with a sparse 3D reconstruction based on feature matching across a
* stereo image pair and subsequently propagates the structure into neighboring image regions.
* To obtain initial seed correspondences, the algorithm locates Shi and Tomashi features in the
* left image of the stereo pair and then tracks them using pyramidal Lucas-Kanade in the right image.
* To densify the sparse correspondences, the algorithm computes the zero-mean normalized
* cross-correlation (ZNCC) in small patches around every seed pair and uses it as a quality metric
* for each match. In this code, we introduce a custom structure to store the location and ZNCC value
* of correspondences called "Match". Seed Matches are stored in a priority queue sorted according to
* their ZNCC value, allowing for the best quality Match to be readily available. The algorithm pops
* Matches and uses them to extract new matches around them. This is done by considering a small
* neighboring area around each Seed and retrieving correspondences above a certain texture threshold
* that are not previously computed. New matches are stored in the seed priority queue and used as seeds.
* The propagation process ends when no additional matches can be retrieved.
*
*
* @sa This code represents the work presented in @cite Stoyanov2010.
* If this code is useful for your work please cite @cite Stoyanov2010.
*
* Also the original growing scheme idea is described in @cite Lhuillier2000
*
*/
#endif // __OPENCV_QDS_H__
Loading