OpenCV
4.5.1
Open Source Computer Vision
|
Class containing the methods needed for Quasi Dense Stereo computation. More...
#include <opencv2/stereo/quasi_dense_stereo.hpp>
Public Member Functions | |
virtual | ~QuasiDenseStereo ()=0 |
destructor Method to free all the memory allocated by matrices and vectors in this class. More... | |
virtual void | getDenseMatches (std::vector< stereo::Match > &denseMatches)=0 |
Get The dense corresponding points. More... | |
virtual cv::Mat | getDisparity (uint8_t disparityLvls=50)=0 |
Compute and return the disparity map based on the correspondences found in the "process" method. More... | |
virtual cv::Point2f | getMatch (const int x, const int y)=0 |
Specify pixel coordinates in the left image and get its corresponding location in the right image. More... | |
virtual void | getSparseMatches (std::vector< stereo::Match > &sMatches)=0 |
Get The sparse corresponding points. More... | |
virtual int | loadParameters (cv::String filepath)=0 |
Load a file containing the configuration parameters of the class. More... | |
virtual void | process (const cv::Mat &imgLeft, const cv::Mat &imgRight)=0 |
Main process of the algorithm. This method computes the sparse seeds and then densifies them. More... | |
virtual int | saveParameters (cv::String filepath)=0 |
Save a file containing all the configuration parameters the class is currently set to. More... | |
Static Public Member Functions | |
static cv::Ptr< QuasiDenseStereo > | create (cv::Size monoImgSize, cv::String paramFilepath=cv::String()) |
Public Attributes | |
PropagationParameters | Param |
Class containing the methods needed for Quasi Dense Stereo computation.
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.
Also the original growing scheme idea is described in [135]