facebook360_dep
Facebook360 Depth Estimation Pipeline
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
fb360_dep Namespace Reference

Namespaces

 background_subtraction
 
 bc7_util
 
 binary_fusion
 
 calibration
 
 color
 
 cv_util
 
 depth_estimation
 
 image_util
 
 isp
 
 math_util
 
 mesh_util
 
 point_cloud_util
 
 render
 
 rephoto_util
 
 system_util
 

Classes

struct  AsyncFile
 
struct  AsyncLoader
 
struct  Camera
 
struct  Canopy
 
struct  CanopyScene
 
struct  DerpTest
 
struct  Match3D
 
struct  MatchCornersTest
 
struct  PointCloudFunctor
 
struct  ReprojectionScene
 
class  ReprojectionTable
 
struct  ReprojectionTexture
 
struct  RigScene
 
struct  StripedFile
 
struct  ThreadPool
 
struct  TransformationFunctor
 
struct  VideoFile
 

Typedefs

using MatrixDepth = Eigen::Matrix< float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor >
 
using PixelType = cv::Vec4b
 
using ssize_t = ptrdiff_t
 

Enumerations

enum  ImageType { ImageType::ENUM_VALUE }
 

Functions

template<typename T >
cv::Mat_< T > reproject (const int width, const int height, const GLenum internalFormat, const GLenum format, const GLenum type, const ReprojectionTexture &reprojection, const GLuint srcTexture, const float disparity)
 
uint64_t align (uint64_t offset, uint64_t alignment)
 
uint8_t * align (uint8_t *p, uint64_t alignment)
 
template<typename T >
GLuint createCubemapTexture (const T &scene, const int edge, const Eigen::Vector3f &position, const float ipd, const bool alphaBlend)
 
cv::Mat_< cv::Vec4f > alphaFov (const cv::Mat_< cv::Vec4f > &color, Camera camera)
 
template<typename T >
cv::Mat_< cv::Vec4f > disparityColor (const cv::Mat_< float > &disparity, Camera camera, const Eigen::Vector3f &position, const T &functor)
 
template<typename T >
std::vector< cv::Mat_< cv::Vec4f > > disparityColors (const Camera::Rig &cameras, const std::vector< cv::Mat_< float >> &disparities, const Eigen::Vector3f &position, const T &functor)
 
cv::Vec4f metersToGrayscale (float meters)
 
void recycleTexture (const GLuint texture)
 
GLuint bindRecycledTexture ()
 
void emptyRecycling ()
 
const Eigen::Transform< double, 3, Eigen::Affine > generateTransform (const Camera::Vector3 &rotation, const Camera::Vector3 &translation, const Eigen::UniformScaling< double > &scale, const bool applyInReverse=false)
 
const Eigen::Transform< double, 3, Eigen::Affine > generateTransform (double const *const rotation, double const *const translation, double const *const scale, const bool applyInReverse=false)
 
void solve (ceres::Problem &problem)
 
Camera::Rig transformRig (const Camera::Rig &rig, const Camera::Vector3 &rotation, const Camera::Vector3 &translation, const Eigen::UniformScaling< double > &scale, const bool applyInReverse=false)
 
Camera::Rig alignRig (const Camera::Rig &rig, const Camera::Rig &referenceRig, bool lockRotation=false, bool lockTranslation=false, bool lockScale=false)
 
Camera transformCamera (const Camera &camera, double const *const rotation, double const *const translation, double const *const scale, const bool applyInReverse=false)
 
std::vector< Camera::Vector2loadCorners (const std::string &path)
 
cv::Mat_< PixelTyperotateImage (const cv::Mat_< PixelType > &image, const float angle)
 
Camera::Vector2 rotatePoint (const cv::Mat_< PixelType > &image, const Camera::Vector2 &pt, const float angle)
 
cv::Mat_< PixelTypetranslate (const cv::Mat_< PixelType > &image, const float t_x, const float t_y)
 
void insertIfInsideImage (std::vector< Camera::Vector2 > &trueCorners, const cv::Mat_< PixelType > &image, const Camera::Vector2 &corner)
 
 TEST (MatchCornersTest, TestTransformationDetection)
 
 TEST_F (DerpTest, TestUtilFilterDestinations)
 
template<typename T >
std::vector< T > readRawImage (const filesystem::path &rawImageFilename, const CameraIsp &cameraIsp)
 
std::unique_ptr< CameraIsp > cameraIspFromConfigFileWithOptions (const filesystem::path &configFilename, int pow2DownscaleFactor, DemosaicFilter demosaicFilter, bool applyToneCurve)
 
template<typename T >
cv::Mat_< cv::Vec< T, 3 > > rawToRgb (const std::vector< T > &rawImage, CameraIsp &cameraIsp)
 
