facebook360_dep
Facebook360 Depth Estimation Pipeline
|
Classes | |
class | PointDistance |
struct | PyramidLevel |
Typedefs | |
using | PixelType = cv::Vec3w |
using | PixelTypeFloat = cv::Vec3f |
Functions | |
void | plotMatches (const PyramidLevel< PixelType > &pyramidLevel, const std::string &caller, const filesystem::path &debugDir) |
void | getPyramidLevelSizes (std::map< int, cv::Size > &sizes, const filesystem::path &imageDir) |
std::tuple< float, float > | computeCost (const PyramidLevel< PixelType > &pyramidLevel, const int dstIdx, const float disparity, const int x, const int y) |
void | computeBruteForceCosts (PyramidLevel< PixelType > &pyramidLevel, const int dstIdx, const float disparity, cv::Mat_< float > &costMap, cv::Mat_< float > &confidenceMap) |
void | computeBruteForceDisparity (PyramidLevel< PixelType > &pyramidLevel, const int dstIdx, const float minDepthMeters, const float maxDepthMeters, const bool partialCoverage, const bool useForegroundMasks, const int numThreads) |
void | computeBruteForceDisparities (PyramidLevel< PixelType > &pyramidLevel, const float minDepthMeters, const float maxDepthMeters, const bool partialCoverage, const bool useForegroundMasks, const int numThreads) |
void | pingPongRectangle (cv::Mat_< float > &dispRes, cv::Mat_< float > &costsRes, cv::Mat_< float > &confidencesRes, const cv::Mat_< bool > &changed, const cv::Mat_< cv::Vec3b > &labImage, const PyramidLevel< PixelType > &pyramidLevel, const int dstIdx, const int xBegin, const int yBegin, const int xEnd, const int yEnd) |
void | pingPong (PyramidLevel< PixelType > &pyramidLevel, const int iterations, const int numThreads) |
void | pingPongPropagation (PyramidLevel< PixelType > &pyramidLevel, const int iterations, const int numThreads, const filesystem::path &debugDir) |
void | getSrcMismatches (std::vector< float > &dispMatches, std::vector< float > &dispMismatches, const PyramidLevel< PixelType > &pyramidLevel, const int dstIdx, const int x, const int y) |
void | updateDstDisparityAndMismatchMask (bool &dstDispMask, float &dstDispNew, const float dispCurr, const std::vector< float > &dispMatches, std::vector< float > &dispMismatches, const float dstVar, const float varThreshLow, const float varThreshHigh) |
void | handleDisparityMismatch (std::unordered_map< std::string, cv::Mat_< float >> &mapDstDisp, PyramidLevel< PixelType > &pyramidLevel, const int dstIdx) |
void | handleDisparityMismatches (PyramidLevel< PixelType > &pyramidLevel, const int startLevel, const int numThreads) |
void | randomProposal (PyramidLevel< PixelType > &pyramidLevel, const int dstIdx, const int y, const int numProposals, const float minDepthMeters, const float maxDepthMeters) |
void | preprocessLevel (PyramidLevel< PixelType > &pyramidLevel, const float minDepthMeters, const float maxDepthMeters, const bool partialCoverage, const bool useForegroundMasks, const int numThreads) |
void | randomProposals (PyramidLevel< PixelType > &pyramidLevel, const int numProposals, const float minDepthMeters, const float maxDepthMeters, const int numThreads, const filesystem::path &debugDir) |
void | bilateralFilter (PyramidLevel< PixelType > &pyramidLevel, const int numThreads) |
void | medianFilter (PyramidLevel< PixelType > &pyramidLevel, const int numThreads) |
void | saveResults (PyramidLevel< PixelType > &pyramidLevel, const bool saveDebugImages, const std::string &outputFormatsIn) |
void | maskFov (PyramidLevel< PixelType > &pyramidLevel, const int numThreads) |
void | precomputeProjections (PyramidLevel< PixelType > &pyramidLevel, const int threads) |
void | reprojectColors (PyramidLevel< PixelType > &pyramidLevel, const int numThreads) |
void | processLevel (PyramidLevel< PixelType > &pyramidLevel, const std::string &outputFormats, const bool useForegroundMasks, const std::string &outputRoot, const int numRandomProposals, const bool partialCoverage, const float minDepthM, const float maxDepthM, const bool doMedianFilter, const bool saveDebugImages, const int pingPongIterations, const int mismatchesStartLevel, const bool doBilateralFilter, const int threads) |
bool | operator> (const PointDistance &ptDist1, const PointDistance &ptDist2) |
bool | operator< (const PointDistance &ptDist1, const PointDistance &ptDist2) |
Camera::Vector3 | dstToWorldPoint (const Camera &camDst, const int x, const int y, const float disparity, const int dstW, const int dstH, const double shiftX, const double shiftY) |
bool | worldToSrcPoint (Camera::Vector2 &pSrc, const Camera::Vector3 &pWorld, const Camera &camSrc, const int srcW, const int srcH) |
std::vector< int > | mapSrcToDstIndexes (const Camera::Rig &rigSrc, const Camera::Rig &rigDst) |
std::vector< std::array< int, 2 > > | prunePingPongCandidates (const std::vector< std::array< int, 2 >> &pingPongCandidateOffsets, const cv::Mat_< cv::Vec3b > &labImage, const std::array< int, 2 > &startPoint, const size_t numNeighbors) |
std::pair< float, float > | computeSSD (const cv::Mat_< PixelType > &dstColor, const int x, const int y, const PixelType &dstBias, const cv::Mat_< PixelType > &dstSrcColor, const float xDstSrc, const float yDstSrc, const PixelType &dstSrcBias, const int radius) |
void | plotDstPointInSrc (const Camera &camDst, const int x, const int y, const float disparity, const Camera camSrc, const cv::Mat_< PixelType > &srcColor, const cv::Mat_< PixelType > &dstColor, const filesystem::path &outputDir, const std::string &prefix) |
cv::Mat_< PixelType > | project (const cv::Mat_< PixelType > &srcColor, const cv::Mat_< cv::Vec2f > &warpDstToSrc) |
cv::Mat_< PixelType > | colorBias (const cv::Mat_< PixelType > &color, const int blurRadius) |
cv::Mat | computeRgbVariance (const cv::Mat &image, const int windowRadius) |
cv::Mat_< float > | computeImageVariance (const cv::Mat &image) |
std::vector< cv::Mat_< bool > > | generateFovMasks (const Camera::Rig &rig, const cv::Size &size, const int threads) |
filesystem::path | getImageDir (const filesystem::path &dir, const ImageType &imageType) |
filesystem::path | getImageDir (const filesystem::path &dir, const ImageType &imageType, const int level) |
filesystem::path | getImageDir (const filesystem::path &dir, const ImageType &imageType, const int level, const std::string &camId) |
filesystem::path | getImageDir (const filesystem::path &dir, const ImageType &imageType, const std::string &camId) |
filesystem::path | genFilename (const filesystem::path &dir, const ImageType &imageType, const int level, const std::string &camId, const std::string &frameName, const std::string &extension) |
void | createLevelOutputDirs (const filesystem::path &outputDir, const int level, const Camera::Rig &rig, const bool saveDebugImages) |
template<typename TPixel , typename TGuide > | |
cv::Mat_< TPixel > | generalizedJointBilateralFilter (const cv::Mat_< TPixel > &image, const cv::Mat_< TGuide > &guide, const cv::Mat_< TGuide > &neighborTGuide, const cv::Mat_< bool > &mask, const int radius, const float sigma, const float weight0=1.0f, const float weight1=1.0f, const float weight2=1.0f, const int numThreads=-1) |
int | getRadius (const cv::Size &size, const cv::Size &sizeUp) |
std::vector< cv::Mat_< float > > | upsampleDisparities (const Camera::Rig &rigIn, const std::vector< cv::Mat_< float >> &disps, const std::vector< cv::Mat_< float >> &bgDispsUp, const std::vector< cv::Mat_< bool >> &masks, const std::vector< cv::Mat_< bool >> &masksUpIn, const cv::Size &sizeUp, const bool useForegroundMasks, const int threads) |
Variables | |
const float | kLevelScale = 0.9f |
const float | kScaleDisparityPlot = 255.0f |
const float | kScaleCostPlot = 255.0f / 100.0f |
const float | kScaleConfidencePlot = 255.0f * 100.0f |
const std::vector< float > | kRgbWeights = {0.3333f, 0.3334f, 0.3333f} |
const float | kMinVar = 1.0f / 12.0f / 65025.0f |
const std::vector< std::array< int, 2 > > | candidateTemplateOriginal |
using fb360_dep::depth_estimation::PixelType = typedef cv::Vec3w |
using fb360_dep::depth_estimation::PixelTypeFloat = typedef cv::Vec3f |
void fb360_dep::depth_estimation::bilateralFilter | ( | PyramidLevel< PixelType > & | pyramidLevel, |
const int | numThreads | ||
) |
cv::Mat_< PixelType > fb360_dep::depth_estimation::colorBias | ( | const cv::Mat_< PixelType > & | color, |
const int | blurRadius | ||
) |
void fb360_dep::depth_estimation::computeBruteForceCosts | ( | PyramidLevel< PixelType > & | pyramidLevel, |
const int | dstIdx, | ||
const float | disparity, | ||
cv::Mat_< float > & | costMap, | ||
cv::Mat_< float > & | confidenceMap | ||
) |
void fb360_dep::depth_estimation::computeBruteForceDisparities | ( | PyramidLevel< PixelType > & | pyramidLevel, |
const float | minDepthMeters, | ||
const float | maxDepthMeters, | ||
const bool | partialCoverage, | ||
const bool | useForegroundMasks, | ||
const int | numThreads | ||
) |
void fb360_dep::depth_estimation::computeBruteForceDisparity | ( | PyramidLevel< PixelType > & | pyramidLevel, |
const int | dstIdx, | ||
const float | minDepthMeters, | ||
const float | maxDepthMeters, | ||
const bool | partialCoverage, | ||
const bool | useForegroundMasks, | ||
const int | numThreads | ||
) |
std::tuple< float, float > fb360_dep::depth_estimation::computeCost | ( | const PyramidLevel< PixelType > & | pyramidLevel, |
const int | dstIdx, | ||
const float | disparity, | ||
const int | x, | ||
const int | y | ||
) |
cv::Mat_< float > fb360_dep::depth_estimation::computeImageVariance | ( | const cv::Mat & | image | ) |
cv::Mat fb360_dep::depth_estimation::computeRgbVariance | ( | const cv::Mat & | image, |
const int | windowRadius | ||
) |
std::pair< float, float > fb360_dep::depth_estimation::computeSSD | ( | const cv::Mat_< PixelType > & | dstColor, |
const int | x, | ||
const int | y, | ||
const PixelType & | dstBias, | ||
const cv::Mat_< PixelType > & | dstSrcColor, | ||
const float | xDstSrc, | ||
const float | yDstSrc, | ||
const PixelType & | dstSrcBias, | ||
const int | radius | ||
) |
void fb360_dep::depth_estimation::createLevelOutputDirs | ( | const filesystem::path & | outputDir, |
const int | level, | ||
const Camera::Rig & | rig, | ||
const bool | saveDebugImages | ||
) |
Camera::Vector3 fb360_dep::depth_estimation::dstToWorldPoint | ( | const Camera & | camDst, |
const int | x, | ||
const int | y, | ||
const float | disparity, | ||
const int | dstW, | ||
const int | dstH, | ||
const double | shiftX, | ||
const double | shiftY | ||
) |
cv::Mat_<TPixel> fb360_dep::depth_estimation::generalizedJointBilateralFilter | ( | const cv::Mat_< TPixel > & | image, |
const cv::Mat_< TGuide > & | guide, | ||
const cv::Mat_< TGuide > & | neighborTGuide, | ||
const cv::Mat_< bool > & | mask, | ||
const int | radius, | ||
const float | sigma, | ||
const float | weight0 = 1.0f , |
||
const float | weight1 = 1.0f , |
||
const float | weight2 = 1.0f , |
||
const int | numThreads = -1 |
||
) |
std::vector< cv::Mat_< bool > > fb360_dep::depth_estimation::generateFovMasks | ( | const Camera::Rig & | rig, |
const cv::Size & | size, | ||
const int | threads | ||
) |
filesystem::path fb360_dep::depth_estimation::genFilename | ( | const filesystem::path & | dir, |
const ImageType & | imageType, | ||
const int | level, | ||
const std::string & | camId, | ||
const std::string & | frameName, | ||
const std::string & | extension | ||
) |
filesystem::path fb360_dep::depth_estimation::getImageDir | ( | const filesystem::path & | dir, |
const ImageType & | imageType | ||
) |
filesystem::path fb360_dep::depth_estimation::getImageDir | ( | const filesystem::path & | dir, |
const ImageType & | imageType, | ||
const int | level | ||
) |
filesystem::path fb360_dep::depth_estimation::getImageDir | ( | const filesystem::path & | dir, |
const ImageType & | imageType, | ||
const int | level, | ||
const std::string & | camId | ||
) |
filesystem::path fb360_dep::depth_estimation::getImageDir | ( | const filesystem::path & | dir, |
const ImageType & | imageType, | ||
const std::string & | camId | ||
) |
void fb360_dep::depth_estimation::getPyramidLevelSizes | ( | std::map< int, cv::Size > & | sizes, |
const filesystem::path & | imageDir | ||
) |
int fb360_dep::depth_estimation::getRadius | ( | const cv::Size & | size, |
const cv::Size & | sizeUp | ||
) |
void fb360_dep::depth_estimation::getSrcMismatches | ( | std::vector< float > & | dispMatches, |
std::vector< float > & | dispMismatches, | ||
const PyramidLevel< PixelType > & | pyramidLevel, | ||
const int | dstIdx, | ||
const int | x, | ||
const int | y | ||
) |
void fb360_dep::depth_estimation::handleDisparityMismatch | ( | std::unordered_map< std::string, cv::Mat_< float >> & | mapDstDisp, |
PyramidLevel< PixelType > & | pyramidLevel, | ||
const int | dstIdx | ||
) |
void fb360_dep::depth_estimation::handleDisparityMismatches | ( | PyramidLevel< PixelType > & | pyramidLevel, |
const int | startLevel, | ||
const int | numThreads | ||
) |
std::vector< int > fb360_dep::depth_estimation::mapSrcToDstIndexes | ( | const Camera::Rig & | rigSrc, |
const Camera::Rig & | rigDst | ||
) |
void fb360_dep::depth_estimation::maskFov | ( | PyramidLevel< PixelType > & | pyramidLevel, |
const int | numThreads | ||
) |
void fb360_dep::depth_estimation::medianFilter | ( | PyramidLevel< PixelType > & | pyramidLevel, |
const int | numThreads | ||
) |
bool fb360_dep::depth_estimation::operator< | ( | const PointDistance & | ptDist1, |
const PointDistance & | ptDist2 | ||
) |
bool fb360_dep::depth_estimation::operator> | ( | const PointDistance & | ptDist1, |
const PointDistance & | ptDist2 | ||
) |
void fb360_dep::depth_estimation::pingPong | ( | PyramidLevel< PixelType > & | pyramidLevel, |
const int | iterations, | ||
const int | numThreads | ||
) |
void fb360_dep::depth_estimation::pingPongPropagation | ( | PyramidLevel< PixelType > & | pyramidLevel, |
const int | iterations, | ||
const int | numThreads, | ||
const filesystem::path & | debugDir | ||
) |
void fb360_dep::depth_estimation::pingPongRectangle | ( | cv::Mat_< float > & | dispRes, |
cv::Mat_< float > & | costsRes, | ||
cv::Mat_< float > & | confidencesRes, | ||
const cv::Mat_< bool > & | changed, | ||
const cv::Mat_< cv::Vec3b > & | labImage, | ||
const PyramidLevel< PixelType > & | pyramidLevel, | ||
const int | dstIdx, | ||
const int | xBegin, | ||
const int | yBegin, | ||
const int | xEnd, | ||
const int | yEnd | ||
) |
void fb360_dep::depth_estimation::plotDstPointInSrc | ( | const Camera & | camDst, |
const int | x, | ||
const int | y, | ||
const float | disparity, | ||
const Camera | camSrc, | ||
const cv::Mat_< PixelType > & | srcColor, | ||
const cv::Mat_< PixelType > & | dstColor, | ||
const filesystem::path & | outputDir, | ||
const std::string & | prefix | ||
) |
void fb360_dep::depth_estimation::plotMatches | ( | const PyramidLevel< PixelType > & | pyramidLevel, |
const std::string & | caller, | ||
const filesystem::path & | debugDir | ||
) |
void fb360_dep::depth_estimation::precomputeProjections | ( | PyramidLevel< PixelType > & | pyramidLevel, |
const int | threads | ||
) |
void fb360_dep::depth_estimation::preprocessLevel | ( | PyramidLevel< PixelType > & | pyramidLevel, |
const float | minDepthMeters, | ||
const float | maxDepthMeters, | ||
const bool | partialCoverage, | ||
const bool | useForegroundMasks, | ||
const int | numThreads | ||
) |
void fb360_dep::depth_estimation::processLevel | ( | PyramidLevel< PixelType > & | pyramidLevel, |
const std::string & | outputFormats, | ||
const bool | useForegroundMasks, | ||
const std::string & | outputRoot, | ||
const int | numRandomProposals, | ||
const bool | partialCoverage, | ||
const float | minDepthM, | ||
const float | maxDepthM, | ||
const bool | doMedianFilter, | ||
const bool | saveDebugImages, | ||
const int | pingPongIterations, | ||
const int | mismatchesStartLevel, | ||
const bool | doBilateralFilter, | ||
const int | threads | ||
) |
cv::Mat_< PixelType > fb360_dep::depth_estimation::project | ( | const cv::Mat_< PixelType > & | srcColor, |
const cv::Mat_< cv::Vec2f > & | warpDstToSrc | ||
) |
std::vector< std::array< int, 2 > > fb360_dep::depth_estimation::prunePingPongCandidates | ( | const std::vector< std::array< int, 2 >> & | pingPongCandidateOffsets, |
const cv::Mat_< cv::Vec3b > & | labImage, | ||
const std::array< int, 2 > & | startPoint, | ||
const size_t | numNeighbors | ||
) |
void fb360_dep::depth_estimation::randomProposal | ( | PyramidLevel< PixelType > & | pyramidLevel, |
const int | dstIdx, | ||
const int | y, | ||
const int | numProposals, | ||
const float | minDepthMeters, | ||
const float | maxDepthMeters | ||
) |
void fb360_dep::depth_estimation::randomProposals | ( | PyramidLevel< PixelType > & | pyramidLevel, |
const int | numProposals, | ||
const float | minDepthMeters, | ||
const float | maxDepthMeters, | ||
const int | numThreads, | ||
const filesystem::path & | debugDir | ||
) |
void fb360_dep::depth_estimation::reprojectColors | ( | PyramidLevel< PixelType > & | pyramidLevel, |
const int | numThreads | ||
) |
void fb360_dep::depth_estimation::saveResults | ( | PyramidLevel< PixelType > & | pyramidLevel, |
const bool | saveDebugImages, | ||
const std::string & | outputFormatsIn | ||
) |
void fb360_dep::depth_estimation::updateDstDisparityAndMismatchMask | ( | bool & | dstDispMask, |
float & | dstDispNew, | ||
const float | dispCurr, | ||
const std::vector< float > & | dispMatches, | ||
std::vector< float > & | dispMismatches, | ||
const float | dstVar, | ||
const float | varThreshLow, | ||
const float | varThreshHigh | ||
) |
std::vector< cv::Mat_< float > > fb360_dep::depth_estimation::upsampleDisparities | ( | const Camera::Rig & | rigIn, |
const std::vector< cv::Mat_< float >> & | disps, | ||
const std::vector< cv::Mat_< float >> & | bgDispsUp, | ||
const std::vector< cv::Mat_< bool >> & | masks, | ||
const std::vector< cv::Mat_< bool >> & | masksUpIn, | ||
const cv::Size & | sizeUp, | ||
const bool | useForegroundMasks, | ||
const int | threads | ||
) |
bool fb360_dep::depth_estimation::worldToSrcPoint | ( | Camera::Vector2 & | pSrc, |
const Camera::Vector3 & | pWorld, | ||
const Camera & | camSrc, | ||
const int | srcW, | ||
const int | srcH | ||
) |
const std::vector<std::array<int, 2> > fb360_dep::depth_estimation::candidateTemplateOriginal |
const float fb360_dep::depth_estimation::kLevelScale = 0.9f |
const float fb360_dep::depth_estimation::kMinVar = 1.0f / 12.0f / 65025.0f |
const std::vector<float> fb360_dep::depth_estimation::kRgbWeights = {0.3333f, 0.3334f, 0.3333f} |
const float fb360_dep::depth_estimation::kScaleConfidencePlot = 255.0f * 100.0f |
const float fb360_dep::depth_estimation::kScaleCostPlot = 255.0f / 100.0f |
const float fb360_dep::depth_estimation::kScaleDisparityPlot = 255.0f |