template cv::Mat_< cv::Vec< uint8_t, 3 > > rawToRgb (const std::vector< uint8_t > &, CameraIsp &)
 
template cv::Mat_< cv::Vec< uint16_t, 3 > > rawToRgb (const std::vector< uint16_t > &, CameraIsp &)
 
template<typename T >
cv::Mat_< cv::Vec< T, 3 > > rawToRgb (const filesystem::path &rawImageFilename, const filesystem::path &ispConfigFilename, int pow2DownscaleFactor, DemosaicFilter demosaicFilter, bool applyToneCurve)
 
cv::Mat rawToRgb (const boost::filesystem::path &rawImageFilename, const boost::filesystem::path &ispConfigFilename, int pow2DownscaleFactor, DemosaicFilter demosaicFilter, bool applyToneCurve)
 
void writeIfd (const uint16_t tag, const uint16_t type, const uint32_t count, const uint32_t offset, const uint32_t offsetInc, uint32_t &dOffset, FILE *fDng)
 
template<typename T >
bool writeDng (const filesystem::path &rawImageFilename, const filesystem::path &outputFilename, CameraIsp &cameraIsp)
 
bool writeDng (const filesystem::path &rawImageFilename, const filesystem::path &outputFilename, const filesystem::path &ispConfigFilename)
 
template bool writeDng< uint8_t > (const filesystem::path &, const filesystem::path &, const filesystem::path &)
 
template bool writeDng< uint16_t > (const filesystem::path &, const filesystem::path &, const filesystem::path &)
 
enum DemosaicFilter unsigned int const DemosaicFilter kDefaultDemosaicFilterForRawToRgb std::unique_ptr< CameraIsp > cameraIspFromConfigFileWithOptions (const boost::filesystem::path &configFilename, int pow2DownscaleFactor=1, DemosaicFilter demosaicFilter=kDefaultDemosaicFilterForRawToRgb, bool applyToneCurve=true)
 
template<typename T >
bool writeDng (const boost::filesystem::path &rawImageFilename, const boost::filesystem::path &outputFilename, const boost::filesystem::path &ispConfigFilename="")
 
template<typename T >
constexpr ssize_t ssize (const T &container)
 
template<class T , ssize_t N>
constexpr ssize_t ssize (const T(&array)[N])
 
int getThreadCount ()
 

Variables

const uint64_t kPageSize = 4096
 
std::string canopyVS
 
std::string canopyFS
 
std::string canopyFS_SVD
 
std::string accumulateFS
 
std::string unpremulFS
 
std::string equirectFS
 
const float kUnit = 1.0f
 
const float kWhiteZ = 1.0f
 
const float kR = 1.0f / kUnit
 
const int kDirections = 128
 
const std::string imageTypes []
 
const DemosaicFilter kDefaultDemosaicFilterForRawToRgb = DemosaicFilter::BILINEAR
 

Detailed Description

Copyright 2004-present Facebook. All Rights Reserved.

This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree.

Typedef Documentation

◆ MatrixDepth

using fb360_dep::MatrixDepth = typedef Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>

◆ PixelType

using fb360_dep::PixelType = typedef cv::Vec4b

◆ ssize_t

using fb360_dep::ssize_t = typedef ptrdiff_t

Enumeration Type Documentation

◆ ImageType

enum fb360_dep::ImageType
strong
Enumerator
ENUM_VALUE 

Function Documentation

◆ align() [1/2]

uint64_t fb360_dep::align ( uint64_t  offset,
uint64_t  alignment 
)

◆ align() [2/2]

uint8_t* fb360_dep::align ( uint8_t *  p,
uint64_t  alignment 
)

◆ alignRig()

Camera::Rig fb360_dep::alignRig ( const Camera::Rig rig,
const Camera::Rig referenceRig,
bool  lockRotation = false,
bool  lockTranslation = false,
bool  lockScale = false 
)

◆ alphaFov()

cv::Mat_<cv::Vec4f> fb360_dep::alphaFov ( const cv::Mat_< cv::Vec4f > &  color,
Camera  camera 
)

◆ bindRecycledTexture()

GLuint fb360_dep::bindRecycledTexture ( )

◆ cameraIspFromConfigFileWithOptions() [1/2]

enum DemosaicFilter unsigned int const DemosaicFilter kDefaultDemosaicFilterForRawToRgb std::unique_ptr<CameraIsp> fb360_dep::cameraIspFromConfigFileWithOptions ( const boost::filesystem::path &  configFilename,
int  pow2DownscaleFactor = 1,
DemosaicFilter  demosaicFilter = kDefaultDemosaicFilterForRawToRgb,
bool  applyToneCurve = true 
)
strong

◆ cameraIspFromConfigFileWithOptions() [2/2]

std::unique_ptr<CameraIsp> fb360_dep::cameraIspFromConfigFileWithOptions ( const filesystem::path &  configFilename,
int  pow2DownscaleFactor,
DemosaicFilter  demosaicFilter,
bool  applyToneCurve 
)

◆ createCubemapTexture()

template<typename T >
GLuint fb360_dep::createCubemapTexture ( const T &  scene,
const int  edge,
const Eigen::Vector3f &  position,
const float  ipd,
const bool  alphaBlend 
)

◆ disparityColor()

template<typename T >
cv::Mat_<cv::Vec4f> fb360_dep::disparityColor ( const cv::Mat_< float > &  disparity,
Camera  camera,
const Eigen::Vector3f &  position,
const T &  functor 
)

◆ disparityColors()

template<typename T >
std::vector<cv::Mat_<cv::Vec4f> > fb360_dep::disparityColors ( const Camera::Rig cameras,
const std::vector< cv::Mat_< float >> &  disparities,
const Eigen::Vector3f &  position,
const T &  functor 
)

◆ emptyRecycling()

void fb360_dep::emptyRecycling ( )

◆ generateTransform() [1/2]

const Eigen::Transform< double, 3, Eigen::Affine > fb360_dep::generateTransform ( const Camera::Vector3 rotation,
const Camera::Vector3 translation,
const Eigen::UniformScaling< double > &  scale,
const bool  applyInReverse = false 
)

◆ generateTransform() [2/2]

const Eigen::Transform< double, 3, Eigen::Affine > fb360_dep::generateTransform ( double const *const  rotation,
double const *const  translation,
double const *const  scale,
const bool  applyInReverse = false 
)

◆ getThreadCount()

int fb360_dep::getThreadCount ( )
inline

◆ insertIfInsideImage()

void fb360_dep::insertIfInsideImage ( std::vector< Camera::Vector2 > &  trueCorners,
const cv::Mat_< PixelType > &  image,
const Camera::Vector2 corner 
)

◆ loadCorners()

std::vector<Camera::Vector2> fb360_dep::loadCorners ( const std::string &  path)

◆ metersToGrayscale()

cv::Vec4f fb360_dep::metersToGrayscale ( float  meters)
inline

◆ rawToRgb() [1/5]

template<typename T >
cv::Mat_< cv::Vec< T, 3 > > fb360_dep::rawToRgb ( const std::vector< T > &  rawImage,
CameraIsp &  cameraIsp 
)

◆ rawToRgb() [2/5]

template cv::Mat_<cv::Vec<uint8_t, 3> > fb360_dep::rawToRgb ( const std::vector< uint8_t > &  ,
CameraIsp &   
)

◆ rawToRgb() [3/5]

template cv::Mat_<cv::Vec<uint16_t, 3> > fb360_dep::rawToRgb ( const std::vector< uint16_t > &  ,
CameraIsp &   
)

◆ rawToRgb() [4/5]

template<typename T >
template cv::Mat_< cv::Vec< uint16_t, 3 > > fb360_dep::rawToRgb ( const filesystem::path &  rawImageFilename,
const filesystem::path &  ispConfigFilename,
int  pow2DownscaleFactor,
DemosaicFilter  demosaicFilter,
bool  applyToneCurve 
)

◆ rawToRgb() [5/5]

cv::Mat fb360_dep::rawToRgb ( const boost::filesystem::path &  rawImageFilename,
const boost::filesystem::path &  ispConfigFilename,
int  pow2DownscaleFactor,
DemosaicFilter  demosaicFilter,
bool  applyToneCurve 
)

◆ readRawImage()

template<typename T >
std::vector<T> fb360_dep::readRawImage ( const filesystem::path &  rawImageFilename,
const CameraIsp &  cameraIsp 
)

◆ recycleTexture()

void fb360_dep::recycleTexture ( const GLuint  texture)

◆ reproject()

template<typename T >
cv::Mat_<T> fb360_dep::reproject ( const int  width,
const int  height,
const GLenum  internalFormat,
const GLenum  format,
const GLenum  type,
const ReprojectionTexture reprojection,
const GLuint  srcTexture,
const float  disparity 
)

◆ rotateImage()

cv::Mat_<PixelType> fb360_dep::rotateImage ( const cv::Mat_< PixelType > &  image,
const float  angle 
)

◆ rotatePoint()

Camera::Vector2 fb360_dep::rotatePoint ( const cv::Mat_< PixelType > &  image,
const Camera::Vector2 pt,
const float  angle 
)

◆ solve()

void fb360_dep::solve ( ceres::Problem &  problem)

◆ ssize() [1/2]

template<typename T >
constexpr ssize_t fb360_dep::ssize ( const T &  container)

◆ ssize() [2/2]

template<class T , ssize_t N>
constexpr ssize_t fb360_dep::ssize ( const T(&)  array[N])

◆ TEST()

fb360_dep::TEST ( MatchCornersTest  ,
TestTransformationDetection   
)

◆ TEST_F()

fb360_dep::TEST_F ( DerpTest  ,
TestUtilFilterDestinations   
)

◆ transformCamera()

Camera fb360_dep::transformCamera ( const Camera camera,
double const *const  rotation,
double const *const  translation,
double const *const  scale,
const bool  applyInReverse = false 
)

◆ transformRig()

Camera::Rig fb360_dep::transformRig ( const Camera::Rig rig,
const Camera::Vector3 rotation,
const Camera::Vector3 translation,
const Eigen::UniformScaling< double > &  scale,
const bool  applyInReverse = false 
)

◆ translate()

cv::Mat_<PixelType> fb360_dep::translate ( const cv::Mat_< PixelType > &  image,
const float  t_x,
const float  t_y 
)

◆ writeDng() [1/3]

template<typename T >
bool fb360_dep::writeDng ( const boost::filesystem::path &  rawImageFilename,
const boost::filesystem::path &  outputFilename,
const boost::filesystem::path &  ispConfigFilename = "" 
)

◆ writeDng() [2/3]

template<typename T >
bool fb360_dep::writeDng ( const filesystem::path &  rawImageFilename,
const filesystem::path &  outputFilename,
CameraIsp &  cameraIsp 
)

◆ writeDng() [3/3]

bool fb360_dep::writeDng ( const filesystem::path &  rawImageFilename,
const filesystem::path &  outputFilename,
const filesystem::path &  ispConfigFilename 
)

◆ writeDng< uint16_t >()

template bool fb360_dep::writeDng< uint16_t > ( const filesystem::path &  ,
const filesystem::path &  ,
const filesystem::path &   
)

◆ writeDng< uint8_t >()

template bool fb360_dep::writeDng< uint8_t > ( const filesystem::path &  ,
const filesystem::path &  ,
const filesystem::path &   
)

◆ writeIfd()

void fb360_dep::writeIfd ( const uint16_t  tag,
const uint16_t  type,
const uint32_t  count,
const uint32_t  offset,
const uint32_t  offsetInc,
uint32_t &  dOffset,
FILE *  fDng 
)

Variable Documentation

◆ accumulateFS

std::string fb360_dep::accumulateFS
Initial value:
= R"(
#version 330 core
uniform sampler2D sampler;
uniform bool alphaBlend;
in vec2 texVar;
out vec4 color;
void main() {
color = texture(sampler, texVar);
if (alphaBlend) {
// we want weight, w = k^a - 1 = e^(log(k) * a) - 1
const float kLogK = 30;
color.a = exp(kLogK * color.a) - 1;
}
}
)"

◆ canopyFS

std::string fb360_dep::canopyFS

◆ canopyFS_SVD

std::string fb360_dep::canopyFS_SVD

◆ canopyVS

std::string fb360_dep::canopyVS

◆ equirectFS

std::string fb360_dep::equirectFS
Initial value:
= R"(
#version 330 core
uniform samplerCube sampler;
in vec2 texVar;
out vec4 color;
void main() {
// remap texVar to equirect direction with z up, BUT
// - flip texVar.x because latitude grows in the negative direction of the z-axis
// - flip texVar.y because glReadPixels reads the image from the bottom up
const float PI = 3.1415926535897932384626433832795;
float lon = (1 - texVar.x) * 2.0 * PI; // 360 .. 0 degrees
float lat = -(texVar.y - 0.5) * PI; // 180 .. -180 degrees
vec3 direction = vec3(
cos(lat) * cos(lon),
cos(lat) * sin(lon),
sin(lat));
color = texture(sampler, direction);
}
)"

◆ imageTypes

const std::string fb360_dep::imageTypes[]
Initial value:
{
#define NAME(name, str)
}

◆ kDefaultDemosaicFilterForRawToRgb

const DemosaicFilter fb360_dep::kDefaultDemosaicFilterForRawToRgb = DemosaicFilter::BILINEAR

◆ kDirections

const int fb360_dep::kDirections = 128

◆ kPageSize

const uint64_t fb360_dep::kPageSize = 4096

◆ kR

const float fb360_dep::kR = 1.0f / kUnit

◆ kUnit

const float fb360_dep::kUnit = 1.0f

◆ kWhiteZ

const float fb360_dep::kWhiteZ = 1.0f

◆ unpremulFS

std::string fb360_dep::unpremulFS
Initial value:
= R"(
#version 330 core
uniform sampler2D sampler;
in vec2 texVar;
out vec4 color;
void main() {
color = texture(sampler, texVar);
color /= color.a;
}
)"